diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/CXX/class.derived/class.virtual/p3-0x.cpp | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/CXX/class.derived/class.virtual/p3-0x.cpp')
-rw-r--r-- | test/CXX/class.derived/class.virtual/p3-0x.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CXX/class.derived/class.virtual/p3-0x.cpp b/test/CXX/class.derived/class.virtual/p3-0x.cpp index 16f9828..6a02a86 100644 --- a/test/CXX/class.derived/class.virtual/p3-0x.cpp +++ b/test/CXX/class.derived/class.virtual/p3-0x.cpp @@ -100,3 +100,33 @@ namespace PR13499 { Y<X> y; Z<X> z; // expected-note {{in instantiation of}} } + +namespace MemberOfUnknownSpecialization { + template<typename T> struct A { + struct B {}; + struct C : B { + void f() override; + }; + }; + + template<> struct A<int>::B { + virtual void f(); + }; + // ok + A<int>::C c1; + + template<> struct A<char>::B { + void f(); + }; + // expected-error@-13 {{only virtual member functions can be marked 'override'}} + // expected-note@+1 {{in instantiation of}} + A<char>::C c2; + + template<> struct A<double>::B { + virtual void f() final; + }; + // expected-error@-20 {{declaration of 'f' overrides a 'final' function}} + // expected-note@-3 {{here}} + // expected-note@+1 {{in instantiation of}} + A<double>::C c3; +} |