aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja
diff options
context:
space:
mode:
authorMatthias Kretz <m.kretz@gsi.de>2019-11-06 16:06:08 +0000
committerJason Merrill <jason@gcc.gnu.org>2019-11-06 11:06:08 -0500
commit6394a341d6c4a69d61b29618bf8837002eca580f (patch)
tree9a691b9f60b25f72e388c699df5e8084d40e64d4 /gcc/testsuite/g++.old-deja
parent4b205bf82d06c4d9d0ae7b78e54c712d79d5b021 (diff)
downloadgcc-6394a341d6c4a69d61b29618bf8837002eca580f.zip
gcc-6394a341d6c4a69d61b29618bf8837002eca580f.tar.gz
gcc-6394a341d6c4a69d61b29618bf8837002eca580f.tar.bz2
Fix parser to recognize operator?:
This change lets grok_op_properties print its useful "ISO C++ prohibits overloading operator ?:" message instead of the cryptic error message about a missing type-specifier before '?' token. 2019-11-06 Matthias Kretz <m.kretz@gsi.de> * parser.c (cp_parser_operator): Parse operator?: as an attempt to overload the conditional operator. From-SVN: r277887
Diffstat (limited to 'gcc/testsuite/g++.old-deja')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/operator.C2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/operator.C b/gcc/testsuite/g++.old-deja/g++.jason/operator.C
index c2fc212..69a41cf 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/operator.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/operator.C
@@ -5,7 +5,7 @@
typedef __SIZE_TYPE__ size_t;
struct A {
- int operator?:(int a, int b); // { dg-error "expected type-specifier" }
+ int operator?:(int a, int b); // { dg-error "prohibits overloading" }
static int operator()(int a); // { dg-error "14:.static int A::operator\\(\\)\\(int\\). must be a nonstatic member function" }
static int operator+(A,A); // { dg-error "14:.static int A::operator\\+\\(A, A\\). must be either a non-static member function or a non-member function" }
int operator+(int a, int b = 1); // { dg-error "7:.int A::operator\\+\\(int, int\\). must have either zero or one argument" }