summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C
blob: cf193e0cba592423e04b22d0779babbd069f0334 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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" }