41 lines · cpp
1// RUN: %clang_cc1 -std=c++98 -emit-pch -o %t %s2// RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -verify3// RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s4 5// RUN: %clang_cc1 -std=c++98 -emit-pch -fpch-instantiate-templates -o %t %s6// RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -verify7// RUN: %clang_cc1 -std=c++98 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s8 9#ifndef HEADER10#define HEADER11 12#define NULL 013template<typename T>14void *f() {15 void *p; // @1516 return p; // @1617}18#undef NULL19template<typename T>20void *g() {21 void *p; // @2122 return p; // @2223}24 25#else26 27// expected-warning@16 {{uninitialized}}28// expected-note@15 {{initialize}}29// CHECK: fix-it:"{{.*}}":{15:10-15:10}:" = NULL"30 31// expected-warning@22 {{uninitialized}}32// expected-note@21 {{initialize}}33// CHECK: fix-it:"{{.*}}":{21:10-21:10}:" = 0"34 35int main() {36 f<int>(); // expected-note {{instantiation}}37 g<int>(); // expected-note {{instantiation}}38}39 40#endif41