From 05cfc295f45dae510104f56d4ee6cb94206c3799 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 14 May 2010 05:08:22 +0000 Subject: Namespaces can only be defined at global or namespace scope. Fixes PR6596. llvm-svn: 103767 --- clang/test/Parser/namespaces.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 clang/test/Parser/namespaces.cpp (limited to 'clang/test/Parser/namespaces.cpp') 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}} +} -- cgit v1.2.3