// C++ initialization
def err_init_conversion_failed : Error<
"cannot initialize %select{a variable|a parameter|return object|an "
- "exception object|a value|a base class|a member subobject|an array element}0"
- " of type %1 with an %select{rvalue|lvalue}2 of type %3">;
+ "exception object|a member subobject|an array element|a new value|a value|a "
+ "base class|an array element}0 of type %1 with an %select{rvalue|lvalue}2 of "
+ "type %3">;
def err_lvalue_to_rvalue_ref : Error<"rvalue reference cannot bind to lvalue">;
def err_invalid_initialization : Error<
/// \brief The entity being initialized is an exception object that
/// is being thrown.
EK_Exception,
+ /// \brief The entity being initialized is a non-static data member
+ /// subobject.
+ EK_Member,
+ /// \brief The entity being initialized is an element of an array.
+ EK_ArrayElement,
/// \brief The entity being initialized is an object (or array of
/// objects) allocated via new.
EK_New,
EK_Temporary,
/// \brief The entity being initialized is a base member subobject.
EK_Base,
- /// \brief The entity being initialized is a non-static data member
- /// subobject.
- EK_Member,
- /// \brief The entity being initialized is an element of an array.
- EK_ArrayElement,
/// \brief The entity being initialized is an element of a vector.
/// or vector.
EK_VectorElement
(void)new S(1); // expected-error {{no matching constructor}}
(void)new S(1, 1); // expected-error {{call to constructor of 'struct S' is ambiguous}}
(void)new const int; // expected-error {{default initialization of an object of const type 'int const'}}
- (void)new float*(ip); // expected-error {{cannot initialize a value of type 'float *' with an lvalue of type 'int *'}}
+ (void)new float*(ip); // expected-error {{cannot initialize a new value of type 'float *' with an lvalue of type 'int *'}}
// Undefined, but clang should reject it directly.
(void)new int[-1]; // expected-error {{array size is negative}}
(void)new int[*(S*)0]; // expected-error {{array size expression must have integral or enumerated type, not 'struct S'}}