[Bug c++/48740] Raw C++0x strings and trigraphs mix badly

kayhayen at gmx dot de gcc-bugzilla@gcc.gnu.org
Sat Apr 23 11:06:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48740

--- Comment #7 from Kay Hayen <kayhayen at gmx dot de> 2011-04-23 11:05:52 UTC ---
Created attachment 24079
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24079
Sorry for the typo, that's what you get for extracting test case. This one is
better.

With this one I can reproduce my original worry indeed:

[~]> g++ -c --std=c++0x testcase.cpp -Wall -Werror
testcase.cpp:2:17: error: unterminated raw string
testcase.cpp:2:15: error: expected primary-expression at end of input
testcase.cpp:2:15: error: expected ‘,’ or ‘;’ at end of input

Since the trigraph eats up the trigraph terminator, it's not terminated. Now
imagine a second constant in the same file and you do get a corrupted output.



More information about the Gcc-bugs mailing list