Bug 443110 - getTranslationUnitDecl return nullptr on MacOS
Summary: getTranslationUnitDecl return nullptr on MacOS
Status: REPORTED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-29 08:42 UTC by hanyoung
Modified: 2021-09-29 08:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hanyoung 2021-09-29 08:42:56 UTC
SUMMARY

On MacOS big sur

STEPS TO REPRODUCE
1. use clazy to compile a sample c++ file has code that should trigger checks
2. 
3. 

OBSERVED RESULT
no diagnostic

EXPECTED RESULT
should print diagnostic

SOFTWARE/OS VERSIONS
macOS: big sur 11.5.2

https://invent.kde.org/sdk/clazy/-/blob/master/src/Clazy.cpp#L180 this returns nullptr on MacOS Big Sur 11.5.2
So the checks are not run. I believe it has something to do with Apple Clang. A example clang plugin build with llvm source works as expected (but not with Apple clang).

I tried another example clang plugin with clazy's cmake file, getTranslationUnitDecl also returns nullptr.
Comment 1 hanyoung 2021-09-29 08:50:20 UTC
The llvm used in linking is llvm12 from brew, clazy wraps itself around Apple clang. However manually load ClazyPlugin with llvm12's clang from brew works as expected.