]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/45043 (ICE: tree check: expected identifier_node, have bit_not_expr in...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 30 Aug 2010 18:13:32 +0000 (18:13 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 30 Aug 2010 18:13:32 +0000 (18:13 +0000)
/cp
2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/45043
* decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.

/testsuite
2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/45043
* g++.dg/template/crash102.C: New.

From-SVN: r163655

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/crash102.C [new file with mode: 0644]

index de8575c0717dde833da01c70af2673eba91c55d1..071f8d6deb874ac1e3a3267c0d233d37d0a7c419 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/45043
+       * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
+
 2010-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/45423
index 6465658f5de2a54f42c91cdf4d0033c0202ba7ac..75fd9f759b9c073e3888f26a19bbfa21787df945 100644 (file)
@@ -8115,7 +8115,8 @@ grokdeclarator (const cp_declarator *declarator,
         common.  With no options, it is allowed.  With -Wreturn-type,
         it is a warning.  It is only an error with -pedantic-errors.  */
       is_main = (funcdef_flag
-                && dname && MAIN_NAME_P (dname)
+                && dname && TREE_CODE (dname) == IDENTIFIER_NODE
+                && MAIN_NAME_P (dname)
                 && ctype == NULL_TREE
                 && in_namespace == NULL_TREE
                 && current_namespace == global_namespace);
index 62d329b6a06b8af28ea164fcd50fbc12c479e25a..9bbb54bbf38bb30fc3aea3c48505ec43747a3120 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/45043
+       * g++.dg/template/crash102.C: New.
+
 2010-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/45423
diff --git a/gcc/testsuite/g++.dg/template/crash102.C b/gcc/testsuite/g++.dg/template/crash102.C
new file mode 100644 (file)
index 0000000..fd3c36e
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/45043
+
+template < typename > class A;
+template < typename T > A < T >::B::~B () // { dg-error "type" }
+{}