Workaround clang bug with #undef output
This commit is contained in:
parent
5d95c1ed5d
commit
db20190fe4
1 changed files with 5 additions and 1 deletions
|
|
@ -475,7 +475,11 @@ namespace
|
||||||
ts::optional<std::string> parse_undef(position& p)
|
ts::optional<std::string> parse_undef(position& p)
|
||||||
{
|
{
|
||||||
// format (at new line): #undef <name>
|
// format (at new line): #undef <name>
|
||||||
if (!p.was_newl() || !starts_with(p, "#undef"))
|
// due to a clang bug (http://bugs.llvm.org/show_bug.cgi?id=32631) I'll also an undef in the middle of the line
|
||||||
|
// the only issue is with string literals containing `#undef`.
|
||||||
|
// those will be stripped and evaluated
|
||||||
|
// however, this kind of usage should be rare™
|
||||||
|
if (/*!p.was_newl() ||*/ !starts_with(p, "#undef"))
|
||||||
return ts::nullopt;
|
return ts::nullopt;
|
||||||
p.skip(std::strlen("#undef"));
|
p.skip(std::strlen("#undef"));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue