brintos

brintos / llvm-project-archived public Read only

0
0
Text · 572 B · 0d2dcd0 Raw
23 lines · cpp
1// RUN: %clang_cc1 %s -verify -Wconversion2 3#define P(X) _Pragma(#X)4#define V(X) X5 6#define X \7  P(clang diagnostic push) \8  P(clang diagnostic ignored "-Wconversion") \9  ) = 1.2; \10  P(clang diagnostic pop)11 12void f() {13  int a = 1.2; // expected-warning {{changes value}}14 15  // Note, we intentionally enter a tentatively-parsed context here to trigger16  // regular use of lookahead. This would go wrong if _Pragma checking in macro17  // argument pre-expansion also tries to use token lookahead.18  int (b19  V(X)20 21  int c = 1.2; // expected-warning {{changes value}}22}23