From 9653ab52b90e5f4ebf1f5ae842e8e5cbbcf5c1be Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 25 Sep 2012 09:10:17 +0000 Subject: [PATCH] Implement Mike Herrick's proposed noexcept mangling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164593 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ItaniumMangle.cpp | 6 +++++- test/CodeGenCXX/mangle-exprs.cpp | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index afd425b5ea..3a168017d7 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -2412,7 +2412,6 @@ recurse: case Expr::ExpressionTraitExprClass: case Expr::VAArgExprClass: case Expr::CXXUuidofExprClass: - case Expr::CXXNoexceptExprClass: case Expr::CUDAKernelCallExprClass: case Expr::AsTypeExprClass: case Expr::PseudoObjectExprClass: @@ -2604,6 +2603,11 @@ recurse: Out <<"_E"; break; + case Expr::CXXNoexceptExprClass: + Out << "nx"; + mangleExpression(cast(E)->getOperand()); + break; + case Expr::UnaryExprOrTypeTraitExprClass: { const UnaryExprOrTypeTraitExpr *SAE = cast(E); diff --git a/test/CodeGenCXX/mangle-exprs.cpp b/test/CodeGenCXX/mangle-exprs.cpp index 30da4fbbcd..2d7a883526 100644 --- a/test/CodeGenCXX/mangle-exprs.cpp +++ b/test/CodeGenCXX/mangle-exprs.cpp @@ -190,4 +190,11 @@ namespace test4 { // CHECK: void @_ZN5test43tf3INS_1XEEEvDTnw_T_ilLi1EEE template void tf3(X*); + +} + +namespace test5 { + template void a(decltype(noexcept(T()))) {} + template void a(decltype(noexcept(int()))); + // CHECK: void @_ZN5test51aIiEEvDTnxcvT__EE( } -- 2.40.0