From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11220 invoked by alias); 26 Apr 2014 16:40:42 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11166 invoked by uid 48); 26 Apr 2014 16:40:38 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60955] Erroneous warning about taking address of register with std=c++1y Date: Sat, 26 Apr 2014 16:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01989.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60955 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-04-26 CC| |manu at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #3 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Harald van Dijk from comment #2) > This is caused by the implementation of C++1y decltype(auto), where > seemingly redundant parentheses around an identifier must not simply be > removed, because they may be significant. >=20 > int a; > decltype(auto) b =3D a; // means int b =3D a; > decltype(auto) c =3D (a); // means int &c =3D a; >=20 > GCC implements this by transforming (a) into static_cast(a) > (force_paren_expr in gcc/cp/semantics.c), which would normally be a no-op, > but causes the warning when a is declared using the "register" keyword. It is pretty awful that C++14 has made extra parentheses to become signific= ant. But yes, this explains this bug and also PR57573. It would be nice if expressions could be marked as compiler-generated, like= we have DECL_ARTIFICIAL for declarations. But you could set TREE_NO_WARNING(ex= pr) =3D true and check that in the warning code. >>From gcc-bugs-return-449970-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Apr 26 16:42:33 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 12785 invoked by alias); 26 Apr 2014 16:42:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 12739 invoked by uid 48); 26 Apr 2014 16:42:29 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60955] Erroneous warning about taking address of register with std=c++1y Date: Sat, 26 Apr 2014 16:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01990.txt.bz2 Content-length: 850 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60955 --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- Perhaps also this special case could also be removed by using TREE_NO_WARNI= NG. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index c91612c..d8374d9 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6291,7 +6291,10 @@ maybe_warn_about_useless_cast (tree type, tree expr, tsubst_flags_t complain) if (warn_useless_cast && complain & tf_warning) { - if (REFERENCE_REF_P (expr)) + /* In C++14 mode, this interacts badly with force_paren_expr. And it + isn't necessary in any mode, because the code below handles + glvalues properly. For 4.9, just skip it in C++14 mode. */ + if (cxx_dialect < cxx1y && REFERENCE_REF_P (expr)) expr =3D TREE_OPERAND (expr, 0); >>From gcc-bugs-return-449971-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Apr 26 21:53:06 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 2134 invoked by alias); 26 Apr 2014 21:53:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 2092 invoked by uid 55); 26 Apr 2014 21:53:01 -0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/52539] I/O: Wrong result for UTF-8/UCS-4 list-directed and namelist read and nml write Date: Sat, 26 Apr 2014 21:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg01991.txt.bz2 Content-length: 953 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52539 --- Comment #7 from Jerry DeLisle --- Author: jvdelisle Date: Sat Apr 26 21:52:26 2014 New Revision: 209828 URL: http://gcc.gnu.org/viewcvs?rev=209828&root=gcc&view=rev Log: 2014-04-26 Jerry DeLisle PR libfortran/52539 * io/list_read.c: Add uchar typedef. (push_char4): New function to save kind=4 character. (next_char_utf8): New function to read a single UTF-8 encoded character value. (read_chracter): Update to use the new functions for reading UTF-8 strings. (list_formatted_read_scalar): Update to handle list directed reads of UTF-8 strings. (nml_read_obj): Likewise update for UTF-8 strings in namelists. * io/write.c (nml_write_obj): Add kind=4 character support for namelist writes. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c trunk/libgfortran/io/write.c