From: Richard Smith Date: Tue, 1 May 2018 18:50:15 +0000 (+0000) Subject: Fix bogus MSVC char8_t mangling. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a6f67eb1a9d6944b2c076898b2d73406818254b;p=clang Fix bogus MSVC char8_t mangling. This appears to have been caused by a bad automatic svn merge with r330225 attaching the 'case' label to the wrong block of code. :( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331299 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index f39c1a8e38..7b60c14e41 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -1918,7 +1918,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, Out << "$$T"; break; - case BuiltinType::Char8: case BuiltinType::Float16: mangleArtificalTagType(TTK_Struct, "_Float16", {"__clang"}); break; @@ -1927,6 +1926,7 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers, mangleArtificalTagType(TTK_Struct, "_Half", {"__clang"}); break; + case BuiltinType::Char8: case BuiltinType::Float128: { DiagnosticsEngine &Diags = Context.getDiags(); unsigned DiagID = Diags.getCustomDiagID( diff --git a/test/CodeGenCXX/char8_t.cpp b/test/CodeGenCXX/char8_t.cpp index 5aa0383060..f24f12d6df 100644 --- a/test/CodeGenCXX/char8_t.cpp +++ b/test/CodeGenCXX/char8_t.cpp @@ -1,7 +1,8 @@ // RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-linux %s -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++17 -emit-llvm -fchar8_t -triple x86_64-windows %s -o - -verify // CHECK: define void @_Z1fDu( -void f(char8_t c) {} +void f(char8_t c) {} // expected-error {{cannot mangle this built-in char8_t type yet}} // CHECK: define weak_odr void @_Z1gIiEvDTplplcvT__ELA4_KDuELDu114EE template void g(decltype(T() + u8"foo" + u8'r')) {}