[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

Maksim Ivanov via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 18 14:41:24 PDT 2025


================
@@ -5164,6 +5164,29 @@ namespace A {
 A::X x;
 #endif
 
+namespace TemplateDecltypeOperator {
+
+#if defined(FIRST) || defined(SECOND)
+template <class T6>
+T6 func();
+#endif
+
+#if defined(SECOND)
+template <class UnrelatedT>
+using UnrelatedAlias = decltype(func<UnrelatedT>())();
+#endif
+
+#if defined(FIRST) || defined(SECOND)
+class A {
----------------
emaxx-google wrote:

Without the changes in this PR, this test would fail with this message:

> 'TemplateDecltypeOperator::A' with definition in module 'SecondModule' has different definitions in different modules; first difference is this function template
> but in 'FirstModule' found different function template

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


More information about the cfe-commits mailing list