Mercurial > hg > CbC > CbC_llvm
comparison clang/test/Preprocessor/_Pragma-in-macro-arg.cpp @ 150:1d019706d866
LLVM10
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 15:10:13 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
147:c2174574ed3a | 150:1d019706d866 |
---|---|
1 // RUN: %clang_cc1 %s -verify -Wconversion | |
2 | |
3 #define P(X) _Pragma(#X) | |
4 #define V(X) X | |
5 | |
6 #define X \ | |
7 P(clang diagnostic push) \ | |
8 P(clang diagnostic ignored "-Wconversion") \ | |
9 ) = 1.2; \ | |
10 P(clang diagnostic pop) | |
11 | |
12 void f() { | |
13 int a = 1.2; // expected-warning {{changes value}} | |
14 | |
15 // Note, we intentionally enter a tentatively-parsed context here to trigger | |
16 // regular use of lookahead. This would go wrong if _Pragma checking in macro | |
17 // argument pre-expansion also tries to use token lookahead. | |
18 int (b | |
19 V(X) | |
20 | |
21 int c = 1.2; // expected-warning {{changes value}} | |
22 } |