[PATCH] Lex: Don't lex after getting EOF when handling _Pragma

Richard Smith richard at metafoo.co.uk
Thu Aug 14 14:50:39 PDT 2014


================
Comment at: lib/Lex/Pragma.cpp:196
@@ -195,3 +195,3 @@
     // Skip this token, and the ')', if present.
-    if (Tok.isNot(tok::r_paren))
+    if (Tok.isNot(tok::eof) && Tok.isNot(tok::r_paren))
       Lex(Tok);
----------------
I think you should also stop at EOD and EOM (that is, `tok::eod` and `tok::annot_module_*`).

http://reviews.llvm.org/D4914






More information about the cfe-commits mailing list