From: David Majnemer Date: Wed, 4 Jun 2014 16:46:26 +0000 (+0000) Subject: MS-ABI: Implement user defined literals X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2146d56c26bc5d100700129a70232beb0266889;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210197 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index d064b15771..d444bf0996 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/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/test/CodeGenCXX/mangle-ms-cxx11.cpp b/test/CodeGenCXX/mangle-ms-cxx11.cpp index c174e48c1d..0cd23f5122 100644 --- a/test/CodeGenCXX/mangle-ms-cxx11.cpp +++ b/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"