1 // RUN: %clang_cc1 %s -fsyntax-only -verify -Wweak-vtables -Wweak-template-vtables
3 struct A { // expected-warning {{'A' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}}
7 template<typename T> struct B {
27 void uses(A &a, B<int> &b, C &c) {
33 // <rdar://problem/9979458>
38 virtual void * getFoo() const = 0;
41 class Derived : public Parent {
44 void * getFoo() const;
47 class VeryDerived : public Derived { // expected-warning{{'VeryDerived' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}}
49 void * getFoo() const { return 0; }
54 void uses(Parent &p, Derived &d, VeryDerived &vd) {
60 template<typename T> struct TemplVirt {
64 template class TemplVirt<float>; // expected-warning{{explicit template instantiation 'TemplVirt<float>' will emit a vtable in every translation unit}}
66 template<> struct TemplVirt<bool> {
70 template<> struct TemplVirt<long> { // expected-warning{{'TemplVirt<long>' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}}
74 void uses(TemplVirt<float>& f, TemplVirt<bool>& b, TemplVirt<long>& l) {