phunix/external/bsd/llvm/dist/clang/test/PCH/macro-undef.cpp
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

37 lines
814 B
C++

// RUN: %clang_cc1 -emit-pch -o %t %s
// RUN: %clang_cc1 -fsyntax-only -include-pch %t %s -Wuninitialized -verify
// RUN: %clang_cc1 -fsyntax-only -include-pch %t %s -Wuninitialized -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
#ifndef HEADER
#define HEADER
#define NULL 0
template<typename T>
void *f() {
void *p; // @11
return p; // @12
}
#undef NULL
template<typename T>
void *g() {
void *p; // @17
return p; // @18
}
#else
// expected-warning@12 {{uninitialized}}
// expected-note@11 {{initialize}}
// CHECK: fix-it:"{{.*}}":{11:10-11:10}:" = NULL"
// expected-warning@18 {{uninitialized}}
// expected-note@17 {{initialize}}
// CHECK: fix-it:"{{.*}}":{17:10-17:10}:" = 0"
int main() {
f<int>(); // expected-note {{instantiation}}
g<int>(); // expected-note {{instantiation}}
}
#endif