diff options
author | Nathan Sidwell <nathan@acm.org> | 1999-08-25 12:05:23 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 1999-08-25 12:05:23 +0000 |
commit | f4c6443e4d075b72c3fbe4d0c0caa2bf0abf5700 (patch) | |
tree | 45e1e6f58fe6a8f5881d1c5ebe79ae355279f67f /gcc | |
parent | d7f426dc123d4fed0f52271d083436d3769d8d06 (diff) | |
download | gcc-f4c6443e4d075b72c3fbe4d0c0caa2bf0abf5700.tar.gz |
* g++.old-deja/g++.other/decl5.C: New test
From-SVN: r28857
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/decl5.C | 78 |
2 files changed, 82 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0319304cdcb..1c13f9f6df1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +1999-08-25 Nathan Sidwell <nathan@acm.org> + + * g++.old-deja/g++.other/decl5.C: New test. + 1999-08-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * noncompile/noncompile.exp: Load_lib c-torture.exp. diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl5.C b/gcc/testsuite/g++.old-deja/g++.other/decl5.C new file mode 100644 index 00000000000..528574cb66c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C @@ -0,0 +1,78 @@ +// Build don't link: + +// Copyright (C) 1999 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Apr 1999 <nathan@acm.org> +// derived from a bug report by <rch@larissa.sd.bi.ruhr-uni-bochum.de> +// http://egcs.cygnus.com/ml/egcs-bugs/1999-04/msg00626.html +// the code is wrong, but we fell over badly + + +struct A { + int A::fn(); // WARNING - extra qualification + int A::m; // WARNING - extra qualification + struct e; + struct A::e {int i;}; + struct A::expand { // WARNING - extra qualification + int m; + }; + struct Z; + expand me; + void foo(struct A::e); + void foo(struct A::z); // WARNING - extra qualification +}; + +struct Q; +struct B { + struct A::fink { // ERROR - no such member + int m; + }; + struct A::Z { // ERROR XFAIL - A::Z not a member of B + int m; + }; + int m; + int n; + struct ::Q { // ERROR XFAIL - ::Q not a member of B + int m; + }; + int A::fn() { // ERROR - A::fn not a member of B + return 0; + } + void fn(struct ::Q &); + void foo(struct A::y); // ERROR - no such member +}; + +struct ::C { // WARNING - extra qualification + int i; +}; + +namespace N { + int fn(); + struct F; +} + +namespace NMS +{ + void NMS::fn(); // WARNING - extra qualification XFAIL + int NMS::i; // WARNING - extra qualification XFAIL + struct NMS::D { // WARNING - extra qualification + int i; + }; + struct N::E { // ERROR - no such type + int i; + }; + struct ::F { // ERROR - no such type + int i; + }; + int N::fn() { // ERROR - N::fn not a member of NMS + return 0; + } + struct N::F { // ERROR XFAIL - N::F not a member of NMS + int i; + }; +} + +NMS::D thing; +void NMS::fn() +{ + i = 3; +} |