[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 16 07:35:06 PDT 2024


jcsxky wrote:

```cpp
ls
bstrwrap.cpp  bstrwrap.h  ctudir  test.cpp  test.plist  test.sh

cat bstrwrap.cpp
#include "bstrwrap.h"
#include <iostream>
Bstrlib::CBString::CBString () {
}

cat bstrwrap.h
#include <string>
namespace Bstrlib {
struct CBString {
 CBString ();
};
extern std::istream& getline (void);
}

cat test.cpp
#include "bstrwrap.h"
int test0 (void) {
 Bstrlib::CBString c0;
 return 0;
}

cat ctudir/externalDefMap.txt 
11:c:@f at test0# test.cpp.ast
35:c:@n at Bstrlib@S at CBString@F at CBString# bstrwrap.cpp.ast

~/llvm-project/build/bin/clang test.cpp -emit-ast -D__clang_analyzer__ -w -o ctudir/test.cpp.ast
~/llvm-project/build/bin/clang bstrwrap.cpp -emit-ast -D__clang_analyzer__ -w -o ctudir/bstrwrap.cpp.ast
~/llvm-project/build/bin/clang --analyze -Xclang -analyzer-config -Xclang experimental-enable-naive-ctu-analysis=true -Xclang -analyzer-config -Xclang ctu-dir=ctudir -Xclang -analyzer-config -Xclang display-ctu-progress=true test.cpp
```
I have tested locally using main branch with clang and it has no crash. Maybe I missed something? Could you please take a second look? @vabridgers 

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


More information about the cfe-commits mailing list