diff options
author | Jason Merrill <jason@redhat.com> | 2010-02-18 11:27:07 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-02-18 11:27:07 -0500 |
commit | 935c0a5d24f70295aee602e4dcdff465d1931024 (patch) | |
tree | abd944b2787b47eb1b36041d35e8110e9cfe3262 | |
parent | 746e119f8d8d24c3dd46944b4a6a7c54fdfe981c (diff) | |
download | gcc-935c0a5d24f70295aee602e4dcdff465d1931024.zip gcc-935c0a5d24f70295aee602e4dcdff465d1931024.tar.gz gcc-935c0a5d24f70295aee602e4dcdff465d1931024.tar.bz2 |
re PR c++/43109 (ICE: SIGSEGV with unnamed namespace inside named)
PR c++/43109
* semantics.c (begin_class_definition): Don't crash on unnamed ns.
From-SVN: r156864
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/namespace12.C | 7 |
4 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9ebc609..357b925 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 90a76d9..24390d9 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9c82d35..dbc8226 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..25d6ae0 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/namespace12.C @@ -0,0 +1,7 @@ +// PR c++/43109 + +namespace std { + namespace { + struct S {}; + } +} |