summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class.derived
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-22 00:24:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-22 00:24:47 +0000
commitd80b2d57cf24fb80c8ecc40b32ca10fdbeae0c85 (patch)
tree57f99c982707c8bbd59ffb8ec9634ea998f22abe /clang/test/CXX/class.derived
parent56cb16dd927fa9304aa5b4474aa1d23ea8acc5c0 (diff)
downloadbcm5719-llvm-d80b2d57cf24fb80c8ecc40b32ca10fdbeae0c85.tar.gz
bcm5719-llvm-d80b2d57cf24fb80c8ecc40b32ca10fdbeae0c85.zip
Fix CXXRecordDecl::forallBases to not look through bases which are dependent
and defined within the current instantiation, but which are not part of the current instantiation. Previously, it would look at bases which could be specialized separately from the current template. llvm-svn: 168477
Diffstat (limited to 'clang/test/CXX/class.derived')
-rw-r--r--clang/test/CXX/class.derived/class.virtual/p3-0x.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp b/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp
index 16f98280ed8..6a02a867318 100644
--- a/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud