Fix a potential assert in use-noexcept check if there is an issue getting the TypeSourceInfo as well as a small clean up.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Figured out the actual cause of this bug, getExceptionSpecRange() returns a null range if the function has an unknown return type
undefined_type throws() throw();
This is the tidy output (where assertions are disabled)
warning: dynamic exception specification '' is deprecated; consider using 'noexcept' instead [modernize-use-noexcept] /home/ce/example.cpp:1:1: error: unknown type name 'undefined_type' [clang-diagnostic-error] undefined_type throws() throw(); ^ 1 warning and 1 error generated. Error while processing /home/ce/example.cpp. Found compiler error(s).
Comment Actions
As this fix is preventing a crash in error causing code I can't include a specific test case as the clang-tidy tests will fail if there is any error emitted from clang.
Comment Actions
We support that case as well. See test/clang-tidy/checkers/misc-unused-using-decls-errors.cpp as an example.