This is an archive of the discontinued LLVM Phabricator instance.

P0620 follow-up: deducing `auto` from braced-init-list in new expr
ClosedPublic

Authored by lichray on Oct 31 2017, 12:16 AM.

Details

Summary

This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from auto and decltype(auto)) to be usable in a new expression with a single-clause braced-init-list as its initializer (8.3.4 [expr.new]/2). N3922 defined its semantics.

References:
http://wg21.link/p0620r0
http://wg21.link/n3922

Diff Detail

Repository
rC Clang

Event Timeline

lichray created this revision.Oct 31 2017, 12:16 AM

Ping. Just accept this as a DR, like what GCC does, I guess?

rsmith edited edge metadata.Dec 7 2017, 3:15 PM

EDG and MSVC do not appear to treat this as a defect resolution; I suspect this is an oversight in GCC rather than an intentional extension. Let's convert the error to an (off by default) pedantic Extension (ISO C++11 does not allow ...), and suppress the extension warning in C++17 onwards.

lichray updated this revision to Diff 126092.Dec 7 2017, 9:56 PM

Keep a pedantic Extension warning.

rsmith accepted this revision.Dec 11 2017, 3:26 AM
rsmith added inline comments.
include/clang/Basic/DiagnosticSemaKinds.td
1992

does not -> do not, using -> to use

lib/Sema/SemaExprCXX.cpp
1762–1763

Move this after the "ctor_multiple_expressions" diagnostic below.

This revision is now accepted and ready to land.Dec 11 2017, 3:26 AM
lichray marked 2 inline comments as done.Dec 11 2017, 10:19 AM
This revision was automatically updated to reflect the committed changes.