llvm-project/clang/test/CXX/dcl.decl/dcl.init
Vedant Kumar f4217f862a [Sema] Add lvalue-to-rvalue cast in direct-list-initialization of enum
After r264564, we allowed direct-list-initialization of an enum from an
integral value in C++1z mode, so long as that value can convert to the
enum's underlying type.

In this kind of initialization, we need a lvalue-to-rvalue conversion
for the initializer value if it is not a rvalue. This lets us accept the
following code:

  enum class A : unsigned {};
  A foo(unsigned x) { return A{x}; }

Differential Revision: https://reviews.llvm.org/D29723

llvm-svn: 295266
2017-02-16 01:20:00 +00:00
..
dcl.init.aggr PR31606: Generalize our tentative DR resolution for inheriting copy/move 2017-01-13 20:46:54 +00:00
dcl.init.list [Sema] Add lvalue-to-rvalue cast in direct-list-initialization of enum 2017-02-16 01:20:00 +00:00
dcl.init.ref DR1295 and cleanup for P0135R1: Make our initialization code more directly 2016-12-09 18:49:13 +00:00
dcl.init.string
p5.cpp Fix all tests under test/CXX (and test/Analysis) to pass if clang's default 2016-08-31 23:24:08 +00:00
p6.cpp Implement the likely resolution of core issue 253. 2016-02-19 01:52:46 +00:00
p7.cpp [Sema] Don't perform aggregate initialization for types with explicit constructors 2016-12-03 01:26:47 +00:00
p14-0x.cpp