Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/121...@github.com>
================ @@ -1533,13 +1535,11 @@ class NonTypeTemplateParmDecl final /// Return the constraint introduced by the placeholder type of this non-type /// template parameter (if any). Expr *getPlaceholderTypeConstraint() const { - return hasPlaceholderTypeConstraint() ? *getTrailingObjects<Expr *>() : - nullptr; + return PlaceholderTypeConstraintInitialized ? *getTrailingObjects<Expr *>() + : nullptr; } - void setPlaceholderTypeConstraint(Expr *E) { - *getTrailingObjects<Expr *>() = E; ---------------- erichkeane wrote: While I like the assert-safety that we get from the `PlaceholderTypeConstraintInitialized`, I'm not sure it is worth the rigamarole. Why not just have the `ctor` do `setPlaceholderTypeConstraint`? https://github.com/llvm/llvm-project/pull/121768 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits