aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@dcc.unicamp.br>1998-10-07 20:59:13 +0000
committerAlexandre Oliva <oliva@gcc.gnu.org>1998-10-07 20:59:13 +0000
commit5e11b87c5f1203a21091ecc7b9b364af7583851b (patch)
tree334bc64a093c0201b720ede55343e04e06cfffec
parentb01c911dca4ba05df22d93ee4120a2b59cae9000 (diff)
downloadgcc-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/ChangeLog6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/extern1.C18
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;
+}