public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63650] New: conflicting type attributes specified for ‘virtual..'
@ 2014-10-26 17:14 richard at netbsd dot org
  2014-10-26 18:34 ` [Bug c++/63650] " daniel.kruegler at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: richard at netbsd dot org @ 2014-10-26 17:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63650

            Bug ID: 63650
           Summary: conflicting type attributes specified for ‘virtual..'
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard at netbsd dot org

came across this issue trying to build xulrunner192 on gcc 4.8.1 or 4.9.1

with this test program:

--------------->8----------------------
#ifndef HIDDEN
#define HIDDEN __attribute__((visibility("hidden")))
#ifndef CDECL
#define CDECL __attribute__((regparm(0),cdecl))
#endif

class A 
{
  virtual HIDDEN int CDECL foo( void *nok) = 0;
};

class B : public A
{
  virtual HIDDEN int CDECL foo(void *nok); /* implicitly virtual */
};

class C : public B
{
  int foo(void *nok); /* implicitly virtual */
};
--------------->8------------------------------

I get :
richard@omnis:/home/richard/src/tvir$ /opt/gcc-4.8.1/bin/g++ -c  tvir1.cpp 
tvir1.cpp:20:7: error: conflicting type attributes specified for ‘virtual int
C::foo(void*)’
   int foo(void *nok); /* implicitly virtual */
       ^
tvir1.cpp:15:28: error:   overriding ‘virtual int B::foo(void*)’
   virtual HIDDEN int CDECL foo(void *nok); /* implicitly virtual */
                            ^

compiling with '-DCDECL=' avoids the problem.

This builds with gcc 4.4.4 and I believe with gcc 4.7.3 so I ask:
Is this a problem with the recent g++ versions or with the older ones?
>From gcc-bugs-return-465005-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 26 17:14:15 2014
Return-Path: <gcc-bugs-return-465005-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18675 invoked by alias); 26 Oct 2014 17:14:14 -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 18646 invoked by uid 48); 26 Oct 2014 17:14:10 -0000
From: "mikpelinux at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/63645] Incorrect code generation
Date: Sun, 26 Oct 2014 18:14: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.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mikpelinux at gmail dot com
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:
Message-ID: <bug-63645-4-spASwdUt4m@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63645-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63645-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-10/txt/msg02026.txt.bz2
Content-length: 476

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc645

--- Comment #10 from Mikael Pettersson <mikpelinux at gmail dot com> ---
I now think the test case is invalid.  There is special provision in the
standard for accessing "the wrong member" of a union, but the member has to be
a struct type which shares a prefix with the current dynamic member (which also
has to be a struct).  That is, if you wrap the oper member of _GnmExpr in a
struct then I think the program is valid.


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

end of thread, other threads:[~2021-12-26  5:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26 17:14 [Bug c++/63650] New: conflicting type attributes specified for ‘virtual..' richard at netbsd dot org
2014-10-26 18:34 ` [Bug c++/63650] " daniel.kruegler at googlemail dot com
2014-10-26 19:32 ` daniel.kruegler at googlemail dot com
2014-10-26 20:49 ` richard at netbsd dot org
2021-12-26  5:22 ` pinskia 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).