This is an archive of the discontinued LLVM Phabricator instance.

[clang][sema] Add missing diagnostic parameter
ClosedPublic

Authored by tbaeder on Jan 4 2022, 4:51 AM.

Details

Summary

The test case otherwise fails an assertion in Diagnostic::getArgKind():

clang++: /home/tbaeder/code/llvm-project/clang/include/clang/Basic/Diagnostic.h:1571: clang::DiagnosticsEngine::ArgumentKind clang::Diagnostic::getArgKind(unsigned int) const: Assertion `Idx < getNumArgs() && "Argument index out of range!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: bin/clang++ module_import.cpp -std=c++20 -fmodules -fimplicit-module-maps -I. -stdlib=libc++ -fsyntax-only
1.	module_import.cpp:1:20: current parser token ';'

...

Diff Detail

Unit TestsFailed

Event Timeline

tbaeder requested review of this revision.Jan 4 2022, 4:51 AM
tbaeder created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2022, 4:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman added inline comments.Jan 10 2022, 5:40 AM
clang/test/Modules/cxx20-export-import.cpp
1–2

Also, does this test require -fmodules-cache-path=%t or -fimplicit-module-maps?

tbaeder updated this revision to Diff 399925.Jan 14 2022, 1:07 AM
tbaeder added inline comments.
clang/test/Modules/cxx20-export-import.cpp
1–2

They are all needed (including the -I). I could only remove the -stdlib=libc++, removing any of the others makes the test fail :(

aaron.ballman accepted this revision.Jan 14 2022, 10:40 AM

I think the test behavior is pretty mysterious and there's likely some other bug happening, but this is incremental progress and definitely fixes an issue, so LGTM!

clang/test/Modules/cxx20-export-import.cpp
1–2

Oh wow, that's... pretty surprising behavior.

This revision is now accepted and ready to land.Jan 14 2022, 10:40 AM
This revision was automatically updated to reflect the committed changes.