diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/anon2.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/anon3.C | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 70a750a25cb..408b0c2dae8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-02-23 Alexandre Oliva <aoliva@redhat.com> + + * g++.dg/lookup/anon2.C: Don't let access checks make it look like + the test passes. + * g++.dg/other/anon3.C: Accept a warning. + 2005-02-23 Kazu Hirata <kazu@cs.umass.edu> * gcc.dg/pr20017.c: Fix a comment typo. 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; } diff --git a/gcc/testsuite/g++.dg/other/anon3.C b/gcc/testsuite/g++.dg/other/anon3.C index 87cbfb544cd..87116eb8901 100644 --- a/gcc/testsuite/g++.dg/other/anon3.C +++ b/gcc/testsuite/g++.dg/other/anon3.C @@ -4,4 +4,4 @@ // { dg-do compile } -enum { a = 3 } x; +enum { a = 3 } x; // { dg-warning "anonymous type" } |