In expected diagnostic checks containing newlines, anything after the last
newline would be discarded since we stop parsing directly after the last newline.
Fix this behavior so that any remaining string after the last newline is
appended instead of ignored.
Details
- Reviewers
rsmith jansvoboda11 jkorous
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thank you for the patch!
clang/test/SemaCXX/references.cpp | ||
---|---|---|
93 | Can you please explain in detail what bug are you fixing? |
clang/test/SemaCXX/references.cpp | ||
---|---|---|
93 |
The reason it does not fail is because we do not perform an exact match. We only do a partial match since contains() is used here when matching https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp#L102. We parsed the following from the expected-warning check: direct base 'A' is inaccessible due to ambiguity: struct C -> B -> A and the actual output from clang is: direct base 'A' is inaccessible due to ambiguity: struct C -> B -> A struct C -> A The output from clang does contain the expected warning that we parsed but not all of it since we discarded the last line of \nstruct C -> struct A from the check. You can verify that by adding anything on this line. It will not fail the test because we are not checking for it. |
Can you please explain in detail what bug are you fixing?
In my understanding if we stop parsing after the last newline then the existing test would have failed. The difference seems to be only the white-space.
Am I missing something?