[clang-tools-extra] [clang-tidy] Compact the confusable identifier table (PR #202626)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 07:07:56 PDT 2026


erichkeane wrote:

So I had this break my incremental build with errors that looked like: 

```
/local/home/ekeane/llvm-project/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp:30:22: error: use of undeclared identifier 'ConfusableReplacementData'
   30 | static_assert(sizeof(ConfusableReplacementData) <= 1ULL << 16);
      |                      ^
/local/home/ekeane/llvm-project/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp:78:69: error: no member named 'CodePoint' in '(anonymous namespace)::(unnamed struct at /local/home/ekeane/llvm-project/build/tools/clang/tools/extra/clang-tidy/misc/Confusables.inc:1:1)'; did you mean 'codepoint'?
   78 |     if (Where == std::end(ConfusableEntries) || CodePoint != Where->CodePoint) {
      |                                                                     ^~~~~~~~~
      |                                                                     codepoint
/local/home/ekeane/llvm-project/build/tools/clang/tools/extra/clang-tidy/misc/Confusables.inc:1:21: note: 'codepoint' declared here
    1 | struct {llvm::UTF32 codepoint; llvm::UTF32 values[19];} ConfusableEntries[] = {
      |                     ^
/local/home/ekeane/llvm-project/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp:82:56: error: no member named 'Offset' in '(anonymous namespace)::(unnamed struct at /local/home/ekeane/llvm-project/build/tools/clang/tools/extra/clang-tidy/misc/Confusables.inc:1:1)'
   82 |           StringRef(ConfusableReplacementData + Where->Offset, Where->Length));
      |                                                 ~~~~~  ^
/local/home/ekeane/llvm-project/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp:82:71: error: no member named 'Length' in '(anonymous namespace)::(unnamed struct at /local/home/ekeane/llvm-project/build/tools/clang/tools/extra/clang-tidy/misc/Confusables.inc:1:1)'
   82 |           StringRef(ConfusableReplacementData + Where->Offset, Where->Length));
      |                                                                ~~~~~  ^
/local/home/ekeane/llvm-project/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp:82:21: error: use of undeclared identifier 'ConfusableReplacementData'
   82 |           StringRef(ConfusableReplacementData + Where->Offset, Where->Length));
      |                     ^

```

It appears that the changes to `BuildConfusableTable.cpp` aren't invalidating the `Confusables.inc` file in our build process.  

For the NEXT person who runs into this, you may need to invalidate that file to cause it to be regenerated by either deleting the `Confusables.inc` or modifying `/ConfusableTable/confusables.txt`.

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


More information about the cfe-commits mailing list