ilya-biryukov added a comment.
Here's an alternative fix that moves the `replay...` call into `Preprocessor`:
https://reviews.llvm.org/D36872.
It also fixes the crash and doesn't add invalid compiler errors about
non-matching `#ifdefs`.
https://reviews.llvm.org/D36458
__
ilya-biryukov added inline comments.
Comment at: lib/Parse/Parser.cpp:519
ConsumeToken();
-
- PP.replayPreambleConditionalStack();
+ if (!PP.isCurrentLexer(nullptr))
+PP.replayPreambleConditionalStack();
ilya-biryukov wrote:
> This certainly fixes the cr
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.
}
yvvan updated this revision to Diff 110978.
yvvan added a comment.
I have minimized the crash case and added simple test for it.
https://reviews.llvm.org/D36458
Files:
lib/Parse/Parser.cpp
test/Index/std-begin-error.cpp
Index: test/Index/std-begin-error.cpp
===
yvvan added a comment.
But I don't know the source of that issue, I only know how to fix it because I
caught that one in debugger and added a check to prevent it.
How can I write testcase for such fix?
https://reviews.llvm.org/D36458
___
cfe-commit
bkramer added a comment.
Changes like this should come with a small, c-index-test based, test case so we
don't reintroduce the same bug in the future.
https://reviews.llvm.org/D36458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://li
yvvan added a comment.
And if you just meant how to reproduce:
You need to parse and reparse standard header (my current one is
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory). I can
provide the options and a command line that I have if you can't reproduce it
with defau
yvvan added a comment.
Do you mean the testcase that runs only for windows with ms-extensions flag and
msvc includes?
I don't know if clang has that kind of tests. Does it?
https://reviews.llvm.org/D36458
___
cfe-commits mailing list
cfe-commits@li
bkramer added a comment.
Test case?
https://reviews.llvm.org/D36458
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits