[PATCH] D112481: [Sema] fix nondeterminism in ASTContext::getDeducedTemplateSpecializationType

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 25 23:52:50 PDT 2021


bruno added a reviewer: bruno.
bruno added a comment.

Nice catch, thanks for working on this!



================
Comment at: clang/lib/AST/ASTContext.cpp:5640
+  DeducedTemplateSpecializationType::Profile(
+      ID, Template, DeducedType, IsDependent || Template.isDependent());
   if (DeducedTemplateSpecializationType *DTST =
----------------
Should this be done in the implementation (like done for the ctor)?
```
static void Profile(llvm::FoldingSetNodeID &ID, TemplateName Template,
                      QualType Deduced, bool IsDependent) {
    Template.Profile(ID);
    ID.AddPointer(Deduced.getAsOpaquePtr());
    ID.AddBoolean(IsDependent || Template.isDependent());
  }
```


================
Comment at: clang/lib/AST/ASTContext.cpp:5649
+  DTST->Profile(TempID);
+  assert(ID == TempID && "ID does not match");
   Types.push_back(DTST);
----------------
Seems like this assertion is failing in some of the tests above!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112481/new/

https://reviews.llvm.org/D112481



More information about the cfe-commits mailing list