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

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 10:56:05 PST 2024


================
@@ -1996,6 +1996,30 @@ Here is an example:
   }];
 }
 
+def AssumeDocs : Documentation {
+  let Category = DocCatStmt;
+  let Heading = "assume";
+  let Content = [{
+The ``assume`` attribute is used to indicate to the optimizer that a
+certain condition can be assumed to be true at a certain point in the
+program. If this condition is violated at runtime, the behavior is
----------------
Sirraide wrote:

That did strike me as odd as well. The proposal also explicitly mentions that entities appearing in `assume` are ODR-used, which would indicate that it’s supposed to be potentially evaluated, which is what I have it set to currently, and there’s also a test for that too.

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


More information about the cfe-commits mailing list