diff --git a/src/libclang/preprocessor.cpp b/src/libclang/preprocessor.cpp index e5ffd29..1a0b766 100644 --- a/src/libclang/preprocessor.cpp +++ b/src/libclang/preprocessor.cpp @@ -475,7 +475,11 @@ namespace ts::optional parse_undef(position& p) { // format (at new line): #undef - 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; p.skip(std::strlen("#undef"));