summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.C
blob: 4048f3959df4b0f608a28cec299125aea1ee4d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Test for the warning of exposing types from an anonymous namespace
// { dg-do compile }
//
#include "anonymous-namespace-2.h"

namespace {
    struct good { };
}

struct g1 {
    good * A;
};
struct g2 {
    good * A[1];
};
struct g3 {
    good (*A)[1];
};

#line 21 "foo.C"
struct b1 { // { dg-warning "uses the anonymous namespace" }
    bad * B;
};
struct b2 { // { dg-warning "uses the anonymous namespace" }
    bad * B[1];
};
struct b3 { // { dg-warning "uses the anonymous namespace" }
    bad (*B)[1];
};