[PATCH] D41910: [Concepts] Constrained partial specializations and function overloads.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 01:36:46 PDT 2019


martong requested changes to this revision.
martong added a reviewer: balazske.
martong added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/AST/ASTImporter.cpp:5026
+        ClassTemplate->findPartialSpecialization(TemplateArgs,
+            PartialSpec->getAssociatedConstraints(), InsertPos);
   else
----------------
`ClassTemplate` is in the "to" context, i.e. it is already imported.
`PartialSpec` is in the "from" context, not yet imported.
Thus, `findPartialSpecialization` is going search for a specialization in the "to" context but with constraints which are in the "from" context. So I suppose this will not find any match.
So, first you have to import the associated constraints expression and then use that in the search.

Something like:
```
  ExpectedExpr ConstraintsOrErr = import(D->getAssociatedConstraints());
  if (!ConstraintsOrErr)
    return ConstraintsOrErr.takeError();
  // ...
  ClassTemplate->findPartialSpecialization(TemplateArgs,
            *ConstraintsOrErr, InsertPos);

```
(The same  below.)


Repository:
  rC Clang

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

https://reviews.llvm.org/D41910





More information about the cfe-commits mailing list