From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32227 invoked by alias); 30 Dec 2014 15:05:26 -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 32206 invoked by uid 48); 30 Dec 2014 15:05:19 -0000 From: "petschy at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64446] New: Misleading error message when inheriting from a template class w/o the template params Date: Tue, 30 Dec 2014 15:05: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: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: petschy at gmail dot com 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: 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-12/txt/msg02944.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D64446 Bug ID: 64446 Summary: Misleading error message when inheriting from a template class w/o the template params Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: petschy at gmail dot com When compiling the under code, g++ gives a misleading error message: $ g++-5.0.0 -Wall 20141230-templ_base.cpp=20 20141230-templ_base.cpp:7:1: error: expected class-name before =E2=80=98{= =E2=80=99 token 'Base' is definitely a valid class name. The problem is that the name given is a class, but it's a template and the template argument is missing. However, in the second case, when inheriting from Base2 and only one templa= te argument is given of the two, the error message is OK: wrong number of temp= late arguments (1, should be 2). Something similar would be desirable in the first case, not to waste time staring at the screen, searching for a typo in the class name and finding n= one. Like ' is a template but no template arguments are given'. $ g++-5.0.0 -v Using built-in specs. COLLECT_GCC=3Dg++-5.0.0 COLLECT_LTO_WRAPPER=3D/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0= /lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --enable-languages=3Dc,c++ --disable-multilib --program-suffix=3D-5.0.0 Thread model: posix gcc version 5.0.0 20141222 (experimental) (GCC)=20 4.9 and 4.8 gives the same misleading error message. ----8<----8<----8<----8<---- template struct Base { }; struct Foo : Base { // error: expected class-name before =E2=80=98{=E2=80=99 token }; template struct Base2 { }; struct Foo2 : Base2 // OK: wrong number of template arguments (1, shou= ld be 2) {=20=20=20=20=20=20=20 }; >>From gcc-bugs-return-471938-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Dec 30 15:08:09 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 1940 invoked by alias); 30 Dec 2014 15:08:08 -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 1926 invoked by uid 48); 30 Dec 2014 15:08:04 -0000 From: "mikpelinux at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64442] -O1 modify output of a simple computation with rounding Date: Tue, 30 Dec 2014 15:08: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.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikpelinux at gmail dot com 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: 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-12/txt/msg02945.txt.bz2 Content-length: 297 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64442 --- Comment #3 from Mikael Pettersson --- See PR323 and https://gcc.gnu.org/bugs/#known You could experiment with -ffloat-store, -mpc64, or -msse2 (if your CPU supports SSE2, which it should if it isn't ancient).