public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "martin at steghoefer dot eu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61940] New: Wrong error location for error in initialization list Date: Tue, 29 Jul 2014 00:22:00 -0000 [thread overview] Message-ID: <bug-61940-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61940 Bug ID: 61940 Summary: Wrong error location for error in initialization list Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: martin at steghoefer dot eu Created attachment 33199 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33199&action=edit Example that provokes an error message with a wrong location When using several initializers in a constructor initializer list, an error in one of the initializers (e.g. a conversion from a const pointer to a non-const pointer, like in the attached example) is reported by gcc on the last token of the *whole* initializer list (not the last token of the erroneous initializer). This behavior is independent of the erroneous initializer being a member initialization or a call to a super-class constructor. Reproduce: g++ gcc-wrong-error-location.ii Output: gcc-wrong-error-location.cxx: In constructor ‘Class::Class(const double*)’: gcc-wrong-error-location.cxx:13:19: error: invalid conversion from ‘const double*’ to ‘double*’ [-fpermissive] m_otherMemberB(1) // good initialization (shown as erroneous line) ^ gcc version: Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) >From gcc-bugs-return-457276-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 29 01:44:58 2014 Return-Path: <gcc-bugs-return-457276-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 28782 invoked by alias); 29 Jul 2014 01:44:57 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 28349 invoked by uid 48); 29 Jul 2014 01:44:42 -0000 From: "thiago at kde dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61941] New: Mis-parsing of warn_unused_result function with ref-qualifiers Date: Tue, 29 Jul 2014 01:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thiago at kde dot org X-Bugzilla-Status: UNCONFIRMED 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_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: <bug-61941-4@http.gcc.gnu.org/bugzilla/> 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-07/txt/msg01867.txt.bz2 Content-length: 1613 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941 Bug ID: 61941 Summary: Mis-parsing of warn_unused_result function with ref-qualifiers Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: thiago at kde dot org Testcase: ==== class S { public: S x() const __attribute__ ((__warn_unused_result__)); S y() const & __attribute__ ((__warn_unused_result__)); S y() && __attribute__ ((__warn_unused_result__)); }; ==== (Almost minimal testcase; remove the last __attribute__((__warn_unused_result__)) for truly minimal) When compiled produces the following output: test.ii:7:7: error: ‘S S::y() &&’ cannot be overloaded S y() && __attribute__ ((__warn_unused_result__)); ^ test.ii:6:7: error: with ‘S S::y() const’ S y() const & __attribute__ ((__warn_unused_result__)); ^ Tested with GCC 4.8.1 (openSUSE 13.1) and 4.9.2 (gcc-4_8-branch revision 213070). If you read only the error message, it is correct: "S::y() &&" cannot be overloaded with "S::y() const". However. the overload of y on line 6 that GCC complains about is actually "S::y() const &", which is allowed to be overloaded. Somehow the & ref-qualifier got lost in the parsing. The error does not depend on the order of lines 6 and 7. It does depend on S::x() const appearing before S::y() const & and that both functions have the attribute. >From gcc-bugs-return-457277-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 29 02:47:12 2014 Return-Path: <gcc-bugs-return-457277-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 13702 invoked by alias); 29 Jul 2014 02:47:02 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 13056 invoked by uid 48); 29 Jul 2014 02:46:03 -0000 From: "zhenqiang.chen at linaro dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/59837] [ARM] ICE when building linux-linaro-tracking Date: Tue, 29 Jul 2014 02:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhenqiang.chen at linaro dot org X-Bugzilla-Status: RESOLVED 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 resolution Message-ID: <bug-59837-4-KoFwLi1VM0@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-59837-4@http.gcc.gnu.org/bugzilla/> References: <bug-59837-4@http.gcc.gnu.org/bugzilla/> 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-07/txt/msg01868.txt.bz2 Content-length: 341 https://gcc.gnu.org/bugzilla/show_bug.cgi?idY837 zhenqiang.chen at linaro dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |FIXED
next reply other threads:[~2014-07-29 0:22 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-29 0:22 martin at steghoefer dot eu [this message] 2014-07-29 4:14 ` [Bug c++/61940] " mpolacek at gcc dot gnu.org 2015-04-22 11:57 ` jakub at gcc dot gnu.org 2015-05-12 16:27 ` tromey at gcc dot gnu.org 2015-05-12 16:27 ` tromey at gcc dot gnu.org 2015-07-16 9:15 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-61940-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).