[PATCH] Don't remove unknown tokens that are not whitespace (PR17215).

Daniel Jasper djasper at google.com
Tue Oct 8 08:07:46 PDT 2013


  This can also happen outside of macros (at least for invalid code).

  Consider you have two string literals in a function call:
  f("aaaa", bbbb, "\"ccccc\"");

  Now you forget one of the quotes of "aaaa" and end up with:
  f("aaaa, bbbb, "\"ccccc\"");

  Resulting in the tokens:
  f -- ( -- "aaaa, bbbb, " -- \"ccccc\"" -- ) -- ;

  Now the leading "\" gets interpreted as whitespace and is deleted. Maybe you can add a test for that and verify that this is also fixed.

http://llvm-reviews.chandlerc.com/D1858



More information about the cfe-commits mailing list