-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closed
Labels
llvm:supportquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
I noticed this in #160274, where I had an assert like
assert(isa<InsertElementInst>(VecI) ||
isa<InsertValueInst>(VecI) &&
"Packed operands must generate an insertelement or insertvalue");
But there's a handy version of llvm::isa that uses parameter packs so you can pass multiple types to check against, however this seems to fail when used inside of the assert:
assert(isa<InsertElementInst, InsertValueInst>(VecI) &&
"Packed operands must generate an insertelement or insertvalue");
llvm-project/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp:3271:35: error: too many arguments provided to function-like macro invocation
3271 | assert(isa<InsertElementInst, InsertValueInst>(VecI) &&
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:71:9: note: macro 'assert' defined here
71 | #define assert(e) \
| ^
llvm-project/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp:3271:5: error: use of undeclared identifier 'assert'
3271 | assert(isa<InsertElementInst, InsertValueInst>(VecI) &&
| ^
2 errors generated.
The parameter pack overload works fine outside of the assert. I'm not sure if this specific to the MacOSX toolchain or not. Running into this on clang version 21.1.2, arm64-apple-darwin24.6.0
Metadata
Metadata
Assignees
Labels
llvm:supportquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!