[clang] [Clang][AST] Fix MS Mangle concept uneval context template instantiation crash (PR #117845)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 04:42:33 PST 2024


================
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -std=c++20 -fms-compatibility -fms-compatibility-version=19.33 -emit-llvm %s -o - -triple=x86_64-windows-msvc | FileCheck %s
+
+template <typename T>
+concept C = requires
+{
+    { T::test([](){}) };
+};
+
+template<typename T>
+struct Widget {};
+
+template <C T>
+struct Widget<T> {};
+
+struct Baz
+{
+    template<typename F>
+    static constexpr decltype(auto) test(F&&) {}
+};
+
+void test()
+{
+    Widget<Baz> w;
+}
+// CHECK: @"?test@@YAXXZ"
----------------
zmodem wrote:

I suppose the mangling you're adding doesn't actually show up anywhere since it's only used for a concept? But then why do we need to mangle it in the first place?

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


More information about the cfe-commits mailing list