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

            Bug ID: 44673
           Summary: Rejects valid code with constructor accepting
                    constrained auto parameter when the concept name is
                    namespace qualified and has an explicit template
                    argument
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: da...@doublewise.net
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

The following well-formed code

```
namespace n {

template<typename, typename>
concept c = true;

}

struct s {
    s(n::c<int> auto);
};

auto x = s(0);
```

is rejected by clang with the message


```
<source>:9:17: error: expected ')'

    s(n::c<int> auto);

                ^

<source>:9:6: note: to match this '('

    s(n::c<int> auto);

     ^

<source>:9:10: error: non-friend class member 'c' cannot have a qualified name

    s(n::c<int> auto);

      ~~~^

<source>:9:10: error: field has incomplete type 's'

<source>:8:8: note: definition of 's' is not complete until the closing '}'

struct s {

       ^

<source>:12:10: error: no matching conversion for functional-style cast from
'int' to 's'

auto x = s(0);

         ^~~

<source>:8:8: note: candidate constructor (the implicit copy constructor) not
viable: no known conversion from 'int' to 'const s' for 1st argument

struct s {

       ^

<source>:8:8: note: candidate constructor (the implicit move constructor) not
viable: no known conversion from 'int' to 's' for 1st argument

struct s {

       ^

<source>:8:8: note: candidate constructor (the implicit default constructor)
not viable: requires 0 arguments, but 1 was provided

4 errors generated.

Compiler returned: 1
```

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

Reply via email to