diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/anon2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/anon2.C | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/anon2.C b/gcc/testsuite/g++.dg/lookup/anon2.C index 4cd64aecb49..d556ba0034a 100644 --- a/gcc/testsuite/g++.dg/lookup/anon2.C +++ b/gcc/testsuite/g++.dg/lookup/anon2.C @@ -1,6 +1,9 @@ // { dg-do compile } // { dg-options "" } -class { int i; } a; // { dg-error "private|anonymous type" } -void foo() { a.i; } // { dg-error "context" } +// Make sure we issue a diagnostic if a type with no linkage is used +// to declare a a variable that has linkage. +struct { int i; } a; // { dg-warning "anonymous type" } + +void foo() { a.i; } |