Skip to content

Conversation

j-hui
Copy link
Contributor

@j-hui j-hui commented Oct 7, 2025

We were previously not handling cases where the instantiation of the
declaration of a function template is valid, but the instantiation
of its definition is invalid (e.g., because it contains an invalid
static_cast() or static_assert()). This patch teaches ClangImporter to
correctly diagnose these as compiler errors, rather than simply
crashing.

rdar://137456897

Builds on #84723

We already have -suppress-warnings and -suppress-remarks; this patch
adds support for suppressing notes too. Doing so is useful for -verify
tests where we don't really care about the emitted notes.
@j-hui
Copy link
Contributor Author

j-hui commented Oct 7, 2025

@swift-ci please test

…tion

We were previously not handling cases where the instantiation of the
**declaration** of a function template is valid, but the instantiation
of its **definition** is invalid (e.g., because it contains an invalid
static_cast() or static_assert()). This patch teaches ClangImporter to
correctly diagnose these as compiler errors, rather than simply
crashing.

rdar://137456897
@j-hui j-hui force-pushed the invalid-func-tmpl-inst branch from ea8ee1b to 36ba535 Compare October 7, 2025 06:50
We were not handling nullptrs consistently. This shouldn't actually
change the behavior for any known case but makes the error handling
logic a little more explicit and robust.
@j-hui
Copy link
Contributor Author

j-hui commented Oct 7, 2025

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants