summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/mangle-ref-qualifiers.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-05-15 02:01:59 +0000
committerJohn McCall <rjmccall@apple.com>2012-05-15 02:01:59 +0000
commit4b50263096457552ee86eb790c9638c6bb7357fa (patch)
tree06cb1d45e301c42ca887aaabd865a90f4d793f9f /test/CodeGenCXX/mangle-ref-qualifiers.cpp
parent20119a87fbb7719c161d81fc5f721f1ee6ed7e66 (diff)
Change the mangling of a ref-qualifier on a function type so that
it is placed in a position which is never ambiguous with a reference-to-function type. This follows some recent discussion and ensuing proposal on cxx-abi-dev. It is not necessary to change the mangling of CV-qualifiers because you cannot apply CV-qualification in the normal sense to a function type. It is not necessary to change the mangling of ref-qualifiers on method declarations because they appear in an unambiguous location. In addition, mangle CV-qualifiers and ref-qualifiers on function types when they occur in positions other than member pointers (that is, when they appear as template arguments). This is a minor ABI break with previous releases of clang. It is not considered critical because (1) ref-qualifiers are relatively rare, since AFAIK we're the only implementing compiler, and (2) they're particularly likely to come up in contexts that do not rely on the ODR for correctness. We apologize for any inconvenience; this is the right thing to do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-ref-qualifiers.cpp')
-rw-r--r--test/CodeGenCXX/mangle-ref-qualifiers.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/CodeGenCXX/mangle-ref-qualifiers.cpp b/test/CodeGenCXX/mangle-ref-qualifiers.cpp
index 568cf9f247..ce2af502e4 100644
--- a/test/CodeGenCXX/mangle-ref-qualifiers.cpp
+++ b/test/CodeGenCXX/mangle-ref-qualifiers.cpp
@@ -12,5 +12,11 @@ int X::g() && { return 0; }
// CHECK: define i32 @_ZNKO1X1hEv
int X::h() const && { return 0; }
-// CHECK: define void @_Z1fM1XRFivEMS_OFivEMS_KOFivE
+// CHECK: define void @_Z1fM1XFivREMS_FivOEMS_KFivOE
void f(int (X::*)() &, int (X::*)() &&, int (X::*)() const&&) { }
+
+// CHECK: define void @_Z1g1AIFivEES_IFivREES_IFivOEES_IKFivEES_IKFivREES_IKFivOEES_IVKFivEES_IVKFivREES_IVKFivOEE()
+template <class T> struct A {};
+void g(A<int()>, A<int()&>, A<int()&&>,
+ A<int() const>, A<int() const &>, A<int() const &&>,
+ A<int() const volatile>, A<int() const volatile &>, A<int() const volatile &&>) {}