brintos

brintos / llvm-project-archived public Read only

0
0
Text · 772 B · bf2e679 Raw
34 lines · cpp
1// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s2// PR56973namespace PR5697 {4struct A {5  virtual void f() { } 6  A();7  A(int);8};9 10// A does not have a key function, so the first constructor we emit should11// cause the vtable to be defined (without assertions.)12// CHECK: @_ZTVN6PR56971AE = linkonce_odr unnamed_addr constant13A::A() { }14A::A(int) { }15}16 17// Make sure that we don't assert when building the vtable for a class18// template specialization or explicit instantiation with a key19// function.20template<typename T>21struct Base {22  virtual ~Base();23};24 25template<typename T>26struct Derived : public Base<T> { };27 28template<>29struct Derived<char> : public Base<char> {30  virtual void anchor();31};32 33void Derived<char>::anchor() { }34