summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/namespaces.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-14 05:08:22 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-14 05:08:22 +0000
commit05cfc295f45dae510104f56d4ee6cb94206c3799 (patch)
treea479564ec4d2a0f2bc76498bc0e69840b6f9354d /clang/test/Parser/namespaces.cpp
parentf3d3ae665cdb8cdd72ecab587929321a1dae6290 (diff)
downloadbcm5719-llvm-05cfc295f45dae510104f56d4ee6cb94206c3799.tar.gz
bcm5719-llvm-05cfc295f45dae510104f56d4ee6cb94206c3799.zip
Namespaces can only be defined at global or namespace scope. Fixes PR6596.
llvm-svn: 103767
Diffstat (limited to 'clang/test/Parser/namespaces.cpp')
-rw-r--r--clang/test/Parser/namespaces.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Parser/namespaces.cpp b/clang/test/Parser/namespaces.cpp
new file mode 100644
index 00000000000..b8c7819a019
--- /dev/null
+++ b/clang/test/Parser/namespaces.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// PR6596
+namespace g { enum { o = 0 }; }
+
+void foo() {
+ namespace a { typedef g::o o; } // expected-error{{namespaces can only be defined in global or namespace scope}}
+}
OpenPOWER on IntegriCloud