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

            Bug ID: 40465
           Summary: CTAD on variable with parenthesized initializer
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++'17
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

template <typename = void>
struct Foo {};

int main() {
  Foo f; // everyone accepts
  Foo (g); // clang rejects
           // gcc accepts, edg accepts, msvc accepts
}

clang says:

error: cannot use parentheses when declaring variable with deduced class
template specialization type

This seems to be a highly specific error message but I can't see why this would
be disallowed. [dcl.type.class.deduct] seems to allow `g`, but again since the
message is so specific, I don't know. The other three compilers accept the
code.

-- 
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