[clang] [C++20] [Modules] Profiling non dependent noexcept expression by pointer (PR #224528)
Younan Zhang via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 02:02:28 PDT 2026
================
@@ -0,0 +1,37 @@
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -o %t/a.pcm
+// RUN: %clang_cc1 -std=c++20 -fmodule-file=a=%t/a.pcm -fsyntax-only %t/use.cpp -verify
+//
+// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/a.cppm -o %t/a.pcm
+// RUN: %clang_cc1 -std=c++20 -fmodule-file=a=%t/a.pcm -fsyntax-only %t/use.cpp -verify
+
+//--- a.cppm
+export module a;
+template <class> concept C = true;
+
+template <class T> int fn() noexcept(C<T>);
+export using t = decltype(fn<int>());
+
+//--- use.cpp
+// expected-no-diagnostics
+import a;
+
+// During the deserialization process of fn<int>, the C<int> in noexcept expression
+// may be not completely deserialized. This test makes sure that we can handle the case.
+//
+// The ordering is:
+//
+// Deserialize C<int>
+//
+// Deserializing C<int>'s template argument
+//
+// Read SubstTemplateTypeParmType::AssociatedDecl in readSubstTemplateTypeParmType
----------------
zyn0217 wrote:
Okay so the SubstTTP comes from instantiation of noexcept specifier, where InstantiateExceptionSpec sets up the decl.
And in concept checking we wouldn't build a new MLTAL if there's no parameter mapping and thus their associated decls are preserved.
So... I think this is more of a concept bug than a serialization bug to me
https://github.com/llvm/llvm-project/pull/224528
More information about the cfe-commits
mailing list