зеркало из https://github.com/microsoft/clang.git
Add name mangling for expr .* expr. Fixes PR9983 / <rdar://problem/9486332>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
bc3e64f37f
Коммит
63f62df485
|
@ -2039,6 +2039,7 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
|
|||
// ::= <function-param>
|
||||
// ::= sr <type> <unqualified-name> # dependent name
|
||||
// ::= sr <type> <unqualified-name> <template-args> # dependent template-id
|
||||
// ::= ds <expression> <expression> # expr.*expr
|
||||
// ::= sZ <template-param> # size of a parameter pack
|
||||
// ::= sZ <function-param> # size of a function parameter pack
|
||||
// ::= <expr-primary>
|
||||
|
@ -2317,8 +2318,11 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
|
|||
case Expr::CompoundAssignOperatorClass: // fallthrough
|
||||
case Expr::BinaryOperatorClass: {
|
||||
const BinaryOperator *BO = cast<BinaryOperator>(E);
|
||||
mangleOperatorName(BinaryOperator::getOverloadedOperator(BO->getOpcode()),
|
||||
/*Arity=*/2);
|
||||
if (BO->getOpcode() == BO_PtrMemD)
|
||||
Out << "ds";
|
||||
else
|
||||
mangleOperatorName(BinaryOperator::getOverloadedOperator(BO->getOpcode()),
|
||||
/*Arity=*/2);
|
||||
mangleExpression(BO->getLHS());
|
||||
mangleExpression(BO->getRHS());
|
||||
break;
|
||||
|
|
|
@ -109,3 +109,19 @@ namespace test2 {
|
|||
|
||||
// CHECK: store float {{.*}}, float* @_ZZN5test21gIPFfvEEEvT_DTclfL0p_EEE8variable,
|
||||
}
|
||||
|
||||
namespace test3 {
|
||||
template <class T, class U> void a(T x, U y, decltype(x.*y) z) {}
|
||||
|
||||
struct X {
|
||||
int *member;
|
||||
};
|
||||
|
||||
// CHECK: define void @_ZN5test311instantiateEv
|
||||
void instantiate() {
|
||||
X x;
|
||||
int *ip;
|
||||
// CHECK: call void @_ZN5test31aINS_1XEMS1_PiEEvT_T0_DTdsfL0p_fL0p0_E
|
||||
a(x, &X::member, ip);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче