summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-06 20:27:16 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-06 20:27:16 +0000
commitccecc1bb43d26aa8fa8f396bc8537e223e60048e (patch)
treef205818190e2b73627abf935bc943eab01251ca3 /clang/test/SemaTemplate
parent2cdb806fd88bccd7d4bf22fa358cc79609492f55 (diff)
downloadbcm5719-llvm-ccecc1bb43d26aa8fa8f396bc8537e223e60048e.tar.gz
bcm5719-llvm-ccecc1bb43d26aa8fa8f396bc8537e223e60048e.zip
Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class
llvm-svn: 92855
Diffstat (limited to 'clang/test/SemaTemplate')
-rw-r--r--clang/test/SemaTemplate/virtual-member-functions.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/virtual-member-functions.cpp b/clang/test/SemaTemplate/virtual-member-functions.cpp
index a9eb729ed5a..db243130bb3 100644
--- a/clang/test/SemaTemplate/virtual-member-functions.cpp
+++ b/clang/test/SemaTemplate/virtual-member-functions.cpp
@@ -41,3 +41,15 @@ struct Derived : Base<T> {
template struct Derived<int>; // expected-note{{instantiation}}
+template<typename T>
+struct HasOutOfLineKey {
+ HasOutOfLineKey() { } // expected-note{{in instantiation of member function 'HasOutOfLineKey<int>::f' requested here}}
+ virtual T *f(float *fp);
+};
+
+template<typename T>
+T *HasOutOfLineKey<T>::f(float *fp) {
+ return fp; // expected-error{{cannot initialize return object of type 'int *' with an lvalue of type 'float *'}}
+}
+
+HasOutOfLineKey<int> out_of_line;
OpenPOWER on IntegriCloud