[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 06:11:39 PST 2025


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/121768 at 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:

Ok, then we're on the same page.  I do not see a difference between "explicitly null" and "not initialized" here.  I think that is a differentiation without a cause.

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


More information about the cfe-commits mailing list