[PATCH] [ms-cxxabi] Mangle nullptr template arguments

David Majnemer david.majnemer at gmail.com
Mon Aug 5 00:06:26 PDT 2013


    - tidy the test
    - Incorporate review feedback.

Hi rnk, timurrrr,

http://llvm-reviews.chandlerc.com/D1284

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1284?vs=3187&id=3191#toc

Files:
  lib/AST/MicrosoftMangle.cpp
  test/CodeGenCXX/mangle-ms-templates.cpp

Index: lib/AST/MicrosoftMangle.cpp
===================================================================
--- lib/AST/MicrosoftMangle.cpp
+++ lib/AST/MicrosoftMangle.cpp
@@ -889,6 +889,9 @@
     mangleIntegerLiteral(TA.getAsIntegral(),
                          TA.getIntegralType()->isBooleanType());
     break;
+  case TemplateArgument::NullPtr:
+    Out << "$0A@";
+    break;
   case TemplateArgument::Expression:
     mangleExpression(TA.getAsExpr());
     break;
@@ -901,8 +904,7 @@
       mangleTemplateArg(TD, *I, ArgIndex);
     break;
   case TemplateArgument::Template:
-  case TemplateArgument::TemplateExpansion:
-  case TemplateArgument::NullPtr: {
+  case TemplateArgument::TemplateExpansion: {
     // Issue a diagnostic.
     DiagnosticsEngine &Diags = Context.getDiags();
     unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
Index: test/CodeGenCXX/mangle-ms-templates.cpp
===================================================================
--- test/CodeGenCXX/mangle-ms-templates.cpp
+++ test/CodeGenCXX/mangle-ms-templates.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
 
 template<typename T>
 class Class {
@@ -156,3 +156,8 @@
 }
 // CHECK: call {{.*}} @"\01??0?$VariadicClass at HD_N@@QAE at XZ"
 // CHECK: call {{.*}} @"\01??0?$VariadicClass at _NDH@@QAE at XZ"
+
+// PR16788
+template <decltype(nullptr)> struct S1 {};
+void f(S1<nullptr>) {}
+// CHECK: "\01?f@@YAXU?$S1@$0A@@@@Z"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1284.3.patch
Type: text/x-patch
Size: 1824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130805/9d2abb33/attachment.bin>


More information about the cfe-commits mailing list