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

            Bug ID: 51831
           Summary: Wrong template function definitions accepted
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2b
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Wrong code as follows is accepted by Clang:
```
#include <iostream>

template<> //#1
void foo(auto x) { std::cout << x; };

template<> //#2
void foo(int) requires(false) { std::cout << "int"; };

int main() { foo(1); }
```

In #1, we have a template specialization, while no template function was
defined before.
In #2 we have `requires`-clause for not-template function.

Both #1 and #2 must be rejected.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to