Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.
Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.
Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.
Implemented support for default initialization in
InitializationSequence.
Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.
Taught CXXConstructExpr to store more location information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp
index fcc939d..91f800d 100644
--- a/test/SemaCXX/new-delete.cpp
+++ b/test/SemaCXX/new-delete.cpp
@@ -59,12 +59,12 @@
(void)new int[1][i]; // expected-error {{only the first dimension}}
(void)new (int[1][i]); // expected-error {{only the first dimension}}
(void)new (int[i]); // expected-error {{when type is in parentheses}}
- (void)new int(*(S*)0); // expected-error {{incompatible type initializing}}
- (void)new int(1, 2); // expected-error {{initializer of a builtin type can only take one argument}}
+ (void)new int(*(S*)0); // expected-error {{no viable conversion from 'struct S' to 'int'}}
+ (void)new int(1, 2); // expected-error {{excess elements in scalar initializer}}
(void)new S(1); // expected-error {{no matching constructor}}
- (void)new S(1, 1); // expected-error {{call to constructor of 'S' is ambiguous}}
- (void)new const int; // expected-error {{must provide an initializer}}
- (void)new float*(ip); // expected-error {{incompatible type initializing 'int *', expected 'float *'}}
+ (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 *'}}
// 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'}}
diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp
index e3da45e..ffe1d58 100644
--- a/test/SemaTemplate/instantiate-expr-4.cpp
+++ b/test/SemaTemplate/instantiate-expr-4.cpp
@@ -21,8 +21,8 @@
template struct FunctionalCast0<5>;
-struct X { // expected-note 2 {{candidate function}}
- X(int, int); // expected-note 2 {{candidate function}}
+struct X { // expected-note 3 {{candidate function}}
+ X(int, int); // expected-note 3 {{candidate function}}
};
template<int N, int M>