diff options
author | Jason Merrill <jason@redhat.com> | 2014-05-14 12:48:07 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-05-14 12:48:07 -0400 |
commit | d02f620dc0bb3bea393d04b8639a1f4748ad8821 (patch) | |
tree | fa4f8d8bc938c26bfd454f1b030d115993baceb9 /gcc/testsuite/g++.old-deja/g++.law | |
parent | 89606913ce096b28d0a822fedf4a6333468a66cd (diff) | |
download | gcc-d02f620dc0bb3bea393d04b8639a1f4748ad8821.tar.gz |
re PR c++/20332 (poor diagnostic when bind non lvalue to a reference for default arguments)
PR c++/20332
PR c++/21631
* call.c (reference_binding): Treat lvalue/rvalue mismatch and
dropped cv-quals as a bad conversion.
(convert_like_real) [ck_ref_bind]: Explain them.
(compare_ics): Check badness before stripping reference
bindings. Handle comparing bad reference bindings.
* typeck.c (comp_cv_qualification): Add overload that just takes
integers.
* cp-tree.h: Declare it.
From-SVN: r210436
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/cvt20.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/enum4.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/init8.C | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.law/operators9.C | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt20.C b/gcc/testsuite/g++.old-deja/g++.law/cvt20.C index 9389a107ff7..f5c703bccfd 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/cvt20.C +++ b/gcc/testsuite/g++.old-deja/g++.law/cvt20.C @@ -9,7 +9,7 @@ // Compiles fine with Sun CC 2.1 -void f(char *& x) // { dg-message "passing argument" } +void f(const char *& x) // { dg-message "argument" } { x++; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/enum4.C b/gcc/testsuite/g++.old-deja/g++.law/enum4.C index 2c36010107b..363f1149344 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/enum4.C +++ b/gcc/testsuite/g++.old-deja/g++.law/enum4.C @@ -24,6 +24,6 @@ int main() Enum e = enumerator1; Struct s; int x = funct(e+1);// { dg-error "invalid" } - int y = s.getI(e+1);// { dg-error "match|conv" } + int y = s.getI(e+1);// { dg-error "invalid" } return x+y; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/init8.C b/gcc/testsuite/g++.old-deja/g++.law/init8.C index 5ed619b670d..829dd9be5a5 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/init8.C +++ b/gcc/testsuite/g++.old-deja/g++.law/init8.C @@ -8,7 +8,7 @@ const int ic = 1; -void f(int& arg) // { dg-message "passing argument 1" } +void f(int& arg) // { dg-message "argument 1" } { if (arg) ; } @@ -16,7 +16,7 @@ const int& icr = ic; int main(void) { - f(icr); // { dg-error "invalid initialization" } + f(icr); // { dg-error "const" } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators9.C b/gcc/testsuite/g++.old-deja/g++.law/operators9.C index 6c371636acd..8d5b686d9ae 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/operators9.C +++ b/gcc/testsuite/g++.old-deja/g++.law/operators9.C @@ -16,5 +16,5 @@ public: void test(B &b1, const B &b2) { - b1 = b2;// { dg-error "match" } + b1 = b2;// { dg-error "const" } } |