diff options
author | Alexandre Oliva <oliva@dcc.unicamp.br> | 1998-10-07 20:59:13 +0000 |
---|---|---|
committer | Alexandre Oliva <oliva@gcc.gnu.org> | 1998-10-07 20:59:13 +0000 |
commit | 5e11b87c5f1203a21091ecc7b9b364af7583851b (patch) | |
tree | 334bc64a093c0201b720ede55343e04e06cfffec | |
parent | b01c911dca4ba05df22d93ee4120a2b59cae9000 (diff) | |
download | gcc-5e11b87c5f1203a21091ecc7b9b364af7583851b.zip gcc-5e11b87c5f1203a21091ecc7b9b364af7583851b.tar.gz gcc-5e11b87c5f1203a21091ecc7b9b364af7583851b.tar.bz2 |
extern1.C: New test.
* g++.old-deja/g++.ns/extern1.C: New test. Extern declarations
within functions should introduce names into the innermost
enclosing namespace
From-SVN: r22902
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ns/extern1.C | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 310ee0e..78bddf1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,10 @@ 1998-10-08 Alexandre Oliva <oliva@dcc.unicamp.br> - * g++.old-deja/g++.other/init7.C: New test: retry initialization + * g++.old-deja/g++.ns/extern1.C: New test. Extern declarations + within functions should introduce names into the innermost + enclosing namespace + + * g++.old-deja/g++.other/init7.C: New test. Retry initialization of static locals if first initialization throws Wed Oct 7 12:00:20 1998 Jim Wilson <wilson@cygnus.com> diff --git a/gcc/testsuite/g++.old-deja/g++.ns/extern1.C b/gcc/testsuite/g++.old-deja/g++.ns/extern1.C new file mode 100644 index 0000000..f4ab5ef --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ns/extern1.C @@ -0,0 +1,18 @@ +// Build don't run: + +// Based on a testcase by eyal.ben-david@aks.com + +// An extern declaration of an undeclared object within a function +// introduces the object into the enclosing namespace [basic.link]/7 + +namespace { + void foo() { + extern int xx; // causes linker error - XFAIL *-*-* + xx = 0; + } + int xx = 1; +} + +int main() { + xx = 2; +} |