llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29k stars 11.95k forks source link

clang-tidy: bugprone-unchecked-optional-access regression (hang) from 15.0.7 to 16.0.6 #69298

Open Dushistov opened 1 year ago

Dushistov commented 1 year ago

test.zip

With attached file if you run (with clang/llvm 15.0.7):

for i in $(seq 1 10); do clang-tidy test.cpp -checks='-*,bugprone-unchecked-optional-access'  -- --std=c++17; done

all works fine.

But with clang/llvm 16.0.6

it hangs on time from 2 minutes to more then several hours.

And it happens randomly, some times run takes several seconds, some times minutes or hours. On my machine, running the clang-tidy (16.0.6) 10 times results in a 100% hang.

EugeneZelenko commented 1 year ago

Could you please try 17 or main branch? https://godbolt.org should be helpful.

Dushistov commented 1 year ago

I can not find clang-tidy in godbolt, but I was able to install 17.0.3 on Linux machine. Looks like 17.0.3 contains fix, at least no hangs, and clang-tidy works fast enought.

EugeneZelenko commented 1 year ago

@Dushistov: You need to add relevant tool in addition to compiler on GodBolt.

neoncube2 commented 1 year ago

Possible duplicate of https://github.com/llvm/llvm-project/issues/69369?