ilya-biryukov added a comment.

I've also stumbled upon this crash. Here is an even simpler repro that crashes 
for me (does not involve includes):

  #ifndef HEADER_GUARD
  
  #define FOO(X) int fhjdfhsdjkfhjkshfjk;
  FOO(base)
  
  struct X {
    int a;
  };
  
  int test() {
    X v;
    v.
  }
  #endif



================
Comment at: lib/Parse/Parser.cpp:519
   ConsumeToken();
-
-  PP.replayPreambleConditionalStack();
+  if (!PP.isCurrentLexer(nullptr))
+    PP.replayPreambleConditionalStack();
----------------
This certainly fixes the crash, but aren't we breaking other things if we don't 
run `replayConditionalStack`?
I.e. won't we get spurious errors on `#endif`?


https://reviews.llvm.org/D36458



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to