Issue 925 in include-what-you-use: Missing clang enum value when building against LLVM 12

12 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
May 26, 2021, 3:08:59 AMMay 26
to include-wh...@googlegroups.com
New issue 925 by sfc-gh-sgiesecke: Missing clang enum value when building against LLVM 12
https://github.com/include-what-you-use/include-what-you-use/issues/925

Compiling the latest master (da46ba21af45fab99aeaf4e45dd807cb2e19a3e6) against LLVM 12, I get the following syntax error:
```
../iwyu.cc:2002:19: error: no member named 'CK_MatrixCast' in namespace 'clang'; did you mean 'CK_BitCast'?
case clang::CK_MatrixCast:
~~~~~~~^~~~~~~~~~~~~
CK_BitCast
.../include/clang/AST/OperationKinds.def:61:1: note: 'CK_BitCast' declared here
CAST_OPERATION(BitCast)
^
.../include/clang/AST/OperationKinds.h:21:30: note: expanded from macro 'CAST_OPERATION'
#define CAST_OPERATION(Name) CK_##Name,
^
<scratch space>:179:1: note: expanded from here
CK_BitCast
^
```
Can this just be `#ifdef`ed out for LLVM 12?

notifi...@include-what-you-use.org

unread,
May 26, 2021, 5:32:15 AMMay 26
to include-wh...@googlegroups.com
Comment #0 on issue 925 by kimgr: Missing clang enum value when building against LLVM 12
https://github.com/include-what-you-use/include-what-you-use/issues/925

IWYU 0.16 for Clang 12 was just released yesterday. You need to use the `clang_12` branch when building against LLVM/Clang 12.

notifi...@include-what-you-use.org

unread,
May 26, 2021, 5:42:59 AMMay 26
to include-wh...@googlegroups.com
Comment #2 on issue 925 by sfc-gh-sgiesecke: Missing clang enum value when building against LLVM 12
https://github.com/include-what-you-use/include-what-you-use/issues/925

Ah... sorry I missed that.

Hm, I wonder if it makes sense to check that the LLVM version matches somewhere in the CMakeLists.txt?

When I use the master branch and run cmake against LLVM 12, it says:
```
-- IWYU: configuring for LLVM 12.0.0...
```
which seems to imply that this should work.

notifi...@include-what-you-use.org

unread,
May 28, 2021, 3:15:09 PMMay 28
to include-wh...@googlegroups.com
Comment #2 on issue 925 by kimgr: Missing clang enum value when building against LLVM 12
https://github.com/include-what-you-use/include-what-you-use/issues/925

Heh, that note was actually intended to give users a hint that it's NOT going to work. I need to work on my UX.

In the meantime, I've updated the compatibility matrix in the README to cover Clang 12: https://github.com/include-what-you-use/include-what-you-use#how-to-build.

Closing this.

Reply all
Reply to author
Forward
0 new messages