]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/43109 (ICE: SIGSEGV with unnamed namespace inside named)
authorJason Merrill <jason@redhat.com>
Thu, 18 Feb 2010 16:27:07 +0000 (11:27 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 18 Feb 2010 16:27:07 +0000 (11:27 -0500)
PR c++/43109
* semantics.c (begin_class_definition): Don't crash on unnamed ns.

From-SVN: r156864

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/namespace12.C [new file with mode: 0644]

index 9ebc6095b1d6c3faef4637c8cb9bf443d4df1af3..357b925390d1347fe939b076b70303bb08dd69a8 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43109
+       * semantics.c (begin_class_definition): Don't crash on unnamed ns.
+
 2010-02-17  Jason Merrill  <jason@redhat.com>
 
        PR c++/43075
index 90a76d9391cecc5aa96f53e9cf6cd010062d8ed1..24390d98c0c4f3349f00596d7eaa7bcef582aade 100644 (file)
@@ -2378,6 +2378,7 @@ begin_class_definition (tree t, tree attributes)
       tree ns = TYPE_CONTEXT (t);
       if (ns && TREE_CODE (ns) == NAMESPACE_DECL
          && DECL_CONTEXT (ns) == std_node
+         && DECL_NAME (ns)
          && !strcmp (IDENTIFIER_POINTER (DECL_NAME (ns)), "decimal"))
        {
          const char *n = TYPE_NAME_STRING (t);
index 9c82d351469f7a8bd6084f51e4ecd73e5531ee67..dbc8226220b67fa458ed574cc3f2ddac42eccf83 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43109
+       * g++.dg/parse/namespace12.C: New.
+
 2010-02-18  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/43066
diff --git a/gcc/testsuite/g++.dg/parse/namespace12.C b/gcc/testsuite/g++.dg/parse/namespace12.C
new file mode 100644 (file)
index 0000000..25d6ae0
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/43109
+
+namespace std {
+ namespace {
+   struct S {};
+ }
+}
This page took 0.099144 seconds and 5 git commands to generate.