From patchwork Fri Nov 22 10:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 1199404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514387-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bSv58mmn"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="ZkozeZLT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47KCjD4tNWz9sTR for ; Fri, 22 Nov 2019 21:44:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=WBG2Fd/KKma1GS5dIh8hV8GK5wBHFQlV3XxEDSsw8hYMCnu6AW bQnKhf7VoS4tUkpwHInR4cxL9JpMwYNg7N5mf9MeQPNgk+WTQoqCcbbAZXGwaeC+ nPCkVkAQrC2LBqFV7WMUCvjZ7LSjK09amYbVZNrFd40A9DnaHvWHDhWWI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=aJFJBUUj4jxEcUtlcmVrDxzLgWg=; b=bSv58mmn8TfWv0hScDkx yf+c028/nQpVtEHyoABvd7hg2N6OJ79p50ese922A9geUv2MKLeA5oZD5VhwAj7x bcGySrrhoFHVEpFuQJhNrUp6mC2SDZuUwRfYpN1iSn5ExFKH+VSlqsdY7Oy0YM6G AHI/P6wgkogtC+iM7PAnTqI= Received: (qmail 85978 invoked by alias); 22 Nov 2019 10:44:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 85968 invoked by uid 89); 22 Nov 2019 10:44:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=mesh, 65, 85, sk:pointer X-HELO: userp2130.oracle.com Received: from userp2130.oracle.com (HELO userp2130.oracle.com) (156.151.31.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Nov 2019 10:44:02 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAMAcajF128944; Fri, 22 Nov 2019 10:44:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : from : subject : message-id : date : mime-version : content-type; s=corp-2019-08-05; bh=K+4NEAbR5Mht6ETmwOWtcYikKBVIT+45zjcxGAErt74=; b=ZkozeZLTbXzldi7jH0SjQL75tCpDW/KlVg4MZgqg4lKNk+9/BWqgsPn6Wdrlr3hpqDKu Qlez0ULOr4UhLng8pIKdSIIWU6gi0JLb+xKHgU306+FVn5of1QlRVpOhG09KB6+s1Ev7 ZNsENYmTrEaQYCmYpbs/1Eb3b+WR8JlNL/wdXOFJyTIA0mBJyqg4fzhj8e2U4UoM2hu8 z9sVqgib3np6A1zEy9aZvBbXoDOoPFQR1didg0nivdpIgvmRnxJ5ERzEFC0MARY05pBF /L7jn7+JuCugpUkPnE9DZhkJfqMrEmVYcXWVoyEeh9LlDl1aKZgkk2D7W3sxAXjnd5pS KQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2wa8hu9vex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 10:43:59 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xAMAcmg7060885; Fri, 22 Nov 2019 10:43:59 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2we6g6vmnp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Nov 2019 10:43:59 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xAMAhwVm032541; Fri, 22 Nov 2019 10:43:58 GMT Received: from [192.168.1.4] (/79.26.212.60) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Nov 2019 02:43:57 -0800 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] Improve build_new_op_1, cp_build_indirect_ref_1, and cp_build_modify_expr locations Message-ID: <2381c9c1-74ef-55db-8c42-b8aa383d7e6c@oracle.com> Date: Fri, 22 Nov 2019 11:43:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi, I would say most of the changes are straightforward or mechanical. Essentially, for build_new_op_1 and cp_build_modify_expr I'm simply consistently using the available location argument; for cp_build_indirect_ref_1 I'm adding the parameter but then using it in a completely straightforward way. Minor nit: I wondered for a while if cp_build_modify_expr should use cp_expr_loc_or_loc more - normally the passed loc points to the '=' - but eventually, given the actual texts of the messages, I used it only in one place, for "void value not ignored as it ought to be" which is mostly about the type of 'rhs'. All the other messages in one way or the other talk about both sides (the primary clang caret appears to agree). Tested x86_64-linux. Thanks, Paolo. ////////////////////////////// /gcc 2019-11-20 Paolo Carlini * typeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error messages. (build_x_indirect_ref): Adjust call. (build_indirect_ref): Likewise. (cp_build_fold_indirect_ref): Likewise. (cp_build_array_ref): Likewise. * call.c (build_new_op_1): Likewise. * semantics.c (finish_omp_clauses): Likewise. (finish_omp_depobj): Likewise. * typeck2.c (build_x_arrow): Likewise. * cp-tree.h (cp_build_indirect_ref): Update declaration. * call.c (build_new_op_1): Use location argument in warning_at. * typeck.c (cp_build_modify_expr): Consistently use the location_t argument. /libcc1 2019-11-20 Paolo Carlini * libcp1plugin.cc (plugin_pragma_push_user_expression): Update cp_build_indirect_ref call. /testsuite 2019-11-20 Paolo Carlini * g++.dg/diagnostic/base-operand-non-pointer-1.C: New. * g++.dg/pr53055.C: Check location too. * g++.old-deja/g++.bugs/900213_02.C: Likewise. * g++.old-deja/g++.bugs/900215_02.C: Likewise. * g++.old-deja/g++.other/badarrow.C: Likewise. * g++.old-deja/g++.other/deref1.C: Likewise. * g++.dg/warn/Wenum-compare.C: Check location too. * g++.dg/cpp0x/initlist26.C: Check location too. * g++.dg/cpp0x/initlist28.C: Likewise. * g++.dg/cpp0x/initlist29.C: Likewise. * g++.dg/cpp0x/initlist33.C: Likewise. * g++.dg/expr/string-2.C: Likewise. * g++.dg/other/ptrmem5.C: Likewise. * g++.old-deja/g++.benjamin/14664-1.C: Likewise. * g++.old-deja/g++.benjamin/14664-2.C: Likewise. * g++.old-deja/g++.brendan/init12.C: Likewise. * g++.old-deja/g++.bugs/900324_04.C: Likewise. * g++.old-deja/g++.ext/array1.C: Likewise. * g++.old-deja/g++.jason/rfg17.C: Likewise. Index: cp/call.c =================================================================== --- cp/call.c (revision 278549) +++ cp/call.c (working copy) @@ -6354,11 +6354,9 @@ build_new_op_1 (const op_location_t &loc, enum tre && (TYPE_MAIN_VARIANT (arg1_type) != TYPE_MAIN_VARIANT (arg2_type)) && (complain & tf_warning)) - { - warning (OPT_Wenum_compare, - "comparison between %q#T and %q#T", - arg1_type, arg2_type); - } + warning_at (loc, OPT_Wenum_compare, + "comparison between %q#T and %q#T", + arg1_type, arg2_type); break; default: break; @@ -6416,7 +6414,7 @@ build_new_op_1 (const op_location_t &loc, enum tre return cp_build_modify_expr (loc, arg1, code2, arg2, complain); case INDIRECT_REF: - return cp_build_indirect_ref (arg1, RO_UNARY_STAR, complain); + return cp_build_indirect_ref (loc, arg1, RO_UNARY_STAR, complain); case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: @@ -6472,8 +6470,9 @@ build_new_op_1 (const op_location_t &loc, enum tre return cp_build_array_ref (input_location, arg1, arg2, complain); case MEMBER_REF: - return build_m_component_ref (cp_build_indirect_ref (arg1, RO_ARROW_STAR, - complain), + return build_m_component_ref (cp_build_indirect_ref (loc, arg1, + RO_ARROW_STAR, + complain), arg2, complain); /* The caller will deal with these. */ Index: cp/cp-tree.h =================================================================== --- cp/cp-tree.h (revision 278549) +++ cp/cp-tree.h (working copy) @@ -7482,9 +7482,11 @@ extern tree build_class_member_access_expr (c extern tree finish_class_member_access_expr (cp_expr, tree, bool, tsubst_flags_t); extern tree build_x_indirect_ref (location_t, tree, - ref_operator, tsubst_flags_t); -extern tree cp_build_indirect_ref (tree, ref_operator, - tsubst_flags_t); + ref_operator, + tsubst_flags_t); +extern tree cp_build_indirect_ref (location_t, tree, + ref_operator, + tsubst_flags_t); extern tree cp_build_fold_indirect_ref (tree); extern tree build_array_ref (location_t, tree, tree); extern tree cp_build_array_ref (location_t, tree, tree, Index: cp/semantics.c =================================================================== --- cp/semantics.c (revision 278549) +++ cp/semantics.c (working copy) @@ -7193,7 +7193,8 @@ finish_omp_clauses (tree clauses, enum c_omp_regio remove = true; else { - t = cp_build_indirect_ref (addr, RO_UNARY_STAR, + t = cp_build_indirect_ref (OMP_CLAUSE_LOCATION (c), + addr, RO_UNARY_STAR, tf_warning_or_error); if (t == error_mark_node) remove = true; @@ -9328,7 +9329,7 @@ finish_omp_depobj (location_t loc, tree depobj, if (addr == error_mark_node) depobj = error_mark_node; else - depobj = cp_build_indirect_ref (addr, RO_UNARY_STAR, + depobj = cp_build_indirect_ref (loc, addr, RO_UNARY_STAR, tf_warning_or_error); } Index: cp/typeck.c =================================================================== --- cp/typeck.c (revision 278549) +++ cp/typeck.c (working copy) @@ -3278,7 +3278,7 @@ build_x_indirect_ref (location_t loc, tree expr, r rval = build_new_op (loc, INDIRECT_REF, LOOKUP_NORMAL, expr, NULL_TREE, NULL_TREE, &overload, complain); if (!rval) - rval = cp_build_indirect_ref (expr, errorstring, complain); + rval = cp_build_indirect_ref (loc, expr, errorstring, complain); if (processing_template_decl && rval != error_mark_node) { @@ -3296,7 +3296,7 @@ build_x_indirect_ref (location_t loc, tree expr, r constructs. If DO_FOLD is true, fold away INDIRECT_REF of ADDR_EXPR. */ static tree -cp_build_indirect_ref_1 (tree ptr, ref_operator errorstring, +cp_build_indirect_ref_1 (location_t loc, tree ptr, ref_operator errorstring, tsubst_flags_t complain, bool do_fold) { tree pointer, type; @@ -3345,7 +3345,7 @@ static tree /* A pointer to incomplete type (other than cv void) can be dereferenced [expr.unary.op]/1 */ if (complain & tf_error) - error ("%qT is not a pointer-to-object type", type); + error_at (loc, "%qT is not a pointer-to-object type", type); return error_mark_node; } else if (do_fold && TREE_CODE (pointer) == ADDR_EXPR @@ -3376,23 +3376,25 @@ static tree switch (errorstring) { case RO_ARRAY_INDEXING: - error ("invalid use of array indexing on pointer to member"); + error_at (loc, + "invalid use of array indexing on pointer to member"); break; case RO_UNARY_STAR: - error ("invalid use of unary %<*%> on pointer to member"); + error_at (loc, "invalid use of unary %<*%> on pointer to member"); break; case RO_IMPLICIT_CONVERSION: - error ("invalid use of implicit conversion on pointer to member"); + error_at (loc, "invalid use of implicit conversion on pointer " + "to member"); break; case RO_ARROW_STAR: - error ("left hand operand of %<->*%> must be a pointer to class, " - "but is a pointer to member of type %qT", type); + error_at (loc, "left hand operand of %<->*%> must be a pointer to " + "class, but is a pointer to member of type %qT", type); break; default: gcc_unreachable (); } else if (pointer != error_mark_node) - invalid_indirection_error (input_location, type, errorstring); + invalid_indirection_error (loc, type, errorstring); return error_mark_node; } @@ -3400,10 +3402,10 @@ static tree /* Entry point used by c-common, which expects folding. */ tree -build_indirect_ref (location_t /*loc*/, - tree ptr, ref_operator errorstring) +build_indirect_ref (location_t loc, tree ptr, ref_operator errorstring) { - return cp_build_indirect_ref_1 (ptr, errorstring, tf_warning_or_error, true); + return cp_build_indirect_ref_1 (loc, ptr, errorstring, + tf_warning_or_error, true); } /* Entry point used by internal indirection needs that don't correspond to any @@ -3412,7 +3414,8 @@ tree tree cp_build_fold_indirect_ref (tree pointer) { - return cp_build_indirect_ref_1 (pointer, RO_NULL, tf_warning_or_error, true); + return cp_build_indirect_ref_1 (input_location, pointer, RO_NULL, + tf_warning_or_error, true); } /* Entry point used by indirection needs that correspond to some syntactic @@ -3419,10 +3422,10 @@ cp_build_fold_indirect_ref (tree pointer) construct. */ tree -cp_build_indirect_ref (tree ptr, ref_operator errorstring, +cp_build_indirect_ref (location_t loc, tree ptr, ref_operator errorstring, tsubst_flags_t complain) { - return cp_build_indirect_ref_1 (ptr, errorstring, complain, false); + return cp_build_indirect_ref_1 (loc, ptr, errorstring, complain, false); } /* This handles expressions of the form "a[i]", which denotes @@ -3599,7 +3602,7 @@ cp_build_array_ref (location_t loc, tree array, tr ret = cp_build_binary_op (input_location, PLUS_EXPR, ar, ind, complain); if (first) ret = build2_loc (loc, COMPOUND_EXPR, TREE_TYPE (ret), first, ret); - ret = cp_build_indirect_ref (ret, RO_ARRAY_INDEXING, complain); + ret = cp_build_indirect_ref (loc, ret, RO_ARRAY_INDEXING, complain); protected_set_expr_location (ret, loc); if (non_lvalue) ret = non_lvalue_loc (loc, ret); @@ -8280,7 +8283,8 @@ cp_build_modify_expr (location_t loc, tree lhs, en if (VOID_TYPE_P (TREE_TYPE (rhs))) { if (complain & tf_error) - error ("void value not ignored as it ought to be"); + error_at (cp_expr_loc_or_loc (rhs, loc), + "void value not ignored as it ought to be"); return error_mark_node; } @@ -8493,7 +8497,8 @@ cp_build_modify_expr (location_t loc, tree lhs, en if (modifycode != INIT_EXPR) { if (complain & tf_error) - error ("assigning to an array from an initializer list"); + error_at (loc, + "assigning to an array from an initializer list"); return error_mark_node; } if (check_array_initializer (lhs, lhstype, newrhs)) @@ -8520,8 +8525,8 @@ cp_build_modify_expr (location_t loc, tree lhs, en TYPE_MAIN_VARIANT (TREE_TYPE (newrhs)))) { if (complain & tf_error) - error ("incompatible types in assignment of %qT to %qT", - TREE_TYPE (rhs), lhstype); + error_at (loc, "incompatible types in assignment of %qT to %qT", + TREE_TYPE (rhs), lhstype); return error_mark_node; } @@ -8534,9 +8539,9 @@ cp_build_modify_expr (location_t loc, tree lhs, en if (complain & tf_error) { if (modifycode == INIT_EXPR) - error ("array used as initializer"); + error_at (loc, "array used as initializer"); else - error ("invalid array assignment"); + error_at (loc, "invalid array assignment"); } return error_mark_node; } Index: cp/typeck2.c =================================================================== --- cp/typeck2.c (revision 278549) +++ cp/typeck2.c (working copy) @@ -2060,7 +2060,7 @@ build_x_arrow (location_t loc, tree expr, tsubst_f return expr; } - return cp_build_indirect_ref (last_rval, RO_ARROW, complain); + return cp_build_indirect_ref (loc, last_rval, RO_ARROW, complain); } if (complain & tf_error) Index: testsuite/g++.dg/cpp0x/initlist26.C =================================================================== --- testsuite/g++.dg/cpp0x/initlist26.C (revision 278549) +++ testsuite/g++.dg/cpp0x/initlist26.C (working copy) @@ -6,5 +6,5 @@ void foo (int i) { int a[i]; - a = { }; // { dg-error "assign" } + a = { }; // { dg-error "5:assigning to an array from an initializer list" } } Index: testsuite/g++.dg/cpp0x/initlist28.C =================================================================== --- testsuite/g++.dg/cpp0x/initlist28.C (revision 278549) +++ testsuite/g++.dg/cpp0x/initlist28.C (working copy) @@ -4,5 +4,5 @@ void foo() { int a[1]; - throw a = {}; // { dg-error "assign" } + throw a = {}; // { dg-error "11:assigning to an array from an initializer list" } } Index: testsuite/g++.dg/cpp0x/initlist29.C =================================================================== --- testsuite/g++.dg/cpp0x/initlist29.C (revision 278549) +++ testsuite/g++.dg/cpp0x/initlist29.C (working copy) @@ -5,7 +5,7 @@ class Mesh { public: Mesh(const char*) - { typele={0}; } // { dg-error "" } + { typele={0}; } // { dg-error "11:assigning to an array from an initializer list" } private: int typele[7][2]; Index: testsuite/g++.dg/cpp0x/initlist33.C =================================================================== --- testsuite/g++.dg/cpp0x/initlist33.C (revision 278549) +++ testsuite/g++.dg/cpp0x/initlist33.C (working copy) @@ -9,5 +9,5 @@ struct base int main() { base ptr_array[1]; - ptr_array = { base() }; // { dg-error "assign" } + ptr_array = { base() }; // { dg-error "12:assigning to an array from an initializer list" } } Index: testsuite/g++.dg/diagnostic/base-operand-non-pointer-1.C =================================================================== --- testsuite/g++.dg/diagnostic/base-operand-non-pointer-1.C (nonexistent) +++ testsuite/g++.dg/diagnostic/base-operand-non-pointer-1.C (working copy) @@ -0,0 +1,2 @@ +class C { public: C f(); int get(); }; +int f(C* p) { return p->f()->get(); } // { dg-error "28:base operand of .->. has non-pointer type .C." } Index: testsuite/g++.dg/expr/string-2.C =================================================================== --- testsuite/g++.dg/expr/string-2.C (revision 278549) +++ testsuite/g++.dg/expr/string-2.C (working copy) @@ -3,7 +3,7 @@ char a[1]; -int foo(a = "") // { dg-error "invalid array assignment" } +int foo(a = "") // { dg-error "11:invalid array assignment" } { return 0; } Index: testsuite/g++.dg/other/ptrmem5.C =================================================================== --- testsuite/g++.dg/other/ptrmem5.C (revision 278549) +++ testsuite/g++.dg/other/ptrmem5.C (working copy) @@ -8,5 +8,5 @@ struct a int main() { int a::*n[8]; - n = &a::x; // { dg-error "int \\(a::\\*\\)" } + n = &a::x; // { dg-error "5:incompatible types in assignment of .int \\(a::\\*\\)" } } Index: testsuite/g++.dg/pr53055.C =================================================================== --- testsuite/g++.dg/pr53055.C (revision 278549) +++ testsuite/g++.dg/pr53055.C (working copy) @@ -2,4 +2,4 @@ // { dg-do compile } struct A A :: * p ; -int i = p ->* p ; // { dg-error "" } +int i = p ->* p ; // { dg-error "11:left hand operand" } Index: testsuite/g++.dg/warn/Wenum-compare.C =================================================================== --- testsuite/g++.dg/warn/Wenum-compare.C (revision 278549) +++ testsuite/g++.dg/warn/Wenum-compare.C (working copy) @@ -6,5 +6,5 @@ enum E2 { b }; int foo (E1 e1, E2 e2) { - return e1 == e2; /* { dg-warning "comparison between" } */ + return e1 == e2; /* { dg-warning "13:comparison between" } */ } Index: testsuite/g++.old-deja/g++.benjamin/14664-1.C =================================================================== --- testsuite/g++.old-deja/g++.benjamin/14664-1.C (revision 278549) +++ testsuite/g++.old-deja/g++.benjamin/14664-1.C (working copy) @@ -8,7 +8,7 @@ void bar() { //-g++: incompatible types in assignment of 'const char[]' to 'char[]' //-edg: expression must be a modifiable lvalue - foo = "0123456789012345678901234"; // { dg-error "" } // ERROR - + foo = "0123456789012345678901234"; // { dg-error "7:invalid array assignment" } // ERROR - } Index: testsuite/g++.old-deja/g++.benjamin/14664-2.C =================================================================== --- testsuite/g++.old-deja/g++.benjamin/14664-2.C (revision 278549) +++ testsuite/g++.old-deja/g++.benjamin/14664-2.C (working copy) @@ -7,7 +7,7 @@ char foo[26]; void bar() { - foo = "0123456789012345678901234"; // { dg-error "array" } + foo = "0123456789012345678901234"; // { dg-error "7:invalid array assignment" } } Index: testsuite/g++.old-deja/g++.brendan/init12.C =================================================================== --- testsuite/g++.old-deja/g++.brendan/init12.C (revision 278549) +++ testsuite/g++.old-deja/g++.brendan/init12.C (working copy) @@ -5,5 +5,5 @@ char * bob(); int main() { char a[1][2]; - a[0] = bob();// { dg-error "" } .* + a[0] = bob();// { dg-error "10:incompatible types in assignment" } .* } Index: testsuite/g++.old-deja/g++.bugs/900213_02.C =================================================================== --- testsuite/g++.old-deja/g++.bugs/900213_02.C (revision 278549) +++ testsuite/g++.old-deja/g++.bugs/900213_02.C (working copy) @@ -16,7 +16,7 @@ int struct0::*dmp; void global_function_0 () { - i = *dmp; // { dg-error "invalid use of unary '\\\*' on pointer to member" } causes abort + i = *dmp; // { dg-error "7:invalid use of unary '\\\*' on pointer to member" } causes abort } int main () { return 0; } Index: testsuite/g++.old-deja/g++.bugs/900215_02.C =================================================================== --- testsuite/g++.old-deja/g++.bugs/900215_02.C (revision 278549) +++ testsuite/g++.old-deja/g++.bugs/900215_02.C (working copy) @@ -41,8 +41,8 @@ void struct0::function_member () i = (this->*fmp) (); // perfectly legal - for both cfront and g++ i = this->*dmp; // perfectly legal - for both cfront and g++ - i = (*fmp) (); // { dg-error "invalid use of unary '\\\*' on pointer to member" } - i = *dmp; // { dg-error "invalid use of unary '\\\*' on pointer to member" } + i = (*fmp) (); // { dg-error "8:invalid use of unary '\\\*' on pointer to member" } + i = *dmp; // { dg-error "7:invalid use of unary '\\\*' on pointer to member" } } int main () { return 0; } Index: testsuite/g++.old-deja/g++.bugs/900324_04.C =================================================================== --- testsuite/g++.old-deja/g++.bugs/900324_04.C (revision 278549) +++ testsuite/g++.old-deja/g++.bugs/900324_04.C (working copy) @@ -20,7 +20,7 @@ int_array ia2; void function_0 () { - ia1 = ia2; // { dg-error "" } gnu extension + ia1 = ia2; // { dg-error "7:invalid array assignment" } gnu extension } int main () { return 0; } Index: testsuite/g++.old-deja/g++.ext/array1.C =================================================================== --- testsuite/g++.old-deja/g++.ext/array1.C (revision 278549) +++ testsuite/g++.old-deja/g++.ext/array1.C (working copy) @@ -19,5 +19,5 @@ void ccBgaInspection::reinspect (unsigned long diag_flags) { ct2d_rigid physTdev; - _dev2phys = physTdev; // { dg-error "" } + _dev2phys = physTdev; // { dg-error "13:incompatible types in assignment" } } Index: testsuite/g++.old-deja/g++.jason/rfg17.C =================================================================== --- testsuite/g++.old-deja/g++.jason/rfg17.C (revision 278549) +++ testsuite/g++.old-deja/g++.jason/rfg17.C (working copy) @@ -12,5 +12,5 @@ void test () { b1 = b2; /* OK */ - a1 = a2; /* { dg-error "" } array assignment */ + a1 = a2; /* { dg-error "6:invalid array assignment" } array assignment */ } Index: testsuite/g++.old-deja/g++.other/badarrow.C =================================================================== --- testsuite/g++.old-deja/g++.other/badarrow.C (revision 278549) +++ testsuite/g++.old-deja/g++.other/badarrow.C (working copy) @@ -6,5 +6,5 @@ struct S { void f() { - s->i = 3; // { dg-error "" } base operand + s->i = 3; // { dg-error "4:base operand of .->. has non-pointer type .S." } base operand } Index: testsuite/g++.old-deja/g++.other/deref1.C =================================================================== --- testsuite/g++.old-deja/g++.other/deref1.C (revision 278549) +++ testsuite/g++.old-deja/g++.other/deref1.C (working copy) @@ -7,8 +7,8 @@ void fn (void *vp, volatile void *vvp) { - *vp; // { dg-error "" } not a pointer to object - *vvp; // { dg-error "" } not a pointer to object - &*vp; // { dg-error "" } not a pointer to object - &*vvp; // { dg-error "" } not a pointer to object + *vp; // { dg-error "3:.void\\*. is not a pointer-to-object type" } not a pointer to object + *vvp; // { dg-error "3:.volatile void\\*. is not a pointer-to-object type" } not a pointer to object + &*vp; // { dg-error "4:.void\\*. is not a pointer-to-object type" } not a pointer to object + &*vvp; // { dg-error "4:.volatile void\\*. is not a pointer-to-object type" } not a pointer to object }