re PR objc++/53441 (obj-c++.dg/ivar-invalid-type-1.mm ICE)
authorUros Bizjak <ubizjak@gmail.com>
Fri, 25 May 2012 17:29:33 +0000 (19:29 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 25 May 2012 17:29:33 +0000 (19:29 +0200)
PR obj-c++/53441
* decl.c (grokdeclarator): Check that current_class_type is non-NULL
before calling constructor_name_p.

From-SVN: r187888

gcc/cp/ChangeLog
gcc/cp/decl.c

index 4da78b850cb1bd0e642b18aadd3ab88964dfdeb5..daf1a6cfe3e93bffaaf6a46d2541eb2b1991f31c 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-24  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR obj-c++/53441
+       * decl.c (grokdeclarator): Check that current_class_type is non-NULL
+       before calling constructor_name_p.
+
 2012-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/32080
index d883da6b6406a84fc85990ef784f5ea63995cd92..14a6a40d6cee3d1fc0a176a1179177229216a558 100644 (file)
@@ -9803,7 +9803,8 @@ grokdeclarator (const cp_declarator *declarator,
               clones.  */
            DECL_ABSTRACT (decl) = 1;
        }
-      else if (constructor_name_p (unqualified_id, current_class_type))
+      else if (current_class_type
+              && constructor_name_p (unqualified_id, current_class_type))
        permerror (input_location, "ISO C++ forbids nested type %qD with same name "
                   "as enclosing class",
                   unqualified_id);