================ @@ -0,0 +1,87 @@ +// RUN: %clang_cc1 -triple x86_64-windows-msvc %s -emit-llvm -fms-extensions -fms-compatibility -fms-reference-binding -Wno-microsoft-reference-binding -o - | FileCheck %s + +struct A {}; +struct B : A {}; + +void fAPickConstRef(A&) {} +void fAPickConstRef(const A&) {} + +void fBPickConstRef(A&) {} +void fBPickConstRef(const A&) {} + +void fAPickRef(A&) {} +void fAPickRef(const volatile A&) {} + +// NOTE: MSVC incorrectly picks the `const volatile A&` overload with the mangled name ---------------- MaxEW707 wrote:
https://godbolt.org/z/GvWY4n7rK https://developercommunity.visualstudio.com/t/_MSC_VER--1940-MSVC-allows-binding-a/10811594 As noted in the comment this appears to be a bug in MSVC here as it also occurs during conforming reference binding. For clang we will continue to pick the `A&` overload when ms non-conforming reference binding is in use. https://github.com/llvm/llvm-project/pull/99833 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits