[clang] Update std symbols mapping (fixes #113494) (PR #113612)

Vadim D. via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 24 12:50:57 PDT 2024


================
@@ -115,15 +115,17 @@ static int initialize(Lang Language) {
       NSLen = 0;
     }
 
-    if (SymIndex >= 0 &&
-        Mapping->SymbolNames[SymIndex].qualifiedName() == QName) {
-      // Not a new symbol, use the same index.
+    if (SymIndex > 0) {
       assert(llvm::none_of(llvm::ArrayRef(Mapping->SymbolNames, SymIndex),
----------------
vvd170501 wrote:

This assertion could fail only if entries for a symbol were partially grouped, but it didn't fail if entries weren't grouped at all.
Example:
```cpp
// StdSpecialSymbolMap.inc
SYMBOL(any_cast, std::, <any>)
SYMBOL(div, std::, <cstdlib>)
// StdSymbolMap.inc
SYMBOL(any, std::, <any>)
SYMBOL(any_cast, std::, <any>)  // assertion doesn't fail because previous entry has a different name
...

```

https://github.com/llvm/llvm-project/pull/113612


More information about the cfe-commits mailing list