llvm / llvm/llvm-project

[ABI] Leading :: changes mangling

Open
#169,868 11 comments 0 reactions 0 assignees View on GitHub
ABI clang:frontend diverges-from:gcc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```C++
template ,bool> = true>
void foo() {}

int a = foo();
```

and

```C++
template ,bool> = true>
void foo() {}

int a = foo();
```
https://godbolt.org/z/9cY5TdesM

will produce different mangling.

They first will produce _Z3fooIKiTnNSt9enable_ifIXsr3stdE10is_const_vIT_EEbE4typeELb1EEvv and the second will produce _Z3fooIKiTnNSt9enable_ifIXgssr3stdE10is_const_vIT_EEbE4typeELb1EEvv

This also introduces an ABI breaking with GCC as GCC produces _Z3fooIKiLb1EEvv

Contributor guide

Open the contributing guide

Research direction

Reproduce both examples using the linked Compiler Explorer case and compare the emitted manglings with GCC's output. Investigate the ABI mangling rules for a leading `::` in the constraint expression; done means the compiler's behavior is consistently defined and no longer breaks ABI compatibility with GCC.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.