diff options
author | Ollie Wild <aaw@google.com> | 2007-05-22 20:36:49 +0000 |
---|---|---|
committer | Ollie Wild <aaw@gcc.gnu.org> | 2007-05-22 20:36:49 +0000 |
commit | 6936461f13040d03e5371a9069fe477ac8a7c705 (patch) | |
tree | 368888b60765a9526144f55f06ee0900145bfb40 /gcc/testsuite | |
parent | 3f457a0db87291d494da0e701dab4ead009592be (diff) | |
download | gcc-6936461f13040d03e5371a9069fe477ac8a7c705.zip gcc-6936461f13040d03e5371a9069fe477ac8a7c705.tar.gz gcc-6936461f13040d03e5371a9069fe477ac8a7c705.tar.bz2 |
decl.c (duplicate_decls): Verify namespace names are unique.
* decl.c (duplicate_decls): Verify namespace names are unique.
* g++.dg/lookup/name-clash5.C: New test.
* g++.dg/lookup/name-clash6.C: New test.
From-SVN: r124960
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/name-clash5.C | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/name-clash6.C | 13 |
3 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 601700c..77b6a7f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-05-22 Ollie Wild <aaw@google.com> + + * g++.dg/lookup/name-clash5.C: New test. + * g++.dg/lookup/name-clash6.C: New test. + 2007-05-22 H.J. Lu <hongjiu.lu@intel.com> * g++.dg/other/i386-2.C: Update comments on header files tested. diff --git a/gcc/testsuite/g++.dg/lookup/name-clash5.C b/gcc/testsuite/g++.dg/lookup/name-clash5.C new file mode 100644 index 0000000..7f220d8 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/name-clash5.C @@ -0,0 +1,13 @@ +// Copyright (C) 2007 Free Software Foundation +// Contributed by Ollie Wild <aaw@google.com> +// { dg-do compile } + +// C++ Standard, 3.3, clause 4: +// "[Note: a namespace name or a class template name must be unique in its +// declarative region (7.3.2, clause 14). ]" + +namespace N +{ // { dg-error "previous declaration" } +} + +class N; // { dg-error "redeclared" } diff --git a/gcc/testsuite/g++.dg/lookup/name-clash6.C b/gcc/testsuite/g++.dg/lookup/name-clash6.C new file mode 100644 index 0000000..63a0b15 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/name-clash6.C @@ -0,0 +1,13 @@ +// Copyright (C) 2007 Free Software Foundation +// Contributed by Ollie Wild <aaw@google.com> +// { dg-do compile } + +// C++ Standard, 3.3, clause 4: +// "[Note: a namespace name or a class template name must be unique in its +// declarative region (7.3.2, clause 14). ]" + +class N; // { dg-error "previous declaration" } + +namespace N +{ // { dg-error "redeclared" } +} |