brintos

brintos / llvm-project-archived public Read only

0
0
Text · 500 B · 1b8fe09 Raw
23 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4// This would previously trigger a failed assertion when instantiating the5// template which uses an overloaded call operator because the end location6// for the expression came from a macro expansion.7 8#define ASSIGN_OR_RETURN(...)  (__VA_ARGS__)9 10struct Loc {11  int operator()(const char* _Nonnull f = __builtin_FILE()) const;12};13 14template <typename Ty>15void f() {16  ASSIGN_OR_RETURN(Loc()());17}18 19void test() {20  f<int>();21}22 23