[llvm-bugs] [Bug 52000] New: [MSFT C++ ABI] Incomplete/incorrect name mangling for function with auto return type

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 28 10:33:39 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52000

            Bug ID: 52000
           Summary: [MSFT C++ ABI] Incomplete/incorrect name mangling for
                    function with auto return type
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lennoxhoe at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

[MSFT ABI] clang-cl produces symbols with incorrect mangling when given a
function with automatic return type deduction.

Observe:

>type test.cpp
__declspec(dllexport) auto get_int() {
    return int(42);
}

>cl   | findstr Version
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

>clang-cl --version   | findstr version
clang version 12.0.1

---------------------------------------------------

>cl /nologo /LD test.cpp
test.cpp
   Creating library test.lib and object test.exp

>dumpbin /nologo /exports test.dll | findstr get_int
          1    0 00001000 ?get_int@@YAHXZ
---------------------------------------------------

>clang-cl /nologo /LD test.cpp
   Creating library test.lib and object test.exp

>dumpbin /nologo /exports test.dll | findstr get_int
          1    0 00001000 ?get_int@@YA?A?<auto>@@XZ

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210928/51284fbb/attachment.html>


More information about the llvm-bugs mailing list