aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4da78b8..daf1a6c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d883da6..14a6a40 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);