bolt/deps/llvm-18.1.8/clang/test/SemaCXX/warn-undefined-internal.cpp

17 lines
451 B
C++
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clang_cc1 -fsyntax-only -Wundefined-internal -verify %s
void test1() {
struct S { virtual void f(); };
// expected-warning@-1{{function 'test1()::S::f' has internal linkage but is not defined}}
S s;
// expected-note@-1{{used here}}
}
void test2() {
struct S;
struct S { virtual void f(); };
// expected-warning@-1{{function 'test2()::S::f' has internal linkage but is not defined}}
S s;
// expected-note@-1{{used here}}
}