[clang] [clang] Remove an incorrect assertion in ConstantFoldAttrs (PR #105789)

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 11:38:23 PDT 2024


Sirraide wrote:

> Hm, what comment are you referring to exactly?

Ah, this one:
https://github.com/llvm/llvm-project/blob/d88876e74f7882643546becc544a771a5e5e9787/clang/include/clang/Sema/Sema.h#L1838-L1842

The main thing I’m (if only a bit) worried about is that some code somewhere might be expecting a `ConstantExpr` to always be there if the thing isn’t dependent, so an ‘empty’ `ConstantExpr` might be necessary if that’s the case, but then again, if everything works then it’s probably fine?

> We could of course also just reject void expressions

I mean, I think accepting them is fine (some attributes might have a use for them maybe?); just wondering how to best represent them in the AST.

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


More information about the cfe-commits mailing list