[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / macro-undef.cpp
blob4ec935d15edc1223842cbc74142c3e3f7806d4ca
1 // RUN: %clang_cc1 -std=c++98 -emit-pch -o %t %s
2 // RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -verify
3 // RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
5 // RUN: %clang_cc1 -std=c++98 -emit-pch -fpch-instantiate-templates -o %t %s
6 // RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -verify
7 // RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
9 #ifndef HEADER
10 #define HEADER
12 #define NULL 0
13 template<typename T>
14 void *f() {
15 void *p; // @15
16 return p; // @16
18 #undef NULL
19 template<typename T>
20 void *g() {
21 void *p; // @21
22 return p; // @22
25 #else
27 // expected-warning@16 {{uninitialized}}
28 // expected-note@15 {{initialize}}
29 // CHECK: fix-it:"{{.*}}":{15:10-15:10}:" = NULL"
31 // expected-warning@22 {{uninitialized}}
32 // expected-note@21 {{initialize}}
33 // CHECK: fix-it:"{{.*}}":{21:10-21:10}:" = 0"
35 int main() {
36 f<int>(); // expected-note {{instantiation}}
37 g<int>(); // expected-note {{instantiation}}
40 #endif