diff options
author | Aaron Puchert <aaron.puchert@sap.com> | 2025-09-25 20:12:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-25 20:12:47 +0200 |
commit | 57330c8514c78e7032975961badf5fa59091f059 (patch) | |
tree | 6347ea1411592b131fff0ced9cba706eb56e497f /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 321a7c3caf7c5c6a208501e1406fcab14f8b54f9 (diff) | |
download | llvm-57330c8514c78e7032975961badf5fa59091f059.zip llvm-57330c8514c78e7032975961badf5fa59091f059.tar.gz llvm-57330c8514c78e7032975961badf5fa59091f059.tar.bz2 |
Don't look into base class aliases in bugprone-throw-keyword-missing (#160725)
The check confusingly fires on non-exception classes if any base class
has an alias in an exception class. In our case, the exception had an
alias for an allocator interface, so every allocator inheriting from
that interface was treated as an exception type. (But only when the
header for the exception was included.)
The reason behind this is the odd (but documented) behavior of
isDerivedFrom and similar matchers: it does not only iterate through the
bases as written, but through all relevant nodes to check them for being
a base. This makes the matcher also finds aliases of the base classes.
Only going through the bases as written can be done with `hasAnyBase`.
However, that doesn't cover the class itself, and we have to check it
separately. Since we're no longer looking through aliases via the
matcher, and because we're apparently interested in the canonical type,
we check that (see the test with "typedef std::exception ERROR_BASE;").
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions