
Summary: In order for libc++ to meaningfully use `diagnose_if` warnings they need to be emitted from system headers by default. This patch changes the `diagnose_if` warning diagnostic to be shown in system headers. Reviewers: george.burgess.iv, rsmith, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28703 llvm-svn: 291963
12 lines
307 B
C
12 lines
307 B
C
#pragma GCC system_header
|
|
|
|
inline int system_header_func(int x)
|
|
__attribute__((diagnose_if(x == x, "system header warning", "warning"))) // expected-note {{from 'diagnose_if' attribute}}
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
void test_system_header() {
|
|
system_header_func(0); // expected-warning {{system header warning}}
|
|
}
|