Skip to content

out-of-line implementation of a constrained inner template of a class template specialization does not match primary template #61414

@ldalessa

Description

@ldalessa

In the following code, Clang reports that it can not match the specialization with anything in the primary template. Both GCC and NVC++ (EDG+LLVM) accept this as valid.

#include <concepts>

template<bool>
struct a
{
    template<std::movable T>
    void c(T&& t);
};

template<>
template<std::movable T>
void a<true>::c(T&&t)
{}

Output:

<source>:12:15: error: out-of-line definition of 'c' does not match any declaration in 'a<true>'
void a<true>::c(T&&t)
              ^

Live example: https://godbolt.org/z/3PnKj4c75

Metadata

Metadata

Labels

c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 concepts

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions