Clang gives local constants a different PDB symbol type than MSVC
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Not sure this is a bug per se but recording to follow up from https://github.com/swiftlang/llvm-project/pull/12414#discussion_r2873761876
With main.cpp:
```c++
int main() {
static const int kConstant = 42;
return kConstant;
}
```
`cl.exe /Zi /Fetest_cl.exe main.cpp /link /DEBUG`
`clang-cl.exe /Zi /Fetest_clang_cl.exe main.cpp /link /DEBUG`
```
> cvdump.exe -s test_cl.pdb | Select-String kConstant
(0000F8) S_CONSTANT: Type: 0x1002, Value: 42, `main'::`2'::kConstant
```
```
> cvdump.exe -s test_clang_cl.pdb | Select-String kConstant
(0000CC) S_LDATA32: [0002:00000F20], Type: 0x1002, kConstant
```
(note that the display name is also different)
Contributor guide
Assessment
This issue has not been assessed yet.