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

Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arthur.j.odwyer at gmail dot 
com

--- Comment #2 from Arthur O'Dwyer <arthur.j.odwyer at gmail dot com> ---
Here is another example:
https://wandbox.org/permlink/UYsLyMaLcBb6sjJa

GCC incorrectly considers `int()` to be a null pointer constant.
Notice that GCC correctly handles `int{}` with curly braces; it gets confused
only about `int()` with parens.

#include <stdio.h>

void foo(const char *) {}

template<class T> decltype(foo(T())) red(T) { puts("yes"); }
void red(...) { puts("no"); }

int main() {
    foo(int());  // should not compile
    red(1);  // should print "no", not "yes"
}

Reply via email to