https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102846

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
t1.cc: In function ‘void bar(void*)’:
t1.cc:15:21: error: ‘assert’ was not declared in this scope
   15 |     auto v = verify(assert, ptr);
      |                     ^~~~~~
t1.cc:15:21: note: ‘assert’ is a function-like macro and might be used
incorrectly


Is what I get after my patch for the testcase in comment #0.

For PR 118625, I get from the C++ front-end:
```
t1.c:6:2: error: unterminated argument list invoking macro ‘assert’
    6 | }
      |  ^
t1.c: In function ‘int main()’:
t1.c:5:9: error: ‘assert’ was not declared in this scope
    5 |         assert(1;
      |         ^~~~~~
t1.c:5:9: note: ‘assert’ is a function-like macro and might be used incorrectly
t1.c:5:15: error: expected ‘}’ at end of input
    5 |         assert(1;
      |               ^
t1.c:4:1: note: to match this ‘{’
    4 | {
      | ^
```

Or from the C front-end:
```
t1.c: In function ‘main’:
t1.c:6:2: error: unterminated argument list invoking macro ‘assert’
    6 | }
      |  ^
t1.c:5:9: error: ‘assert’ undeclared (first use in this function)
    5 |         assert(1;
      |         ^~~~~~
t1.c:5:9: note: ‘assert’ is a function-like macro and might be used incorrectly
t1.c:5:9: note: each undeclared identifier is reported only once for each
function it appears in
t1.c:5:15: error: expected ‘;’ at end of input
    5 |         assert(1;
      |               ^
      |               ;
    6 | }
t1.c:5:9: error: expected declaration or statement at end of input
    5 |         assert(1;
      |         ^~~~~~
```

All much better.

Reply via email to