[llvm-bugs] [Bug 48020] New: Defining constrained member function out of line is rejected

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 30 07:03:23 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=48020

            Bug ID: 48020
           Summary: Defining constrained member function out of line is
                    rejected
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

>From StackOverflow (https://stackoverflow.com/q/64601583/2069064):

template <typename> concept C = true;

template <typename T>
struct Foo { };

template<typename T>
    requires C<T>
struct Foo<T> {
    static void bar();
};

template<typename T>
    requires C<T>
void Foo<T>::bar() { }

int main() {
    Foo<int>::bar();
}

clang 11 rejects this program with:
<source>:13:10: error: requires clause differs in template redeclaration
requires C<T>
         ^
<source>:3:1: note: previous template declaration is here
template <typename T>
^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201030/63d33c24/attachment.html>


More information about the llvm-bugs mailing list