[llvm-bugs] [Bug 43090] self reference function variable cannot deduce auto return type
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Aug 22 10:08:26 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=43090
Richard Smith <richard-llvm at metafoo.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Clang's diagnostic is correct. You cannot mention a variable with a deduced
type in its own initializer. See [dcl.spec.auto]p11: "If the name of an entity
with an undeduced placeholder type appears in an expression, the program is
ill-formed."
Something about the generic lambda seems to be confusing GCC and MSVC, and
they're not properly enforcing this rule. ICC / EDG enforces the rule properly,
rejecting this like Clang does.
--
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/20190822/b5864e5e/attachment.html>
More information about the llvm-bugs
mailing list