[llvm-bugs] [Bug 40465] New: CTAD on variable with parenthesized initializer
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Jan 25 09:32:54 PST 2019
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: unassignedclangbugs at nondot.org
Reporter: blitzrakete 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
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190125/bd41be73/attachment.html>
More information about the llvm-bugs
mailing list