[Bug driver/71930] g++ invokes the wrong preprocessor

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 19 12:58:00 GMT 2016


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |DUPLICATE

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Since g++ usually implies -x c++ it is reasonable to expect it to also do so
when reading from standard input. This error message isn't clear that you need
*both* -E and -x to get the desired behaviour:

$ g++ - <<< 'int main() { throw 1; }'
g++: error: -E or -x required when input is from standard input

Since the driver invoked was g++ it is fairly certain the user wanted -x c++ to
be implied. Obeying the error and adding -E *seems* to work, but loses the -x
c++ default.

But this is a dup of PR 67023 anyway.

*** This bug has been marked as a duplicate of bug 67023 ***


More information about the Gcc-bugs mailing list