llvm-project/clang/test/CXX/dcl.decl
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.decomp [c++1z] P0217R3: Allow by-value structured binding of arrays. 2016-12-14 03:22:16 +00:00
dcl.fct.def Implement the likely resolution of core issue 253. 2016-02-19 01:52:46 +00:00
dcl.init [Sema] Add lvalue-to-rvalue cast in direct-list-initialization of enum 2017-02-16 01:20:00 +00:00
dcl.meaning P0012R1: Make exception specifications be part of the type system. This 2016-10-16 17:54:23 +00:00
dcl.name
p4-0x.cpp