[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / warn-pure-virtual-kext.cpp
blobd23456fa4fd5cab28586fd887d248cecee3e828d
1 // RUN: %clang_cc1 %s -fapple-kext -fsyntax-only -verify
3 struct A {
4 virtual void f() = 0; // expected-note {{'f' declared here}}
5 A() {
6 A::f(); // expected-warning {{call to pure virtual member function 'f' has undefined behavior; overrides of 'f' in subclasses are not available in the constructor of 'A'}} // expected-note {{qualified call to 'A'::'f' is treated as a virtual call to 'f' due to -fapple-kext}}
8 };
10 template <typename T> struct TA {
11 virtual void f() = 0; // expected-note {{'f' declared here}}
13 TA() { TA::f(); } // expected-warning {{call to pure virtual member function 'f' has undefined behavior; overrides of 'f' in subclasses are not available in the constructor of 'TA<int>'}} // expected-note {{qualified call to 'TA<int>'::'f' is treated as a virtual call to 'f' due to -fapple-kext}}
16 struct B : TA<int> { // expected-note {{in instantiation of member function 'TA<int>::TA' requested here}}
17 void f() override;
20 B b;