summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/stack-addr-ps.c2
-rw-r--r--clang/test/Analysis/stack-addr-ps.cpp4
-rw-r--r--clang/test/Analysis/stackaddrleak.c2
-rw-r--r--clang/test/CXX/drs/dr16xx.cpp28
-rw-r--r--clang/test/CXX/drs/dr18xx.cpp6
-rw-r--r--clang/test/CXX/special/class.copy/p11.0x.copy.cpp7
-rw-r--r--clang/test/CXX/special/class.ctor/p5-0x.cpp2
-rw-r--r--clang/test/CXX/temp/temp.param/p5.cpp8
-rw-r--r--clang/test/SemaCXX/constexpr-default-arg.cpp4
-rw-r--r--clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp4
-rw-r--r--clang/test/SemaCXX/eval-crashes.cpp4
-rw-r--r--clang/test/SemaCXX/return-stack-addr-2.cpp2
-rw-r--r--clang/test/SemaCXX/return-stack-addr.cpp3
-rw-r--r--clang/test/SemaCXX/rval-references.cpp5
14 files changed, 41 insertions, 40 deletions
diff --git a/clang/test/Analysis/stack-addr-ps.c b/clang/test/Analysis/stack-addr-ps.c
index 4026cee90b0..721051ffaf1 100644
--- a/clang/test/Analysis/stack-addr-ps.c
+++ b/clang/test/Analysis/stack-addr-ps.c
@@ -6,7 +6,7 @@ int* f1() {
}
int* f2(int y) {
- return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
+ return &y; // expected-warning{{Address of stack memory associated with local variable 'y' returned}} expected-warning{{address of stack memory associated with parameter 'y' returned}}
}
int* f3(int x, int *y) {
diff --git a/clang/test/Analysis/stack-addr-ps.cpp b/clang/test/Analysis/stack-addr-ps.cpp
index 79afd18e188..e1f06835c78 100644
--- a/clang/test/Analysis/stack-addr-ps.cpp
+++ b/clang/test/Analysis/stack-addr-ps.cpp
@@ -91,8 +91,8 @@ struct TS {
// rdar://11345441
int* f5() {
- int& i = i; // expected-warning {{Assigned value is garbage or undefined}} expected-note {{binding reference variable 'i' here}} expected-warning{{reference 'i' is not yet bound to a value when used within its own initialization}}
- return &i; // expected-warning {{address of stack memory associated with local variable 'i' returned}}
+ int& i = i; // expected-warning {{Assigned value is garbage or undefined}} expected-warning{{reference 'i' is not yet bound to a value when used within its own initialization}}
+ return &i;
}
void *radar13226577() {
diff --git a/clang/test/Analysis/stackaddrleak.c b/clang/test/Analysis/stackaddrleak.c
index a037d12fe40..8a1519e7874 100644
--- a/clang/test/Analysis/stackaddrleak.c
+++ b/clang/test/Analysis/stackaddrleak.c
@@ -37,7 +37,7 @@ void test_multi_return() {
intptr_t returnAsNonLoc() {
int x;
- return (intptr_t)&x; // expected-warning{{Address of stack memory associated with local variable 'x' returned to caller}}
+ return (intptr_t)&x; // expected-warning{{Address of stack memory associated with local variable 'x' returned to caller}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
bool returnAsBool() {
diff --git a/clang/test/CXX/drs/dr16xx.cpp b/clang/test/CXX/drs/dr16xx.cpp
index 54648cfe969..d9d404c0c2e 100644
--- a/clang/test/CXX/drs/dr16xx.cpp
+++ b/clang/test/CXX/drs/dr16xx.cpp
@@ -317,23 +317,25 @@ namespace dr1696 { // dr1696: 7
// D1 d1 = {A()};
// ... which lifetime-extends the A temporary.
struct D1 {
- const A &a = A();
#if __cplusplus < 201402L
// expected-error@-2 {{binds to a temporary}}
- // expected-note@-4 {{here}}
-#else
- // expected-warning-re@-5 {{sorry, lifetime extension {{.*}} not supported}}
#endif
+ const A &a = A(); // expected-note {{default member init}}
};
- D1 d1 = {}; // expected-note {{here}}
+ D1 d1 = {};
+#if __cplusplus < 201402L
+ // expected-note@-2 {{first required here}}
+#else
+ // expected-warning-re@-4 {{sorry, lifetime extension {{.*}} not supported}}
+#endif
struct D2 {
- const A &a = A(); // expected-error {{binds to a temporary}}
- D2() {} // expected-note {{used here}}
+ const A &a = A(); // expected-note {{default member init}}
+ D2() {} // expected-error {{binds to a temporary}}
};
- struct D3 { // expected-note {{used here}}
- const A &a = A(); // expected-error {{binds to a temporary}}
+ struct D3 { // expected-error {{binds to a temporary}}
+ const A &a = A(); // expected-note {{default member init}}
};
D3 d3; // expected-note {{first required here}}
@@ -352,14 +354,14 @@ namespace dr1696 { // dr1696: 7
std::initializer_list<int> il = {1, 2, 3};
};
- struct haslist4 { // expected-note {{in default member initializer}}
- std::initializer_list<int> il = {1, 2, 3}; // expected-error {{backing array for 'std::initializer_list' member 'il' is a temporary object}}
+ struct haslist4 { // expected-error {{backing array for 'std::initializer_list' member 'il' is a temporary object}}
+ std::initializer_list<int> il = {1, 2, 3}; // expected-note {{default member initializer}}
};
haslist4 hl4; // expected-note {{in implicit default constructor}}
struct haslist5 {
- std::initializer_list<int> il = {1, 2, 3}; // expected-error {{backing array for 'std::initializer_list' member 'il' is a temporary object}}
- haslist5() {} // expected-note {{in default member initializer}}
+ std::initializer_list<int> il = {1, 2, 3}; // expected-note {{default member initializer}}
+ haslist5() {} // expected-error {{backing array for 'std::initializer_list' member 'il' is a temporary object}}
};
#endif
}
diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp
index f6a4676bc7b..16f967b6565 100644
--- a/clang/test/CXX/drs/dr18xx.cpp
+++ b/clang/test/CXX/drs/dr18xx.cpp
@@ -33,10 +33,10 @@ namespace dr1813 { // dr1813: 7
namespace dr1815 { // dr1815: no
#if __cplusplus >= 201402L
// FIXME: needs codegen test
- struct A { int &&r = 0; }; // FIXME expected-warning {{not supported}}
- A a = {}; // expected-note {{here}}
+ struct A { int &&r = 0; }; // expected-note {{default member init}}
+ A a = {}; // FIXME expected-warning {{not supported}}
- struct B { int &&r = 0; }; // expected-error {{binds to a temporary}} expected-note {{here}}
+ struct B { int &&r = 0; }; // expected-error {{binds to a temporary}} expected-note {{default member init}}
B b; // expected-note {{here}}
#endif
}
diff --git a/clang/test/CXX/special/class.copy/p11.0x.copy.cpp b/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
index a4d0cdcdc73..e7256bcf948 100644
--- a/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
+++ b/clang/test/CXX/special/class.copy/p11.0x.copy.cpp
@@ -128,11 +128,10 @@ struct RValue {
RValue RVa;
RValue RVb(RVa); // expected-error{{call to implicitly-deleted copy constructor}}
-// FIXME: The note on the class-name is attached to the location of the
+// FIXME: The error on the class-name is attached to the location of the
// constructor. This is not especially clear.
-struct RValueTmp { // expected-note {{used here}}
- int && ri = 1; // expected-note{{copy constructor of 'RValueTmp' is implicitly deleted because field 'ri' is of rvalue reference type 'int &&'}}
- // expected-error@-1 {{reference member 'ri' binds to a temporary}}
+struct RValueTmp { // expected-error {{reference member 'ri' binds to a temporary}}
+ int && ri = 1; // expected-note{{copy constructor of 'RValueTmp' is implicitly deleted because field 'ri' is of rvalue reference type 'int &&'}} // expected-note {{default member init}}
};
RValueTmp RVTa; // expected-note {{implicit default constructor for 'RValueTmp' first required here}}
RValueTmp RVTb(RVTa); // expected-error{{call to implicitly-deleted copy constructor}}
diff --git a/clang/test/CXX/special/class.ctor/p5-0x.cpp b/clang/test/CXX/special/class.ctor/p5-0x.cpp
index 5558313ce78..061a3d1f073 100644
--- a/clang/test/CXX/special/class.ctor/p5-0x.cpp
+++ b/clang/test/CXX/special/class.ctor/p5-0x.cpp
@@ -47,7 +47,7 @@ class NotDeleted2c { int &&a = static_cast<int&&>(n); };
NotDeleted2c nd2c;
// Note: this one does not have a deleted default constructor even though the
// implicit default constructor is ill-formed!
-class NotDeleted2d { int &&a = 0; }; // expected-error {{reference member 'a' binds to a temporary object}} expected-note {{here}}
+class NotDeleted2d { int &&a = 0; }; // expected-error {{reference member 'a' binds to a temporary object}} expected-note {{default member init}}
NotDeleted2d nd2d; // expected-note {{first required here}}
// - any non-variant non-static data member of const qualified type (or array
diff --git a/clang/test/CXX/temp/temp.param/p5.cpp b/clang/test/CXX/temp/temp.param/p5.cpp
index de902a5e4d0..4cb2d4343a3 100644
--- a/clang/test/CXX/temp/temp.param/p5.cpp
+++ b/clang/test/CXX/temp/temp.param/p5.cpp
@@ -1,13 +1,13 @@
// RUN: %clang_cc1 -verify %s -std=c++14
-template<const int I> struct S { // expected-note {{in default member initializer}}
+template<const int I> struct S { // expected-error {{reference member 'r' binds to a temporary object}}
decltype(I) n;
- int &&r = I; // expected-error {{reference member 'r' binds to a temporary object}}
+ int &&r = I; // expected-note {{default member initializer}}
};
S<5> s; // expected-note {{implicit default constructor}}
-template<typename T, T v> struct U { // expected-note {{in default member initializer}}
+template<typename T, T v> struct U { // expected-error {{reference member 'r' binds to a temporary object}}
decltype(v) n;
- int &&r = v; // expected-error {{reference member 'r' binds to a temporary object}}
+ int &&r = v; // expected-note {{default member initializer}}
};
U<const int, 6> u; // expected-note {{implicit default constructor}}
diff --git a/clang/test/SemaCXX/constexpr-default-arg.cpp b/clang/test/SemaCXX/constexpr-default-arg.cpp
index 165c31aab63..0cef4aa578a 100644
--- a/clang/test/SemaCXX/constexpr-default-arg.cpp
+++ b/clang/test/SemaCXX/constexpr-default-arg.cpp
@@ -31,8 +31,8 @@ void test_default_arg2() {
}
// Check that multiple CXXDefaultInitExprs don't cause an assertion failure.
-struct A { int &&r = 0; }; // expected-warning 2{{not supported}}
+struct A { int &&r = 0; }; // expected-note 2{{default member initializer}}
struct B { A x, y; };
-B b = {}; // expected-note 2{{in default member initializer for field 'r' used here}}
+B b = {}; // expected-warning 2{{not supported}}
}
diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
index ece014d93a5..f371891e548 100644
--- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
@@ -155,11 +155,11 @@ void dangle() {
struct haslist1 {
std::initializer_list<int> il // expected-note {{declared here}}
= {1, 2, 3}; // ok, unused
- std::initializer_list<int> jl{1, 2, 3}; // expected-error {{backing array for 'std::initializer_list' member 'jl' is a temporary object}}
+ std::initializer_list<int> jl{1, 2, 3}; // expected-note {{default member init}}
haslist1();
};
-haslist1::haslist1() // expected-note {{used here}}
+haslist1::haslist1() // expected-error {{backing array for 'std::initializer_list' member 'jl' is a temporary object}}
: il{1, 2, 3} // expected-error {{backing array for 'std::initializer_list' member 'il' is a temporary object}}
{}
diff --git a/clang/test/SemaCXX/eval-crashes.cpp b/clang/test/SemaCXX/eval-crashes.cpp
index 33bde75de6b..60c2deed4d3 100644
--- a/clang/test/SemaCXX/eval-crashes.cpp
+++ b/clang/test/SemaCXX/eval-crashes.cpp
@@ -27,9 +27,9 @@ namespace pr33140_0b {
namespace pr33140_2 {
// FIXME: The declaration of 'b' below should lifetime-extend two int
// temporaries.
- struct A { int &&r = 0; }; // expected-warning 2{{not supported}}
+ struct A { int &&r = 0; }; // expected-note 2{{initializing field 'r' with default member initializer}}
struct B { A x, y; };
- B b = {}; // expected-note 2{{used here}}
+ B b = {}; // expected-warning 2{{not supported}}
}
namespace pr33140_3 {
diff --git a/clang/test/SemaCXX/return-stack-addr-2.cpp b/clang/test/SemaCXX/return-stack-addr-2.cpp
index 47b45957e94..e848189bde7 100644
--- a/clang/test/SemaCXX/return-stack-addr-2.cpp
+++ b/clang/test/SemaCXX/return-stack-addr-2.cpp
@@ -65,7 +65,7 @@ const int *int6() {
const int *int7(int x) {
const int &x2 = x; // expected-note{{binding reference variable 'x2' here}}
- return &x2; // expected-warning{{address of stack memory associated with local variable 'x' returned}}
+ return &x2; // expected-warning{{address of stack memory associated with parameter 'x' returned}}
}
const int *int8(const int &x = 5) {
diff --git a/clang/test/SemaCXX/return-stack-addr.cpp b/clang/test/SemaCXX/return-stack-addr.cpp
index 7670798ecb9..a5f84adf0b4 100644
--- a/clang/test/SemaCXX/return-stack-addr.cpp
+++ b/clang/test/SemaCXX/return-stack-addr.cpp
@@ -63,7 +63,8 @@ int& ret_local_field_ref() {
int* ret_conditional(bool cond) {
int x = 1;
int y = 2;
- return cond ? &x : &y; // expected-warning {{address of stack memory}}
+ return cond ? &x // expected-warning {{address of stack memory associated with local variable 'x' returned}}
+ : &y; // expected-warning {{address of stack memory associated with local variable 'y' returned}}
}
int* ret_conditional_rhs(int *x, bool cond) {
diff --git a/clang/test/SemaCXX/rval-references.cpp b/clang/test/SemaCXX/rval-references.cpp
index 94b09ce2cb2..838bf484fe2 100644
--- a/clang/test/SemaCXX/rval-references.cpp
+++ b/clang/test/SemaCXX/rval-references.cpp
@@ -65,10 +65,9 @@ void f() {
}
int&& should_warn(int i) {
- // FIXME: The stack address return test doesn't reason about casts.
- return static_cast<int&&>(i); // xpected-warning {{returning reference to temporary}}
+ return static_cast<int&&>(i); // expected-warning {{reference to stack memory associated with parameter 'i' returned}}
}
-int&& should_not_warn(int&& i) { // But GCC 4.4 does
+int&& should_not_warn(int&& i) {
return static_cast<int&&>(i);
}
OpenPOWER on IntegriCloud