From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.old-deja/g++.other/decl5.C | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/decl5.C (limited to 'gcc/testsuite/g++.old-deja/g++.other/decl5.C') 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 000000000..d13f7b1d0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/decl5.C @@ -0,0 +1,79 @@ +// { dg-do assemble } + +// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Apr 1999 +// derived from a bug report by +// http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00631.html +// the code is wrong, but we fell over badly + + +struct A { + int A::fn(); // { dg-error "extra qualification" } + int A::m; // { dg-error "extra qualification" } + struct e; + struct A::e {int i;}; // { dg-error "extra qualification" "qual" } + // { dg-error "anonymous struct" "anon" { target *-*-* } 14 } + struct A::expand { // { dg-error "qualified name" } + int m; + }; + struct Z; + expand me; // { dg-error "'expand' does not name a type" } + void foo(struct A::e); + void foo(struct A::z); // { dg-error "does not name a type" } +}; + +struct Q; +struct B { + struct A::fink { // { dg-error "does not name a class before" } + int m; + }; + struct A::Z { // { dg-error "does not enclose" } A::Z not a member of B + int m; + }; + int m; + int n; + struct ::Q { // { dg-error "global qual" } ::Q not a member of B + int m; + }; + int A::fn() { // { dg-error "cannot define member" } A::fn not a member of B + return 0; + } + void fn(struct ::Q &); + void foo(struct A::y); // { dg-error "does not name a type" } no such member +}; + +struct ::C { // { dg-error "invalid before" } extra qualification + int i; +}; + +namespace N { + int fn(); + struct F; +} + +namespace NMS +{ + void NMS::fn(); // { dg-error "explicit qual" } + int NMS::i; // { dg-error "explicit qual" } + struct NMS::D { // { dg-error "does not name a class" } + int i; + }; + struct N::E { // { dg-error "does not name a class" } no such type + int i; + }; + struct ::F { // { dg-error "global qual" } no such type + int i; + }; + int N::fn() { // { dg-error "namespace" } N::fn not a member of NMS + return 0; + } + struct N::F { // { dg-error "namespace" } N::F not a member of NMS + int i; + }; +} + +NMS::D thing; // { dg-error "'D' in namespace 'NMS' does not name a type" } +void NMS::fn() +{ + i = 3; +} -- cgit v1.2.3