brintos

brintos / llvm-project-archived public Read only

0
0
Text · 895 B · c66e734 Raw
18 lines · cpp
1// RUN: %clang -cc1 -fsyntax-only -verify %s 2>&12 3#define X(val2) Y(val2++) // expected-note {{macro 'X' defined here}}4#define Y(expression) expression ;5 6void foo() {7  // https://github.com/llvm/llvm-project/issues/60722:8  //9  // - Due to to the error recovery, the lexer inserts a pair of () around the10  //   macro argument int{,}, so we will see [(, int, {, ,, }, )] tokens.11  // - however, the size of file id for the macro argument only takes account12  //   the written tokens  int{,} , and the extra inserted ) token points to the13  //    Limit source location which triggered an empty Partition violation.14  X(int{,}); // expected-error {{too many arguments provided to function-like macro invocation}} \15                 expected-error {{expected expression}} \16                 expected-note {{parentheses are required around macro argument containing braced initializer list}}17}18