diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-14 05:08:22 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-14 05:08:22 +0000 |
commit | 95f1b15ce1b281c8517d77792abe540753fbcc12 (patch) | |
tree | d65e72d070343f5c9907fc6398659c9a7de82a35 /test/Parser/namespaces.cpp | |
parent | 00b4b039f02d338ae4774797053235a7e65abbde (diff) |
Namespaces can only be defined at global or namespace scope. Fixes PR6596.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/namespaces.cpp')
-rw-r--r-- | test/Parser/namespaces.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Parser/namespaces.cpp b/test/Parser/namespaces.cpp new file mode 100644 index 0000000000..b8c7819a01 --- /dev/null +++ b/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}} +} |