public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60894] New: Use of redundant struct keyword in virtual function prototype combined with using statement causes compilation error
@ 2014-04-19 12:00 loose at astron dot nl
  2014-04-22  9:33 ` [Bug c++/60894] " redi at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: loose at astron dot nl @ 2014-04-19 12:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60894

            Bug ID: 60894
           Summary: Use of redundant struct keyword in virtual function
                    prototype combined with using statement causes
                    compilation error
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: loose at astron dot nl

The code below causes a compilation error:
t.cc:15:6: error: prototype for ‘void D::doIt(B::S&)’ does not match any in
class ‘D’

class B
{
protected:
  struct S {};
  virtual void doIt(struct S& s) = 0;
};

class D : public B
{
public:
  using B::S;
  virtual void doIt(struct S& s);
};

void D::doIt(struct S& s)
{
  (void)s;
}

This code compiles fine if I remove the redundant struct keyword in the virtual
function prototype. It also compiles fine if I remove the using declaration. It
seems as if the compiler thinks I'm forward declaring another struct S inside
the declaration of D::doIt().
>From gcc-bugs-return-449346-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Apr 19 13:04:19 2014
Return-Path: <gcc-bugs-return-449346-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5141 invoked by alias); 19 Apr 2014 13:04:18 -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 5086 invoked by uid 48); 19 Apr 2014 13:04:14 -0000
From: "mikpelinux at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/60830] [4.9 Regression] ICE on bootstrapping on cygwin
Date: Sat, 19 Apr 2014 13:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: build
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mikpelinux at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60830-4-GOwxg9yYyw@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60830-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60830-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-04/txt/msg01366.txt.bz2
Content-length: 1955

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`830

--- Comment #28 from Mikael Pettersson <mikpelinux at gmail dot com> ---
My attempted bootstraps of 4.8.2 on Cygwin failed due to three reasons:

1. I had --disable-sjlj-exceptions, which worked with previous releases.
Dropping that and adding --disable-multilib (based on Kai's comment, not sure
it's needed in a purely 32-bit setting) made things work again.

[Cygwin's own gcc-4.8.2 is built with --disable-sjlj-exceptions however.  I
don't know why it works for them but not for us.]

2. I tried to build with make -j4, that caused strange linkage errors.
Dropping that and doing a non-parallell make made things work again.

3. The Ada bootstrap always failed with:

/home/mikpe/objdir/./gcc/xgcc -B/home/mikpe/objdir/./gcc/
-B/opt/local/gcc-4.8/i686-pc-cygwin/bin/
-B/opt/local/gcc-4.8/i686-pc-cygwin/lib/ -isystem
/opt/local/gcc-4.8/i686-pc-cygwin/include -isystem
/opt/local/gcc-4.8/i686-pc-cygwin/sys-include    -c -g -O2   -W -Wall -gnatpg
-nostdinc   g-sercom.adb -o g-sercom.o
g-sercom.adb:40:12: warning: no entities of "System.OS_Constants" are
referenced
g-sercom.adb:46:04: warning: no entities of "OSC" are referenced
g-sercom.adb:209:42: "DTR_CONTROL_ENABLE" not declared in "OS_Constants"
g-sercom.adb:211:42: "RTS_CONTROL_ENABLE" not declared in "OS_Constants"
../gcc-interface/Makefile:310: recipe for target 'g-sercom.o' failed
make[4]: *** [g-sercom.o] Error 1

This appears to be a known bug, I found a report of it in gcc-help,
http://gcc.gnu.org/ml/gcc-help/2012-10/msg00003.html, and a patch in
http://sourceforge.net/p/cygwin-ports/gcc/ci/master/tree/4.8-gcc-ada-DTR.patch.

(Ada on Cygwin uses mingw's g-sercom.adb which references those two symbols,
but s-oscons-tmplt.c only defines those symbols for mingw, not for Cygwin.  As
far as I can tell this issue is still present in 4.9 and 4.10.)

With all three adjustments I was finally able to bootstrap 4.8.2 on Cygwin.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-06-26 20:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-19 12:00 [Bug c++/60894] New: Use of redundant struct keyword in virtual function prototype combined with using statement causes compilation error loose at astron dot nl
2014-04-22  9:33 ` [Bug c++/60894] " redi at gcc dot gnu.org
2014-04-22 11:54 ` [Bug c++/60894] [4.7/4.8/4.9/4.10 Regression] " redi at gcc dot gnu.org
2014-04-22 12:02 ` redi at gcc dot gnu.org
2014-04-28 19:21 ` fabien at gcc dot gnu.org
2014-05-05  9:16 ` rguenth at gcc dot gnu.org
2014-06-03 13:45 ` jason at gcc dot gnu.org
2014-06-09 21:19 ` fabien at gcc dot gnu.org
2014-06-12 13:52 ` rguenth at gcc dot gnu.org
2014-09-12 17:39 ` [Bug c++/60894] [4.8/4.9/5 Regression] Use of redundant struct keyword in " jason at gcc dot gnu.org
2014-11-26 16:58 ` paolo.carlini at oracle dot com
2014-12-01 11:56 ` fabien at gcc dot gnu.org
2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-02-13 23:57 ` paolo at gcc dot gnu.org
2015-02-13 23:58 ` [Bug c++/60894] [4.8/4.9 " paolo.carlini at oracle dot com
2015-06-23  8:40 ` rguenth at gcc dot gnu.org
2015-06-26 20:02 ` [Bug c++/60894] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:32 ` jakub at gcc dot gnu.org

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).