From e31a3ed3d44f9a8b49c75ef1cba495dad7be8744 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 4 Jun 2014 16:46:26 +0000 Subject: [PATCH] MS-ABI: Implement user defined literals Straightforward implementation of UDLs, it's compatible with VS "14". This nearly completes our implementation of C++ name mangling for the MS-ABI. llvm-svn: 210197 --- clang/lib/AST/MicrosoftMangle.cpp | 7 ++----- clang/test/CodeGenCXX/mangle-ms-cxx11.cpp | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index d064b15..d444bf0 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -803,11 +803,8 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, break; case DeclarationName::CXXLiteralOperatorName: { - // FIXME: Was this added in VS2010? Does MS even know how to mangle this? - DiagnosticsEngine &Diags = Context.getDiags(); - unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error, - "cannot mangle this literal operator yet"); - Diags.Report(ND->getLocation(), DiagID); + Out << "?__K"; + mangleSourceName(Name.getCXXLiteralIdentifier()->getName()); break; } diff --git a/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp b/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp index c174e48..0cd23f51 100644 --- a/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp +++ b/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp @@ -130,3 +130,6 @@ void A::foo() __restrict & {} void A::foo() __restrict && {} // CHECK-DAG: @"\01?foo@A@PR19361@@QIHAEXXZ" } + +int operator"" _deg(long double) { return 0; } +// CHECK-DAG: @"\01??__K_deg@@YAHO@Z" -- 2.7.4