summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2015-05-15 22:07:49 +0000
committerRichard Trieu <rtrieu@google.com>2015-05-15 22:07:49 +0000
commit0ff51f39deacb0622f64e2c6100edfa87a6081b5 (patch)
tree4d360c50d741019a26436adc9dbe7155156a48e3 /clang/test
parent3de83e4098af7e10175487d831d259108310b313 (diff)
downloadbcm5719-llvm-0ff51f39deacb0622f64e2c6100edfa87a6081b5.tar.gz
bcm5719-llvm-0ff51f39deacb0622f64e2c6100edfa87a6081b5.zip
Reverse the order of types in the reference dropping qualifiers error.
The error has the form ... 'int' ... 'const int' ... dropped qualifiers. At first glance, it appears that the const qualifier is added. Reverse the types so that the second type is less qualified than the first. llvm-svn: 237482
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp2
-rw-r--r--clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp10
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp8
-rw-r--r--clang/test/Misc/diag-template-diffing.cpp2
-rw-r--r--clang/test/SemaCXX/builtins-arm.cpp2
-rw-r--r--clang/test/SemaCXX/references.cpp2
6 files changed, 13 insertions, 13 deletions
diff --git a/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
index fdfa6781fe2..b872281b05a 100644
--- a/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
+++ b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
@@ -123,7 +123,7 @@ namespace std_example_2 {
const double& rcd2 = 2;
double&& rrd = 2;
const volatile int cvi = 1;
- const int& r2 = cvi; // expected-error{{binding of reference to type 'const int' to a value of type 'const volatile int' drops qualifiers}}
+ const int& r2 = cvi; // expected-error{{binding value of type 'const volatile int' to reference of type 'const int' drops qualifiers}}
double d;
double&& rrd2 = d; // expected-error{{rvalue reference to type 'double' cannot bind to lvalue of type 'double'}}
diff --git a/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
index fee5f96c389..36fcf904257 100644
--- a/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
+++ b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
@@ -64,10 +64,10 @@ void bind_lvalue_quals(volatile Base b, volatile Derived d,
volatile const int ivc) {
volatile Base &bvr1 = b;
volatile Base &bvr2 = d;
- volatile Base &bvr3 = bvc; // expected-error{{binding of reference to type 'volatile Base' to a value of type 'const volatile Base' drops qualifiers}}
- volatile Base &bvr4 = dvc; // expected-error{{binding of reference to type 'volatile Base' to a value of type 'const volatile Derived' drops qualifiers}}
+ volatile Base &bvr3 = bvc; // expected-error{{binding value of type 'const volatile Base' to reference of type 'volatile Base' drops qualifiers}}
+ volatile Base &bvr4 = dvc; // expected-error{{binding value of type 'const volatile Derived' to reference of type 'volatile Base' drops qualifiers}}
- volatile int &ir = ivc; // expected-error{{binding of reference to type 'volatile int' to a value of type 'const volatile int' drops qualifiers}}
+ volatile int &ir = ivc; // expected-error{{binding value of type 'const volatile int' to reference of type 'volatile int' drops qualifiers}}
const volatile Base &bcvr1 = b;
const volatile Base &bcvr2 = d;
@@ -118,8 +118,8 @@ void bind_const_lvalue_to_rvalue() {
const Base &br3 = create<const Base>();
const Base &br4 = create<const Derived>();
- const Base &br5 = create<const volatile Base>(); // expected-error{{binding of reference to type 'const Base' to a value of type 'const volatile Base' drops qualifiers}}
- const Base &br6 = create<const volatile Derived>(); // expected-error{{binding of reference to type 'const Base' to a value of type 'const volatile Derived' drops qualifiers}}
+ const Base &br5 = create<const volatile Base>(); // expected-error{{binding value of type 'const volatile Base' to reference of type 'const Base' drops qualifiers}}
+ const Base &br6 = create<const volatile Derived>(); // expected-error{{binding value of type 'const volatile Derived' to reference of type 'const Base' drops qualifiers}}
const int &ir = create<int>();
}
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
index 0cf01ade431..0cbffe844e7 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p16.cpp
@@ -24,16 +24,16 @@ void test_capture(X x) {
int a;
[=]{
[&] {
- int &x = a; // expected-error{{binding of reference to type 'int' to a value of type 'const int' drops qualifiers}}
- int &x2 = a; // expected-error{{binding of reference to type 'int' to a value of type 'const int' drops qualifiers}}
+ int &x = a; // expected-error{{binding value of type 'const int' to reference of type 'int' drops qualifiers}}
+ int &x2 = a; // expected-error{{binding value of type 'const int' to reference of type 'int' drops qualifiers}}
}();
}();
[=]{
[&a] {
[&] {
- int &x = a; // expected-error{{binding of reference to type 'int' to a value of type 'const int' drops qualifiers}}
- int &x2 = a; // expected-error{{binding of reference to type 'int' to a value of type 'const int' drops qualifiers}}
+ int &x = a; // expected-error{{binding value of type 'const int' to reference of type 'int' drops qualifiers}}
+ int &x2 = a; // expected-error{{binding value of type 'const int' to reference of type 'int' drops qualifiers}}
}();
}();
}();
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp
index 0f2edfb6354..367de4b8a74 100644
--- a/clang/test/Misc/diag-template-diffing.cpp
+++ b/clang/test/Misc/diag-template-diffing.cpp
@@ -1258,7 +1258,7 @@ using T = condition<(is_const())>;
void foo(const T &t) {
T &t2 = t;
}
-// CHECK-ELIDE-NOTREE: binding of reference to type 'condition<[...]>' to a value of type 'const condition<[...]>' drops qualifiers
+// CHECK-ELIDE-NOTREE: binding value of type 'const condition<[...]>' to reference of type 'condition<[...]>' drops qualifiers
}
namespace BoolArgumentBitExtended {
diff --git a/clang/test/SemaCXX/builtins-arm.cpp b/clang/test/SemaCXX/builtins-arm.cpp
index 8a0cf8102b3..683317dbbe6 100644
--- a/clang/test/SemaCXX/builtins-arm.cpp
+++ b/clang/test/SemaCXX/builtins-arm.cpp
@@ -2,5 +2,5 @@
// va_list on ARM AAPCS is struct { void* __ap }.
int test1(const __builtin_va_list &ap) {
- return __builtin_va_arg(ap, int); // expected-error {{binding of reference to type '__builtin_va_list' to a value of type 'const __builtin_va_list' drops qualifiers}}
+ return __builtin_va_arg(ap, int); // expected-error {{binding value of type 'const __builtin_va_list' to reference of type '__builtin_va_list' drops qualifiers}}
}
diff --git a/clang/test/SemaCXX/references.cpp b/clang/test/SemaCXX/references.cpp
index b1768b1a3a4..64d87bd132b 100644
--- a/clang/test/SemaCXX/references.cpp
+++ b/clang/test/SemaCXX/references.cpp
@@ -54,7 +54,7 @@ void test4() {
void test5() {
// const double& rcd2 = 2; // rcd2 refers to temporary with value 2.0
const volatile int cvi = 1;
- const int& r = cvi; // expected-error{{binding of reference to type 'const int' to a value of type 'const volatile int' drops qualifiers}}
+ const int& r = cvi; // expected-error{{binding value of type 'const volatile int' to reference of type 'const int' drops qualifiers}}
}
// C++ [dcl.init.ref]p3
OpenPOWER on IntegriCloud