summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CXX/expr/expr.ass/p9-cxx11.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/CXX/expr/expr.ass/p9-cxx11.cpp b/test/CXX/expr/expr.ass/p9-cxx11.cpp
index bd1603d6ab..206c82c985 100644
--- a/test/CXX/expr/expr.ass/p9-cxx11.cpp
+++ b/test/CXX/expr/expr.ass/p9-cxx11.cpp
@@ -13,7 +13,10 @@ void std_example() {
int a, b;
a = b = { 1 };
- a = { 1 } = b;
+ a = { 1 } = b; // expected-error {{initializer list cannot be used on the left hand side of operator '='}}
+ a = a + { 4 }; // expected-error {{initializer list cannot be used on the right hand side of operator '+'}}
+ a = { 3 } * { 4 }; // expected-error {{initializer list cannot be used on the left hand side of operator '*'}} \
+ expected-error {{initializer list cannot be used on the right hand side of operator '*'}}
}
struct S {
@@ -27,5 +30,5 @@ struct T {
static_assert((T() = {4, 9}) == 4, "");
static_assert((T() += {4, 9}) == 9, "");
-int k1 = T() = { 1, 2 } = { 3, 4 }; // expected-error {{expected ';'}}
-int k2 = T() = { 1, 2 } + 1; // expected-error {{expected ';'}}
+int k1 = T() = { 1, 2 } = { 3, 4 }; // expected-error {{initializer list cannot be used on the left hand side of operator '='}}
+int k2 = T() = { 1, 2 } + 1; // expected-error {{initializer list cannot be used on the left hand side of operator '+'}}