diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C b/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C new file mode 100644 index 000000000..cf193e0cb --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C @@ -0,0 +1,18 @@ +// Test for the warning of exposing types from an anonymous namespace +// { dg-do compile } + +#include "anonymous-namespace-1.h" + +namespace { + class good { }; +} + +class foo::bar : public good { }; +class foobar1 +{ + good g; +}; + +#line 17 "foo.C" +class foobar : public bad { }; // { dg-warning "uses the anonymous namespace" } +class foobar2 { bad b; }; // { dg-warning "uses the anonymous namespace" } |