[clang] Improve the -Wundefined-func-template diagnostic note for invisible template functions (PR #129031)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 17 05:58:46 PDT 2025


================
@@ -0,0 +1,10 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -std=c++20 -fmodules -fmodules-cache-path=%t -I%S/Inputs/undefined-template \
+// RUN:   -Wundefined-func-template \
+// RUN:   -fimplicit-module-maps  %s 2>&1 | grep "unreachable declaration of template entity is her"
----------------
hokein wrote:

I tried this initially, but it didn't work. The reason is that the diagnostics are triggered when building the `hoge` module, which is imported from the main file. I suspect the module is built in a separate compiler invocation from the main file, and the `-verify` flag is not propagated to it.

I added a note in the lit test for clarification.

https://github.com/llvm/llvm-project/pull/129031


More information about the cfe-commits mailing list