clang-concepts-monorepo icon indicating copy to clipboard operation
clang-concepts-monorepo copied to clipboard

Sema::getAssociatedConstraints incomplete result

Open DanielBelow opened this issue 5 years ago • 0 comments

Foo.h:

template<class T> concept ReturnTy = true;

template<class T>
concept MyConcept = requires (T t) {
  { t.foo } -> ReturnTy;
  { t.bar } -> int;
};

Foo.cpp:

#include "Foo.h"

template<MyConcept MC>
void func(MC mc) {}

Sema::getAssociatedConstraints called for func does not include the requirement { t.foo } -> ReturnTy; (or others, where the returned type is a concept), but it does include { f.bar } -> int;.

It works as expected for non-concept return types, or when MyConcept or MyConcept and ReturnTy are defined in Foo.cpp.

DanielBelow avatar Oct 22 '19 20:10 DanielBelow