[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 07:02:18 PST 2024


erichkeane wrote:

> Since we didn’t bring this up in the RFC, do we have any idea as to what we should do with `[[clang::assume]]`?
> 
> My suggestion would be to keep the current semantics for `[[clang::assume]]` (and `__attribute__((assume))`, but probably _not_ `[[assume]]`) iff the argument is a string literal—mostly because a string literal would always evaluate to `true` anyway, so there is literally nothing to be gained from writing `[[clang::assume(string-literal)]]` anyway if we interpret it as C++23’s `[[assume]]`.

I think your suggestion is sensible, though I'm equally as OK with just making the standard attribute ONLY spellable as `[[assume]]` (and leaving the other attribute alone).

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


More information about the cfe-commits mailing list