[clang] [clang] constexpr atomic builtins (__c11_atomic_OP and __atomic_OP) (PR #98756)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 06:47:43 PST 2025


Hana =?utf-8?q?Dusíková?= <hanicka at hanicka.net>,
Hana =?utf-8?q?Dusíková?= <hanicka at hanicka.net>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/98756 at github.com>


================
@@ -8075,6 +8089,64 @@ class ExprEvaluatorBase
     return StmtVisitorTy::Visit(Source);
   }
 
+  bool VisitAtomicExpr(const AtomicExpr *E) {
+    if (!EvaluateAtomicOrder(E, Info))
----------------
AaronBallman wrote:

Is it intentional that there's no check for C++26 anywhere to reject these uses in earlier language modes? If you intend for this to be an extension in older modes, that seems reasonable to me, but you should update `clang/docs/LanguageExtensions.rst` to explicitly document the extension, add the usual pre-compat/extension warnings, tests for those two new diagnostics, and add a `RUN` line for an older language mode to your larger functionality tests.

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


More information about the cfe-commits mailing list