[all-commits] [llvm/llvm-project] 7b906d: [clang-cl][AST] Fix auto NTTP MSVC 1920+ mangling ...

Max Winkler via All-commits all-commits at lists.llvm.org
Thu Jun 20 19:49:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b906d46f6e6915f32718dd5b313ba47a7cec259
      https://github.com/llvm/llvm-project/commit/7b906d46f6e6915f32718dd5b313ba47a7cec259
  Author: Max Winkler <max.enrico.winkler at gmail.com>
  Date:   2024-06-20 (Thu, 20 Jun 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/test/CodeGenCXX/mangle-ms-auto-templates.cpp

  Log Message:
  -----------
  [clang-cl][AST] Fix auto NTTP MSVC 1920+ mangling for pointer types (#92477)

https://godbolt.org/z/G1K8Wszn9 for reference.

Starting with MSVC 1920+, VS2019, C++17 auto NTTP now adds `M <type>` to
the mangled name to avoid name collisions with different deduced types.
This PR fixes pointers. Pointers to members will be fixed in an upcoming
PR.

Here is a small example. The godbolt has more thorough examples.
```
template<auto>
struct AutoParmTemplate
{
    AutoParmTemplate() {}
};

int i;

int main()
{
    // MSVC 1916: ??0?$AutoParmTemplate@$1?i@@3HA@@QEAA at XZ
    // MSVC 1929: ??0?$AutoParmTemplate@$MPEAH1?i@@3HA@@QEAA at XZ
    // Clang: ??0?$AutoParmTemplate@$1?i@@3HA@@QEAA at XZ
    AutoParmTemplate<&i> x;
}
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list