From patchwork Thu Jun 14 14:48:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 929493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479729-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="rfRgSOdo"; 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 41662f3Dtcz9s19 for ; Fri, 15 Jun 2018 00:49:14 +1000 (AEST) 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=MiE+EJYKUICweCW3gJ53ikOiX3gtUI06jf2xgfzrwgoOjaNL0P 1df63owHGDjR9CcMlyiVj1YbsloJvdEQRWanzWKhwrhPrIHp1izaEqlrNP8zBENl quyBm6SAc2Uu+bppE2TNgM0f3NVCIglZC3fAT6rVrqDQdBm7SX/LNl9R4= 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=BcTOFwlkS0R9gLxj6HytK2pIczI=; b=rfRgSOdo4CjDnuRH8owU M0Wl/JNPNHnvrviqUi0ZjuugXwFY9HEyMoe7pmGfd0h15iDHqiUeYkiVGgfAp5cy mPINWsx+nYh00bVcOvbLcWncXvcC9L+YrpX0EXtKOQl745HFJ3VSZ4LsIYdNU3iW tcbgSLr9YyGD5P/TcJzD3cg= Received: (qmail 67712 invoked by alias); 14 Jun 2018 14:49:04 -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 67403 invoked by uid 89); 14 Jun 2018 14:49:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=degrees, ux, H*F:D*oracle.com, H*Ad:D*oracle.com X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Jun 2018 14:49:00 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5EEmp1E141449; Thu, 14 Jun 2018 14:48:57 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2jk0xrdeaw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Jun 2018 14:48:56 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5EEmuEm001850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Jun 2018 14:48:56 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5EEmtBq027327; Thu, 14 Jun 2018 14:48:55 GMT Received: from [192.168.1.4] (/87.11.64.97) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Jun 2018 07:48:54 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] Another bunch of location fixes for decl.c/decl2.c functions Message-ID: Date: Thu, 14 Jun 2018 16:48:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8923 signatures=668702 X-IsSubscribed: yes Hi, tested x86_64 linux. Thanks, Paolo. /////////////////////// /cp 2018-06-14 Paolo Carlini * decl.c (duplicate_decls): Use DECL_SOURCE_LOCATION in OPT_Wshadow warning_at. (grokfndecl): Consistently use the location_t argument in literal operator diagnostic messages. (grokdeclarator): Use declspecs->locations[ds_storage_class] in error_at call. decl2.c (finish_static_data_member_decl): Use DECL_SOURCE_LOCATION in permerror call. /testsuite 2018-06-14 Paolo Carlini * g++.dg/other/static3.C: New. * g++.dg/other/static4.C: Likewise. * g++.dg/warn/Wshadow-15.C: Likewise. * g++.dg/cpp0x/gnu_fext-numeric-literals.C: Test locations too. * g++.dg/cpp0x/std_fext-numeric-literals.C: Likewise. * g++.dg/cpp0x/std_fno-ext-numeric-literals.C: Likewise. * g++.dg/cpp0x/udlit-args-neg.C: Likewise. * g++.dg/cpp0x/udlit-clink-neg.C: Likewise. * g++.dg/cpp0x/udlit-extern-c.C: Likewise. * g++.dg/cpp0x/udlit-member-neg.C: Likewise. Index: cp/decl.c =================================================================== --- cp/decl.c (revision 261586) +++ cp/decl.c (working copy) @@ -1398,10 +1398,11 @@ duplicate_decls (tree newdecl, tree olddecl, bool bad choice of name. */ if (! TREE_PUBLIC (newdecl)) { - warning (OPT_Wshadow, - DECL_BUILT_IN (olddecl) - ? G_("shadowing built-in function %q#D") - : G_("shadowing library function %q#D"), olddecl); + warning_at (DECL_SOURCE_LOCATION (newdecl), + OPT_Wshadow, + DECL_BUILT_IN (olddecl) + ? G_("shadowing built-in function %q#D") + : G_("shadowing library function %q#D"), olddecl); /* Discard the old built-in function. */ return NULL_TREE; } @@ -8863,7 +8864,7 @@ grokfndecl (tree ctype, /* [over.literal]/6: Literal operators shall not have C linkage. */ if (DECL_LANGUAGE (decl) == lang_c) { - error ("literal operator with C linkage"); + error_at (location, "literal operator with C linkage"); maybe_show_extern_c_location (); return NULL_TREE; } @@ -8873,7 +8874,7 @@ grokfndecl (tree ctype, if (!check_literal_operator_args (decl, &long_long_unsigned_p, &long_double_p)) { - error ("%qD has invalid argument list", decl); + error_at (location, "%qD has invalid argument list", decl); return NULL_TREE; } @@ -8881,26 +8882,26 @@ grokfndecl (tree ctype, if (long_long_unsigned_p) { if (cpp_interpret_int_suffix (parse_in, suffix, strlen (suffix))) - warning (0, "integer suffix %qs" + warning_at (location, 0, "integer suffix %qs" " shadowed by implementation", suffix); } else if (long_double_p) { if (cpp_interpret_float_suffix (parse_in, suffix, strlen (suffix))) - warning (0, "floating point suffix %qs" + warning_at (location, 0, "floating point suffix %qs" " shadowed by implementation", suffix); } /* 17.6.3.3.5 */ if (suffix[0] != '_' - && !in_system_header_at (DECL_SOURCE_LOCATION (decl)) + && !in_system_header_at (location) && !current_function_decl && !(friendp && !funcdef_flag)) - warning (OPT_Wliteral_suffix, - "literal operator suffixes not preceded by %<_%>" - " are reserved for future standardization"); + warning_at (location, OPT_Wliteral_suffix, + "literal operator suffixes not preceded by %<_%>" + " are reserved for future standardization"); } else { - error ("%qD must be a non-member function", decl); + error_at (location, "%qD must be a non-member function", decl); return NULL_TREE; } } @@ -12408,7 +12409,8 @@ grokdeclarator (const cp_declarator *declarator, { /* 7.1.1: There can be no static function declarations within a block. */ - error ("cannot declare static function inside another function"); + error_at (declspecs->locations[ds_storage_class], + "cannot declare static function inside another function"); invalid_static = 1; } Index: cp/decl2.c =================================================================== --- cp/decl2.c (revision 261586) +++ cp/decl2.c (working copy) @@ -756,7 +756,8 @@ finish_static_data_member_decl (tree decl, if (LOCAL_CLASS_P (current_class_type) /* We already complained about the template definition. */ && !DECL_TEMPLATE_INSTANTIATION (decl)) - permerror (input_location, "local class %q#T shall not have static data member %q#D", + permerror (DECL_SOURCE_LOCATION (decl), + "local class %q#T shall not have static data member %q#D", current_class_type, decl); else for (tree t = current_class_type; TYPE_P (t); Index: testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C =================================================================== --- testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C (revision 261586) +++ testsuite/g++.dg/cpp0x/gnu_fext-numeric-literals.C (working copy) @@ -4,73 +4,73 @@ // Integer imaginary... constexpr unsigned long long -operator"" i(unsigned long long n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(unsigned long long n) // { dg-warning "1:integer suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4 * n + 0; } constexpr unsigned long long -operator"" I(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" I(unsigned long long n) // { dg-warning "1:integer suffix .I. shadowed by implementation" } { return 4 * n + 1; } constexpr unsigned long long -operator"" j(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" j(unsigned long long n) // { dg-warning "1:integer suffix .j. shadowed by implementation" } { return 4 * n + 2; } constexpr unsigned long long -operator"" J(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" J(unsigned long long n) // { dg-warning "1:integer suffix .J. shadowed by implementation" } { return 4 * n + 3; } // Floating-point imaginary... constexpr long double -operator"" i(long double n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(long double n) // { dg-warning "1:floating point suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4.0L * n + 0.0L; } constexpr long double -operator"" I(long double n) // { dg-warning "shadowed by implementation" } +operator"" I(long double n) // { dg-warning "1:floating point suffix .I. shadowed by implementation" } { return 4.0L * n + 1.0L; } constexpr long double -operator"" j(long double n) // { dg-warning "shadowed by implementation" } +operator"" j(long double n) // { dg-warning "1:floating point suffix .j. shadowed by implementation" } { return 4.0L * n + 2.0L; } constexpr long double -operator"" J(long double n) // { dg-warning "shadowed by implementation" } +operator"" J(long double n) // { dg-warning "1:floating point suffix .J. shadowed by implementation" } { return 4.0L * n + 3.0L; } // Fixed-point... constexpr long double -operator"" k(long double n) // { dg-warning "shadowed by implementation" } +operator"" k(long double n) // { dg-warning "1:floating point suffix .k. shadowed by implementation" } { return 4 * (n + 1) + 0; } constexpr long double -operator"" K(long double n) // { dg-warning "shadowed by implementation" } +operator"" K(long double n) // { dg-warning "1:floating point suffix .K. shadowed by implementation" } { return 4 * (n + 1) + 1; } constexpr long double -operator"" r(long double n) // { dg-warning "shadowed by implementation" } +operator"" r(long double n) // { dg-warning "1:floating point suffix .r. shadowed by implementation" } { return 4 * (n + 1) + 2; } constexpr long double -operator"" R(long double n) // { dg-warning "shadowed by implementation" } +operator"" R(long double n) // { dg-warning "1:floating point suffix .R. shadowed by implementation" } { return 4 * (n + 1) + 3; } // Machine-defined... constexpr long double -operator"" w(long double n) // { dg-warning "shadowed by implementation" } +operator"" w(long double n) // { dg-warning "1:floating point suffix .w. shadowed by implementation" } { return 4 * (n + 2) + 0; } constexpr long double -operator"" W(long double n) // { dg-warning "shadowed by implementation" } +operator"" W(long double n) // { dg-warning "1:floating point suffix .W. shadowed by implementation" } { return 4 * (n + 2) + 1; } constexpr long double -operator"" q(long double n) // { dg-warning "shadowed by implementation" } +operator"" q(long double n) // { dg-warning "1:floating point suffix .q. shadowed by implementation" } { return 4 * (n + 2) + 2; } constexpr long double -operator"" Q(long double n) // { dg-warning "shadowed by implementation" } +operator"" Q(long double n) // { dg-warning "1:floating point suffix .Q. shadowed by implementation" } { return 4 * (n + 2) + 3; } int @@ -97,19 +97,19 @@ main() auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 11 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 15 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 19 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 37 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 43 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 47 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 51 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 55 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 61 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 65 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 69 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 73 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 7 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 11 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 15 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 19 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 25 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 29 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 33 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 37 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 43 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 47 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 51 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 55 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 61 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 65 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 69 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 73 } Index: testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C =================================================================== --- testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C (revision 261586) +++ testsuite/g++.dg/cpp0x/std_fext-numeric-literals.C (working copy) @@ -4,73 +4,73 @@ // Integer imaginary... constexpr unsigned long long -operator"" i(unsigned long long n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(unsigned long long n) // { dg-warning "1:integer suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4 * n + 0; } constexpr unsigned long long -operator"" I(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" I(unsigned long long n) // { dg-warning "1:integer suffix .I. shadowed by implementation" } { return 4 * n + 1; } constexpr unsigned long long -operator"" j(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" j(unsigned long long n) // { dg-warning "1:integer suffix .j. shadowed by implementation" } { return 4 * n + 2; } constexpr unsigned long long -operator"" J(unsigned long long n) // { dg-warning "shadowed by implementation" } +operator"" J(unsigned long long n) // { dg-warning "1:integer suffix .J. shadowed by implementation" } { return 4 * n + 3; } // Floating-point imaginary... constexpr long double -operator"" i(long double n) // { dg-warning "shadowed by implementation" "" { target c++11_only } } +operator"" i(long double n) // { dg-warning "1:floating point suffix .i. shadowed by implementation" "" { target c++11_only } } { return 4.0L * n + 0.0L; } constexpr long double -operator"" I(long double n) // { dg-warning "shadowed by implementation" } +operator"" I(long double n) // { dg-warning "1:floating point suffix .I. shadowed by implementation" } { return 4.0L * n + 1.0L; } constexpr long double -operator"" j(long double n) // { dg-warning "shadowed by implementation" } +operator"" j(long double n) // { dg-warning "1:floating point suffix .j. shadowed by implementation" } { return 4.0L * n + 2.0L; } constexpr long double -operator"" J(long double n) // { dg-warning "shadowed by implementation" } +operator"" J(long double n) // { dg-warning "1:floating point suffix .J. shadowed by implementation" } { return 4.0L * n + 3.0L; } // Fixed-point... constexpr long double -operator"" k(long double n) // { dg-warning "shadowed by implementation" } +operator"" k(long double n) // { dg-warning "1:floating point suffix .k. shadowed by implementation" } { return 4 * (n + 1) + 0; } constexpr long double -operator"" K(long double n) // { dg-warning "shadowed by implementation" } +operator"" K(long double n) // { dg-warning "1:floating point suffix .K. shadowed by implementation" } { return 4 * (n + 1) + 1; } constexpr long double -operator"" r(long double n) // { dg-warning "shadowed by implementation" } +operator"" r(long double n) // { dg-warning "1:floating point suffix .r. shadowed by implementation" } { return 4 * (n + 1) + 2; } constexpr long double -operator"" R(long double n) // { dg-warning "shadowed by implementation" } +operator"" R(long double n) // { dg-warning "1:floating point suffix .R. shadowed by implementation" } { return 4 * (n + 1) + 3; } // Machine-defined... constexpr long double -operator"" w(long double n) // { dg-warning "shadowed by implementation" } +operator"" w(long double n) // { dg-warning "1:floating point suffix .w. shadowed by implementation" } { return 4 * (n + 2) + 0; } constexpr long double -operator"" W(long double n) // { dg-warning "shadowed by implementation" } +operator"" W(long double n) // { dg-warning "1:floating point suffix .W. shadowed by implementation" } { return 4 * (n + 2) + 1; } constexpr long double -operator"" q(long double n) // { dg-warning "shadowed by implementation" } +operator"" q(long double n) // { dg-warning "1:floating point suffix .q. shadowed by implementation" } { return 4 * (n + 2) + 2; } constexpr long double -operator"" Q(long double n) // { dg-warning "shadowed by implementation" } +operator"" Q(long double n) // { dg-warning "1:floating point suffix .Q. shadowed by implementation" } { return 4 * (n + 2) + 3; } int @@ -97,19 +97,19 @@ main() auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } } } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 11 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 15 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 19 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 37 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 43 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 47 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 51 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 55 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 61 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 65 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 69 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 73 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 7 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 11 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 15 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 19 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 25 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 29 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 33 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 37 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 43 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 47 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 51 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 55 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 61 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 65 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 69 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 73 } Index: testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C =================================================================== --- testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C (revision 261586) +++ testsuite/g++.dg/cpp0x/std_fno-ext-numeric-literals.C (working copy) @@ -97,19 +97,19 @@ main() auto Qfp = 1.0Q; } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 7 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 11 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 15 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 19 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 25 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 29 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 33 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 37 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 43 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 47 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 51 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 55 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 61 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 65 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 69 } -// { dg-warning "literal operator suffixes not preceded by" "" { target *-*-* } 73 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 7 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 11 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 15 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 19 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 25 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 29 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 33 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 37 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 43 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 47 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 51 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 55 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 61 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 65 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 69 } +// { dg-warning "1:literal operator suffixes not preceded by" "" { target *-*-* } 73 } Index: testsuite/g++.dg/cpp0x/udlit-args-neg.C =================================================================== --- testsuite/g++.dg/cpp0x/udlit-args-neg.C (revision 261586) +++ testsuite/g++.dg/cpp0x/udlit-args-neg.C (working copy) @@ -5,37 +5,37 @@ class Foo { }; int -operator"" _Foo(); // { dg-error "has invalid argument list" } +operator"" _Foo(); // { dg-error "1:.int operator\"\"_Foo\\(\\). has invalid argument list" } Foo -operator"" _Foo(int *); // { dg-error "has invalid argument list" } +operator"" _Foo(int *); // { dg-error "1:.Foo operator\"\"_Foo\\(int\\*\\). has invalid argument list" } Foo -operator"" _Foo(unsigned long int); // { dg-error "has invalid argument list" } +operator"" _Foo(unsigned long int); // { dg-error "1:.Foo operator\"\"_Foo\\(long unsigned int\\). has invalid argument list" } Foo -operator"" _Foo(double); // { dg-error "has invalid argument list" } +operator"" _Foo(double); // { dg-error "1:.Foo operator\"\"_Foo\\(double\\). has invalid argument list" } Foo -operator"" _Foo(const float *, std::size_t); // { dg-error "has invalid argument list" } +operator"" _Foo(const float *, std::size_t); // { dg-error "1:.Foo operator\"\"_Foo\\(const float\\*, std::size_t\\). has invalid argument list" } Foo -operator"" _Foo(const wchar_t *, int); // { dg-error "has invalid argument list" } +operator"" _Foo(const wchar_t *, int); // { dg-error "1:.Foo operator\"\"_Foo\\(const wchar_t\\*, int\\). has invalid argument list" } Foo -operator"" _Foo(const char16_t *); // { dg-error "has invalid argument list" } +operator"" _Foo(const char16_t *); // { dg-error "1:.Foo operator\"\"_Foo\\(const char16_t\\*\\). has invalid argument list" } Foo -operator"" _Foo(char...); // { dg-error "has invalid argument list" } +operator"" _Foo(char...); // { dg-error "1:.Foo operator\"\"_Foo\\(char, \\.\\.\\.\\). has invalid argument list" } Foo -operator"" _Foo(unsigned long long int, char); // { dg-error "has invalid argument list" } +operator"" _Foo(unsigned long long int, char); // { dg-error "1:.Foo operator\"\"_Foo\\(long long unsigned int, char\\). has invalid argument list" } Foo -operator"" _Foo(const char *, std::size_t, int); // { dg-error "has invalid argument list" } +operator"" _Foo(const char *, std::size_t, int); // { dg-error "1:.Foo operator\"\"_Foo\\(const char\\*, std::size_t, int\\). has invalid argument list" } Foo -operator"" _Foo(long double &); // { dg-error "has invalid argument list" } +operator"" _Foo(long double &); // { dg-error "1:.Foo operator\"\"_Foo\\(long double&\\). has invalid argument list" } Foo -operator"" _Foo(std::size_t, const char16_t *); // { dg-error "has invalid argument list" } +operator"" _Foo(std::size_t, const char16_t *); // { dg-error "1:.Foo operator\"\"_Foo\\(std::size_t, const char16_t\\*\\). has invalid argument list" } Index: testsuite/g++.dg/cpp0x/udlit-clink-neg.C =================================================================== --- testsuite/g++.dg/cpp0x/udlit-clink-neg.C (revision 261586) +++ testsuite/g++.dg/cpp0x/udlit-clink-neg.C (working copy) @@ -3,6 +3,6 @@ extern "C" { int -operator"" _badclinkage(unsigned long long); // { dg-error "operator with C linkage" } +operator"" _badclinkage(unsigned long long); // { dg-error "1:literal operator with C linkage" } } Index: testsuite/g++.dg/cpp0x/udlit-extern-c.C =================================================================== --- testsuite/g++.dg/cpp0x/udlit-extern-c.C (revision 261586) +++ testsuite/g++.dg/cpp0x/udlit-extern-c.C (working copy) @@ -2,6 +2,6 @@ extern "C" { // { dg-message "1: 'extern .C.' linkage started here" } -constexpr double operator"" _deg ( double degrees ); // { dg-error "literal operator with C linkage" } +constexpr double operator"" _deg ( double degrees ); // { dg-error "18:literal operator with C linkage" } } Index: testsuite/g++.dg/cpp0x/udlit-member-neg.C =================================================================== --- testsuite/g++.dg/cpp0x/udlit-member-neg.C (revision 261586) +++ testsuite/g++.dg/cpp0x/udlit-member-neg.C (working copy) @@ -4,7 +4,7 @@ class Foo { public: Foo() { } - int operator"" _Bar(char32_t); // { dg-error "must be a non-member function" } + int operator"" _Bar(char32_t); // { dg-error "7:.int Foo::operator\"\"_Bar\\(char32_t\\). must be a non-member function" } }; int i = operator"" _Bar(U'x'); // { dg-error "9:'operator\"\"_Bar' was not declared in this scope" } Index: testsuite/g++.dg/other/static3.C =================================================================== --- testsuite/g++.dg/other/static3.C (nonexistent) +++ testsuite/g++.dg/other/static3.C (working copy) @@ -0,0 +1,7 @@ +void foo() +{ + struct S + { + static const int a = 0; // { dg-error "22:local class" } + }; +} Index: testsuite/g++.dg/other/static4.C =================================================================== --- testsuite/g++.dg/other/static4.C (nonexistent) +++ testsuite/g++.dg/other/static4.C (working copy) @@ -0,0 +1,6 @@ +// { dg-options -Wno-pedantic } + +void foo() +{ + static void bar(); // { dg-error "3:cannot declare static function" } +} Index: testsuite/g++.dg/warn/Wshadow-15.C =================================================================== --- testsuite/g++.dg/warn/Wshadow-15.C (nonexistent) +++ testsuite/g++.dg/warn/Wshadow-15.C (working copy) @@ -0,0 +1,7 @@ +// { dg-options "-Wshadow" } + +template +void* operator new(__SIZE_TYPE__, T&); // { dg-warning "7:shadowing library function" } + +template +void operator delete(void *, T&); // { dg-warning "6:shadowing library function" }