diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-03-17 23:06:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-03-17 23:06:31 +0000 |
commit | 42aceadbc3806868cee8ac576347d258ac99e1f6 (patch) | |
tree | 485d8f0e3546c1d43dfe552ea24878157fe0bb00 /test/CXX | |
parent | f3aae58296fd5f930f7c4c0709886924e6822ae7 (diff) |
Diagnose tag and class template declarations with qualified
declarator-ids that occur at class scope. Fixes PR8019.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/class.access/p4.cpp | 2 | ||||
-rw-r--r-- | test/CXX/dcl.decl/dcl.meaning/p1.cpp | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/CXX/class.access/p4.cpp b/test/CXX/class.access/p4.cpp index add3635fa6..058a158beb 100644 --- a/test/CXX/class.access/p4.cpp +++ b/test/CXX/class.access/p4.cpp @@ -481,7 +481,7 @@ namespace test21 { }; template <class T> class A<T>::Inner {}; class B { - template <class T> class A<T>::Inner; + template <class T> class A<T>::Inner; // expected-error{{non-friend class member 'Inner' cannot have a qualified name}} }; void test() { diff --git a/test/CXX/dcl.decl/dcl.meaning/p1.cpp b/test/CXX/dcl.decl/dcl.meaning/p1.cpp new file mode 100644 index 0000000000..9aa3a20bcd --- /dev/null +++ b/test/CXX/dcl.decl/dcl.meaning/p1.cpp @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +namespace PR8019 { + struct x; + template<typename T> struct x2; + struct y { + struct PR8019::x { int x; }; // expected-error{{non-friend class member 'x' cannot have a qualified name}} + + struct inner; + struct y::inner { }; // expected-warning{{extra qualification on member 'inner'}} + + template<typename T> + struct PR8019::x2 { }; // expected-error{{non-friend class member 'x2' cannot have a qualified name}} + + template<typename T> + struct inner_template; + + template<typename T> + struct y::inner_template { }; // expected-warning{{extra qualification on member 'inner_template'}} + }; + +} |