[clang] WIP: Improve the -Wundefined-func-template diagnostic note for invisible template functions (PR #129031)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 28 04:55:00 PST 2025
================
@@ -5082,11 +5085,16 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
if (AtEndOfTU && !getDiagnostics().hasErrorOccurred() &&
!getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc())) {
Diag(PointOfInstantiation, diag::warn_func_template_missing)
- << Function;
- Diag(PatternDecl->getLocation(), diag::note_forward_template_decl);
- if (getLangOpts().CPlusPlus11)
- Diag(PointOfInstantiation, diag::note_inst_declaration_hint)
- << Function;
+ << Function;
+ if (Unreachable) {
----------------
ilya-biryukov wrote:
It would probably also be useful to say which module it's coming from (similar to what we have if you try to use a declaration from a module that's available, but not imported; or when we have problems with ODR checks and we point to modules that the declarations are coming from)
But it's also an improvement as is, I'm not sure how hard it would be to add that.
https://github.com/llvm/llvm-project/pull/129031
More information about the cfe-commits
mailing list