[clang] 0cf4f81 - Adding an assertion back.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 26 09:51:21 PDT 2021


Author: Aaron Ballman
Date: 2021-08-26T12:51:14-04:00
New Revision: 0cf4f81082e9fa052e60450b8cbb10007e59931c

URL: https://github.com/llvm/llvm-project/commit/0cf4f81082e9fa052e60450b8cbb10007e59931c
DIFF: https://github.com/llvm/llvm-project/commit/0cf4f81082e9fa052e60450b8cbb10007e59931c.diff

LOG: Adding an assertion back.

This assert was removed in 98339f14a0420cdfbe4215d8d1bc0a01165e0495,
but during post-commit review, it was pointed out that the assert was
valid.

Added: 
    

Modified: 
    clang/lib/Sema/SemaConcept.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index c582446426892..2932335f3ad49 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1062,6 +1062,8 @@ ReturnTypeRequirement(TemplateParameterList *TPL) :
   assert(TPL->size() == 1);
   const TypeConstraint *TC =
       cast<TemplateTypeParmDecl>(TPL->getParam(0))->getTypeConstraint();
+  assert(TC &&
+         "TPL must have a template type parameter with a type constraint");
   auto *Constraint =
       cast<ConceptSpecializationExpr>(TC->getImmediatelyDeclaredConstraint());
   bool Dependent =


        


More information about the cfe-commits mailing list