xref: /llvm-project/clang/test/SemaCXX/warn-undefined-internal.cpp (revision d812488d3c54c07f24d4bef79e329f17e7f19c3b)
1 // RUN: %clang_cc1 -fsyntax-only -Wundefined-internal -verify %s
2 
test1()3 void test1() {
4   struct S { virtual void f(); };
5   // expected-warning@-1{{function 'test1()::S::f' has internal linkage but is not defined}}
6   S s;
7   // expected-note@-1{{used here}}
8 }
9 
test2()10 void test2() {
11   struct S;
12   struct S { virtual void f(); };
13   // expected-warning@-1{{function 'test2()::S::f' has internal linkage but is not defined}}
14   S s;
15   // expected-note@-1{{used here}}
16 }
17