From b7d56bdfe99532da6a60aa6e958a5022e3848ecd Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 25 May 2012 19:29:33 +0200 Subject: [PATCH] re PR objc++/53441 (obj-c++.dg/ivar-invalid-type-1.mm ICE) 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 | 6 ++++++ gcc/cp/decl.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4da78b850cb..daf1a6cfe3e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-05-24 Uros Bizjak + + 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 PR c++/32080 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d883da6b640..14a6a40d6ce 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); -- 2.30.2