]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaCXX/warn-weak-vtables.cpp
Update clang to r104832.
[FreeBSD/FreeBSD.git] / test / SemaCXX / warn-weak-vtables.cpp
1 // RUN: %clang_cc1 %s -fsyntax-only -verify -Wweak-vtables
2
3 struct A { // expected-warning {{'A' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}}
4   virtual void f() { } 
5 };
6
7 template<typename T> struct B {
8   virtual void f() { } 
9 };
10
11 namespace {
12   struct C { 
13     virtual void f() { }
14   };
15 }
16
17 void f() {
18   struct A {
19     virtual void f() { }
20   };
21
22   A *a;
23   a->f();
24 }
25
26 // Use the vtables
27 void uses(A &a, B<int> &b, C &c) {
28   a.f();
29   b.f();
30   c.f();
31 }