diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-23 20:20:40 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-23 20:20:40 +0000 |
commit | 73eb7cd3514cf3124e751f03dd80990bb7d070c1 (patch) | |
tree | 0ad11ab141c9f25bb16ea497f2bbf260eb77f21a /clang/test | |
parent | 0cf999b663f8cde815196fc7b65ee33ca41077c4 (diff) | |
download | bcm5719-llvm-73eb7cd3514cf3124e751f03dd80990bb7d070c1.tar.gz bcm5719-llvm-73eb7cd3514cf3124e751f03dd80990bb7d070c1.zip |
Use the new init code for member subobjects.
llvm-svn: 94329
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/aggregate-initialization.cpp | 3 | ||||
-rw-r--r-- | clang/test/SemaCXX/dcl_init_aggr.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-expr-4.cpp | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/aggregate-initialization.cpp b/clang/test/SemaCXX/aggregate-initialization.cpp index 35db65173f5..3c9333b7953 100644 --- a/clang/test/SemaCXX/aggregate-initialization.cpp +++ b/clang/test/SemaCXX/aggregate-initialization.cpp @@ -37,3 +37,6 @@ __v4hi v1 = { (void *)1, 2, 3 }; // expected-error {{cannot initialize a vector // Array initialization. int a[] = { (void *)1 }; // expected-error {{cannot initialize an array element of type 'int' with an rvalue of type 'void *'}} + +// Struct initialization. +struct S { int a; } s = { (void *)1 }; // expected-error {{cannot initialize a member subobject of type 'int' with an rvalue of type 'void *'}} diff --git a/clang/test/SemaCXX/dcl_init_aggr.cpp b/clang/test/SemaCXX/dcl_init_aggr.cpp index 07ddb0add2c..861eb3dcb16 100644 --- a/clang/test/SemaCXX/dcl_init_aggr.cpp +++ b/clang/test/SemaCXX/dcl_init_aggr.cpp @@ -120,4 +120,4 @@ u u1 = { 1 }; u u2 = u1; u u3 = 1; // expected-error{{no viable conversion}} u u4 = { 0, "asdf" }; // expected-error{{excess elements in union initializer}} -u u5 = { "asdf" }; // expected-error{{incompatible type initializing 'char const [5]', expected 'int'}} +u u5 = { "asdf" }; // expected-error{{cannot initialize a member subobject of type 'int' with an lvalue of type 'char const [5]'}} diff --git a/clang/test/SemaTemplate/instantiate-expr-4.cpp b/clang/test/SemaTemplate/instantiate-expr-4.cpp index 428ef1ba873..b5ffa4b39b2 100644 --- a/clang/test/SemaTemplate/instantiate-expr-4.cpp +++ b/clang/test/SemaTemplate/instantiate-expr-4.cpp @@ -197,7 +197,7 @@ template struct InitList1<APair, int*>; template<typename T, typename Val1, typename Val2> struct InitList2 { void f(Val1 val1, Val2 val2) { - T x = { val1, val2 }; // expected-error{{incompatible}} + T x = { val1, val2 }; // expected-error{{cannot initialize}} } }; |