From 24243b5a8ad01d09fff0b26c51e074817f7f1fa7 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 27 Nov 2019 00:00:35 +0000 Subject: [PATCH] typeck.c (cp_build_unary_op): Consistently use the accurate location in seven additional diagnostic messages. /cp 2019-11-26 Paolo Carlini * typeck.c (cp_build_unary_op): Consistently use the accurate location in seven additional diagnostic messages. (cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place. /testsuite 2019-11-26 Paolo Carlini * g++.dg/cpp1z/bool-increment1.C: Test location(s) too. * g++.dg/expr/bitfield3.C: Likewise. * g++.dg/expr/bitfield4.C: Likewise. * g++.dg/expr/bitfield5.C: Likewise. * g++.dg/expr/bitfield6.C: Likewise. * g++.dg/expr/bool1.C: Likewise. * g++.dg/expr/bool2.C: Likewise. * g++.dg/expr/bool3.C: Likewise. * g++.dg/expr/bool4.C: Likewise. * g++.dg/expr/lval3.C: Likewise. * g++.dg/other/error18.C: Likewise. * g++.dg/warn/Wpointer-arith-1.C: Likewise. * g++.old-deja/g++.bugs/900212_01.C: Likewise. * g++.old-deja/g++.bugs/900428_02.C: Likewise. * g++.old-deja/g++.jason/rfg14.C: Likewise. * g++.old-deja/g++.other/overload11.C: Likewise. From-SVN: r278743 --- gcc/cp/ChangeLog | 6 +++ gcc/cp/typeck.c | 47 +++++++++++-------- gcc/testsuite/ChangeLog | 19 ++++++++ gcc/testsuite/g++.dg/cpp1z/bool-increment1.C | 8 ++-- gcc/testsuite/g++.dg/expr/bitfield3.C | 4 +- gcc/testsuite/g++.dg/expr/bitfield4.C | 4 +- gcc/testsuite/g++.dg/expr/bitfield5.C | 4 +- gcc/testsuite/g++.dg/expr/bitfield6.C | 2 +- gcc/testsuite/g++.dg/expr/bool1.C | 8 ++-- gcc/testsuite/g++.dg/expr/bool2.C | 2 +- gcc/testsuite/g++.dg/expr/bool3.C | 8 ++-- gcc/testsuite/g++.dg/expr/bool4.C | 2 +- gcc/testsuite/g++.dg/expr/lval3.C | 2 +- gcc/testsuite/g++.dg/other/error18.C | 2 +- gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C | 4 +- .../g++.old-deja/g++.bugs/900212_01.C | 16 +++---- .../g++.old-deja/g++.bugs/900428_02.C | 16 +++---- gcc/testsuite/g++.old-deja/g++.jason/rfg14.C | 10 ++-- .../g++.old-deja/g++.other/overload11.C | 20 ++++---- 19 files changed, 109 insertions(+), 75 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a7c0bca9e31..9f27a58cc6b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-11-26 Paolo Carlini + + * typeck.c (cp_build_unary_op): Consistently use the accurate + location in seven additional diagnostic messages. + (cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place. + 2019-11-26 Jakub Jelinek PR c++/92648 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index bd2292a4dac..98c428db52e 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6520,7 +6520,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, if (TREE_CODE (argtype) == ENUMERAL_TYPE) { if (complain & tf_error) - permerror (input_location, (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) + permerror (location, (code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR) ? G_("ISO C++ forbids incrementing an enum") : G_("ISO C++ forbids decrementing an enum")); else @@ -6536,22 +6537,26 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, if (!COMPLETE_OR_VOID_TYPE_P (type)) { if (complain & tf_error) - error (((code == PREINCREMENT_EXPR - || code == POSTINCREMENT_EXPR)) - ? G_("cannot increment a pointer to incomplete type %qT") - : G_("cannot decrement a pointer to incomplete type %qT"), - TREE_TYPE (argtype)); + error_at (location, ((code == PREINCREMENT_EXPR + || code == POSTINCREMENT_EXPR)) + ? G_("cannot increment a pointer to incomplete " + "type %qT") + : G_("cannot decrement a pointer to incomplete " + "type %qT"), + TREE_TYPE (argtype)); else return error_mark_node; } else if (!TYPE_PTROB_P (argtype)) { if (complain & tf_error) - pedwarn (input_location, OPT_Wpointer_arith, + pedwarn (location, OPT_Wpointer_arith, (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) - ? G_("ISO C++ forbids incrementing a pointer of type %qT") - : G_("ISO C++ forbids decrementing a pointer of type %qT"), + ? G_("ISO C++ forbids incrementing a pointer " + "of type %qT") + : G_("ISO C++ forbids decrementing a pointer " + "of type %qT"), argtype); else return error_mark_node; @@ -6597,8 +6602,9 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR) { if (complain & tf_error) - error ("use of an operand of type %qT in % " - "is forbidden", boolean_type_node); + error_at (location, + "use of an operand of type %qT in % " + "is forbidden", boolean_type_node); return error_mark_node; } else @@ -6606,16 +6612,18 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, if (cxx_dialect >= cxx17) { if (complain & tf_error) - error ("use of an operand of type %qT in " - "% is forbidden in C++17", - boolean_type_node); + error_at (location, + "use of an operand of type %qT in " + "% is forbidden in C++17", + boolean_type_node); return error_mark_node; } /* Otherwise, [depr.incr.bool] says this is deprecated. */ else - warning (OPT_Wdeprecated, "use of an operand of type %qT " - "in % is deprecated", - boolean_type_node); + warning_at (location, OPT_Wdeprecated, + "use of an operand of type %qT " + "in % is deprecated", + boolean_type_node); } val = boolean_increment (code, arg); } @@ -6646,7 +6654,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, } if (complain & tf_error) - error ("%s", errstring); + error_at (location, "%s", errstring); return error_mark_node; } @@ -7038,7 +7046,8 @@ cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain) if (type_unknown_p (rhs)) { if (complain & tf_error) - error ("no context to resolve type of %qE", rhs); + error_at (cp_expr_loc_or_input_loc (rhs), + "no context to resolve type of %qE", rhs); return error_mark_node; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4dd9b7fdb88..1b56973b06e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,22 @@ +2019-11-26 Paolo Carlini + + * g++.dg/cpp1z/bool-increment1.C: Test location(s) too. + * g++.dg/expr/bitfield3.C: Likewise. + * g++.dg/expr/bitfield4.C: Likewise. + * g++.dg/expr/bitfield5.C: Likewise. + * g++.dg/expr/bitfield6.C: Likewise. + * g++.dg/expr/bool1.C: Likewise. + * g++.dg/expr/bool2.C: Likewise. + * g++.dg/expr/bool3.C: Likewise. + * g++.dg/expr/bool4.C: Likewise. + * g++.dg/expr/lval3.C: Likewise. + * g++.dg/other/error18.C: Likewise. + * g++.dg/warn/Wpointer-arith-1.C: Likewise. + * g++.old-deja/g++.bugs/900212_01.C: Likewise. + * g++.old-deja/g++.bugs/900428_02.C: Likewise. + * g++.old-deja/g++.jason/rfg14.C: Likewise. + * g++.old-deja/g++.other/overload11.C: Likewise. + 2019-11-26 Martin Sebor PR tree-optimization/92683 diff --git a/gcc/testsuite/g++.dg/cpp1z/bool-increment1.C b/gcc/testsuite/g++.dg/cpp1z/bool-increment1.C index 0355dc879a6..3ef713595f1 100644 --- a/gcc/testsuite/g++.dg/cpp1z/bool-increment1.C +++ b/gcc/testsuite/g++.dg/cpp1z/bool-increment1.C @@ -5,10 +5,10 @@ fn (bool b) { int r = 0; - r += b++; // { dg-error "use of an operand of type .bool. in .operator\\+\\+. is forbidden in" } - r += ++b; // { dg-error "use of an operand of type .bool. in .operator\\+\\+. is forbidden in" } - r += b--; // { dg-error "use of an operand of type .bool. in .operator--. is forbidden" } - r += --b; // { dg-error "use of an operand of type .bool. in .operator--. is forbidden" } + r += b++; // { dg-error "8:use of an operand of type .bool. in .operator\\+\\+. is forbidden in" } + r += ++b; // { dg-error "10:use of an operand of type .bool. in .operator\\+\\+. is forbidden in" } + r += b--; // { dg-error "8:use of an operand of type .bool. in .operator--. is forbidden" } + r += --b; // { dg-error "10:use of an operand of type .bool. in .operator--. is forbidden" } return r; } diff --git a/gcc/testsuite/g++.dg/expr/bitfield3.C b/gcc/testsuite/g++.dg/expr/bitfield3.C index 3f30337c2db..ba4c5fac81d 100644 --- a/gcc/testsuite/g++.dg/expr/bitfield3.C +++ b/gcc/testsuite/g++.dg/expr/bitfield3.C @@ -7,6 +7,6 @@ struct S { S s; void f() { - s.x--; // { dg-error "use of an operand of type .bool." } - --s.x; // { dg-error "use of an operand of type .bool." } + s.x--; // { dg-error "5:use of an operand of type .bool." } + --s.x; // { dg-error "7:use of an operand of type .bool." } } diff --git a/gcc/testsuite/g++.dg/expr/bitfield4.C b/gcc/testsuite/g++.dg/expr/bitfield4.C index 2b1d1fee945..7b27b724785 100644 --- a/gcc/testsuite/g++.dg/expr/bitfield4.C +++ b/gcc/testsuite/g++.dg/expr/bitfield4.C @@ -14,8 +14,8 @@ template <> void f(bool) {} int main() { - f(s.x++); // { dg-warning "deprecated" "" { target { ! c++17 } } } + f(s.x++); // { dg-warning "7:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } // { dg-error "forbidden" "" { target c++17 } .-1 } - f(++s.x); // { dg-warning "deprecated" "" { target { ! c++17 } } } + f(++s.x); // { dg-warning "9:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } // { dg-error "forbidden" "" { target c++17 } .-1 } } diff --git a/gcc/testsuite/g++.dg/expr/bitfield5.C b/gcc/testsuite/g++.dg/expr/bitfield5.C index 1921b193d21..fe7a0770078 100644 --- a/gcc/testsuite/g++.dg/expr/bitfield5.C +++ b/gcc/testsuite/g++.dg/expr/bitfield5.C @@ -9,11 +9,11 @@ struct S { S s; int main() { - s.x++; // { dg-warning "deprecated" "" { target { ! c++17 } } } + s.x++; // { dg-warning "5:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } // { dg-error "forbidden" "" { target c++17 } .-1 } if (s.x != 1) return 1; - ++s.x; // { dg-warning "deprecated" "" { target { ! c++17 } } } + ++s.x; // { dg-warning "7:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } // { dg-error "forbidden" "" { target c++17 } .-1 } if (s.x != 1) return 2; diff --git a/gcc/testsuite/g++.dg/expr/bitfield6.C b/gcc/testsuite/g++.dg/expr/bitfield6.C index b417310e2cf..5a778f94983 100644 --- a/gcc/testsuite/g++.dg/expr/bitfield6.C +++ b/gcc/testsuite/g++.dg/expr/bitfield6.C @@ -7,6 +7,6 @@ struct S { S s; void f() { - ++s.x = false; // { dg-warning "deprecated" "" { target { ! c++17 } } } + ++s.x = false; // { dg-warning "7:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } // { dg-error "forbidden" "" { target c++17 } .-1 } } diff --git a/gcc/testsuite/g++.dg/expr/bool1.C b/gcc/testsuite/g++.dg/expr/bool1.C index 7b120e17739..91a7cd8127b 100644 --- a/gcc/testsuite/g++.dg/expr/bool1.C +++ b/gcc/testsuite/g++.dg/expr/bool1.C @@ -11,10 +11,10 @@ int main() my_bool b = false; int i; - b++; // { dg-warning "deprecated" "" { target { ! c++17 } } } - // { dg-error "forbidden" "" { target c++17 } .-1 } - b++; // { dg-warning "deprecated" "" { target { ! c++17 } } } - // { dg-error "forbidden" "" { target c++17 } .-1 } + b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } + // { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 } + b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } + // { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 } i = b; if (i != 1) abort (); diff --git a/gcc/testsuite/g++.dg/expr/bool2.C b/gcc/testsuite/g++.dg/expr/bool2.C index 39d93c0af9d..662c495d8ce 100644 --- a/gcc/testsuite/g++.dg/expr/bool2.C +++ b/gcc/testsuite/g++.dg/expr/bool2.C @@ -7,7 +7,7 @@ typedef bool my_bool; int main() { my_bool b = false; - b--; // { dg-error "" } + b--; // { dg-error "3:use of an operand of type .bool. in .operator\\-\\-. is forbidden" } return 0; } diff --git a/gcc/testsuite/g++.dg/expr/bool3.C b/gcc/testsuite/g++.dg/expr/bool3.C index f27399cfc8a..311b2f5512d 100644 --- a/gcc/testsuite/g++.dg/expr/bool3.C +++ b/gcc/testsuite/g++.dg/expr/bool3.C @@ -11,11 +11,11 @@ int main() my_bool b = false; int i; - b++; // { dg-warning "deprecated" "" { target { ! c++17 } } } - // { dg-error "forbidden" "" { target c++17 } .-1 } + b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } + // { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 } // { dg-warning ".volatile.-qualified type is deprecated" "" { target c++2a } .-2 } - b++; // { dg-warning "deprecated" "" { target { ! c++17 } } } - // { dg-error "forbidden" "" { target c++17 } .-1 } + b++; // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } } + // { dg-error "3:use of an operand of type .bool. in .operator\\+\\+. is forbidden" "" { target c++17 } .-1 } // { dg-warning ".volatile.-qualified type is deprecated" "" { target c++2a } .-2 } i = b; if (i != 1) diff --git a/gcc/testsuite/g++.dg/expr/bool4.C b/gcc/testsuite/g++.dg/expr/bool4.C index 5891bc311bd..1c43acf61be 100644 --- a/gcc/testsuite/g++.dg/expr/bool4.C +++ b/gcc/testsuite/g++.dg/expr/bool4.C @@ -7,7 +7,7 @@ typedef volatile bool my_bool; int main() { my_bool b = false; - b--; // { dg-error "" } + b--; // { dg-error "3:use of an operand of type .bool. in .operator\\-\\-. is forbidden" } // { dg-warning ".volatile.-qualified type is deprecated" "" { target c++2a } .-1 } return 0; } diff --git a/gcc/testsuite/g++.dg/expr/lval3.C b/gcc/testsuite/g++.dg/expr/lval3.C index fd79c8c8a39..b4a9e6d7e73 100644 --- a/gcc/testsuite/g++.dg/expr/lval3.C +++ b/gcc/testsuite/g++.dg/expr/lval3.C @@ -4,5 +4,5 @@ f() { bool i = 0; i++ = 3; // { dg-error "" } - // { dg-warning "deprecated" "" { target { ! c++17 } } .-1 } + // { dg-warning "3:use of an operand of type .bool. in .operator\\+\\+. is deprecated" "" { target { ! c++17 } } .-1 } } diff --git a/gcc/testsuite/g++.dg/other/error18.C b/gcc/testsuite/g++.dg/other/error18.C index 05ddf116675..c613e9afd0d 100644 --- a/gcc/testsuite/g++.dg/other/error18.C +++ b/gcc/testsuite/g++.dg/other/error18.C @@ -7,5 +7,5 @@ struct A void f(A a) { - a.b--; // { dg-error "use of an operand of type .bool." } + a.b--; // { dg-error "5:use of an operand of type .bool." } } diff --git a/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C b/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C index a4aa6960897..1e031f9d732 100644 --- a/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C +++ b/gcc/testsuite/g++.dg/warn/Wpointer-arith-1.C @@ -4,10 +4,10 @@ int main() { void *pv = 0; - pv++; // { dg-warning "forbids incrementing a pointer" } + pv++; // { dg-warning "3:ISO C\\+\\+ forbids incrementing a pointer" } typedef void (*pft) (); pft pf = 0; - pf++; // { dg-warning "forbids incrementing a pointer" } + pf++; // { dg-warning "3:ISO C\\+\\+ forbids incrementing a pointer" } } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C index 8c3349f9424..9e61c1fdfcd 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900212_01.C @@ -23,17 +23,17 @@ void global_function_0 () { p0 = p1 + 3; // { dg-error "" } p0 = p1 - 3; // { dg-error "" } - p1++; /* { dg-error "" } caught by g++ */ - ++p1; /* { dg-error "" } caught by g++ */ - p1--; /* { dg-error "" } caught by g++ */ - --p1; /* { dg-error "" } caught by g++ */ + p1++; /* { dg-error "3:no post-increment" } caught by g++ */ + ++p1; /* { dg-error "5:no pre-increment" } caught by g++ */ + p1--; /* { dg-error "3:no post-decrement" } caught by g++ */ + --p1; /* { dg-error "5:no pre-decrement" } caught by g++ */ fp0 = fp1 + 3; // { dg-error "" } fp0 = fp1 - 3; // { dg-error "" } - fp1++; /* { dg-error "" } */ - ++fp1; /* { dg-error "" } */ - fp1--; /* { dg-error "" } */ - --fp1; /* { dg-error "" } */ + fp1++; /* { dg-error "3:no post-increment" } */ + ++fp1; /* { dg-error "5:no pre-increment" } */ + fp1--; /* { dg-error "3:no post-decrement" } */ + --fp1; /* { dg-error "5:no pre-decrement" } */ } int main () { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C b/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C index 4846a8113cc..be4e43a2826 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900428_02.C @@ -15,13 +15,13 @@ void (*fp) (); void test () { - vp++; /* { dg-error "" } */ - ++vp; /* { dg-error "" } */ - vp--; /* { dg-error "" } */ - --vp; /* { dg-error "" } */ + vp++; /* { dg-error "3:ISO C\\+\\+ forbids incrementing" } */ + ++vp; /* { dg-error "5:ISO C\\+\\+ forbids incrementing" } */ + vp--; /* { dg-error "3:ISO C\\+\\+ forbids decrementing" } */ + --vp; /* { dg-error "5:ISO C\\+\\+ forbids decrementing" } */ - fp++; /* { dg-error "" } */ - ++fp; /* { dg-error "" } */ - fp--; /* { dg-error "" } */ - --fp; /* { dg-error "" } */ + fp++; /* { dg-error "3:ISO C\\+\\+ forbids incrementing" } */ + ++fp; /* { dg-error "5:ISO C\\+\\+ forbids incrementing" } */ + fp--; /* { dg-error "3:ISO C\\+\\+ forbids decrementing" } */ + --fp; /* { dg-error "5:ISO C\\+\\+ forbids decrementing" } */ } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rfg14.C b/gcc/testsuite/g++.old-deja/g++.jason/rfg14.C index 85a346afecc..4bc0990f33d 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/rfg14.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/rfg14.C @@ -8,9 +8,9 @@ int (*fp)(); void test () { - vp++; /* { dg-error "" } incrementing void * */ - ap++; /* { dg-error "" } incrementing ptr to incomplete type */ - sp++; /* { dg-error "" } incrementing ptr to incomplete type */ - up++; /* { dg-error "" } incrementing ptr to incomplete type */ - fp++; /* { dg-error "" } incrementing ptr to function */ + vp++; /* { dg-error "5:ISO C\\+\\+ forbids incrementing" } incrementing void * */ + ap++; /* { dg-error "5:cannot increment" } incrementing ptr to incomplete type */ + sp++; /* { dg-error "5:cannot increment" } incrementing ptr to incomplete type */ + up++; /* { dg-error "5:cannot increment" } incrementing ptr to incomplete type */ + fp++; /* { dg-error "5:ISO C\\+\\+ forbids incrementing" } incrementing ptr to function */ } diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload11.C b/gcc/testsuite/g++.old-deja/g++.other/overload11.C index 9b5b44bd32d..c191b339f31 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/overload11.C +++ b/gcc/testsuite/g++.old-deja/g++.other/overload11.C @@ -38,8 +38,8 @@ int main (int argc, char **argv) // 13.3.1.1 indicates that the following are errors -- the primary expression // is not the name of a function. - (0, ovl) (1); // { dg-error "" } not suitable for overload resolution - (0, &ovl) (1); // { dg-error "" } not suitable for overload resolution + (0, ovl) (1); // { dg-error "7:no context" } not suitable for overload resolution + (0, &ovl) (1); // { dg-error "7:no context" } not suitable for overload resolution (argc ? ovl : ovl) (1); // { dg-error "" } not suitable for overload resolution (argc ? &ovl : &ovl) (1); // { dg-error "" } not suitable for overload resolution @@ -52,15 +52,15 @@ int main (int argc, char **argv) ptr = (ovl); // ok ptr = (&ovl); // ok - ptr = (0, ovl); // ok { dg-error "no context" } - ptr = (0, &ovl); // ok { dg-error "no context" } + ptr = (0, ovl); // ok { dg-error "13:no context" } + ptr = (0, &ovl); // ok { dg-error "13:no context" } ptr = (argc ? ovl : ovl); // ok { dg-error "no context" } ptr = (argc ? &ovl : &ovl);// ok { dg-error "no context" } vptr = (ovl); // { dg-error "" } no matching candidates vptr = (&ovl); // { dg-error "" } no matching candidates - vptr = (0, ovl); // { dg-error "" } no matching candidates - vptr = (0, &ovl); // { dg-error "" } no matching candidates + vptr = (0, ovl); // { dg-error "14:no context" } no matching candidates + vptr = (0, &ovl); // { dg-error "14:no context" } no matching candidates vptr = (argc ? ovl : ovl); // { dg-error "" } no matching candidates vptr = (argc ? &ovl : &ovl);// { dg-error "" } no matching candidates @@ -81,11 +81,11 @@ int main (int argc, char **argv) static_cast(ovl); // { dg-error "" } not suitable for overload static_cast(&ovl); // { dg-error "" } not suitable for overload ((void)1, f); // { dg-warning "" "" { xfail *-*-* } } not a call - ((void)1, ovl); // { dg-error "" } not suitable for overload - ((void)1, &ovl); // { dg-error "" } not suitable for overload + ((void)1, ovl); // { dg-error "13:no context" } not suitable for overload + ((void)1, &ovl); // { dg-error "13:no context" } not suitable for overload (void)((void)1, f); // ok - (void)((void)1, ovl); // { dg-error "" } not suitable for overload - (void)((void)1, &ovl); // { dg-error "" } not suitable for overload + (void)((void)1, ovl); // { dg-error "19:no context" } not suitable for overload + (void)((void)1, &ovl); // { dg-error "19:no context" } not suitable for overload return 0; } -- 2.30.2