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

* [Bug c++/63650] conflicting type attributes specified for ‘virtual..'
  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 ` daniel.kruegler at googlemail dot com
  2014-10-26 19:32 ` daniel.kruegler at googlemail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-10-26 18:34 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 10867 bytes --]

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
As written the code is ill-formed because of the unterminated second #ifndef.
What is the real code?
>From gcc-bugs-return-465008-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 26 18:34:36 2014
Return-Path: <gcc-bugs-return-465008-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13614 invoked by alias); 26 Oct 2014 18:34:34 -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 13579 invoked by uid 48); 26 Oct 2014 18:34:30 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63620] RELOAD lost SET_GOT dependency on Darwin
Date: Sun, 26 Oct 2014 18:36:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ra
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords cf_gcctarget bug_status cf_reconfirmed_on target_milestone everconfirmed
Message-ID: <bug-63620-4-n25bwJSXgs@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63620-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63620-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-10/txt/msg02029.txt.bz2
Content-length: 2472

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
             Target|Darwin                      |x86
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-26
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
Confirmed. This will affect all SSE targets.

This is an RA issue. When RA kicks the constant to a memory, PIC register
should be marked as live for the insn that accesses memory.

We start with:

(insn 21 17 22 3 (set (mem:TF (pre_dec:SI (reg/f:SI 7 sp)) [1  S16 A128])
        (const_double:TF 1.0e+29 [0x0.a18f07d736b90be55p+97])) pr63620.c:21 121
{*pushtf}
     (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
        (nil)))

and RA does:

     Choosing alt 0 in insn 21:  (0) =<  (1) x {*pushtf}
      Creating newreg=93, assigning class GENERAL_REGS to addr r93
       Change to class INDEX_REGS for r93
      Creating newreg=94, assigning class SSE_REGS to r94
   21: [--sp:SI]=r94:TF
      REG_ARGS_SIZE 0x10
    Inserting insn reload before:
   46: r93:SI=r87:SI+const(unspec[`*LC0'] 10)
      REG_EQUAL `*LC0'
   47: r94:TF=[r93:SI]

which results in:

(insn 46 17 47 3 (set (reg:SI 0 ax [93])
        (plus:SI (reg:SI 0 ax [87])
            (const:SI (unspec:SI [
                        (symbol_ref/u:SI ("*LC0") [flags 0x2])
                    ] UNSPEC_MACHOPIC_OFFSET)))) pr63620.c:21 213 {*leasi}
     (expr_list:REG_EQUAL (symbol_ref/u:SI ("*LC0") [flags 0x2])
        (nil)))
(insn 47 46 21 3 (set (reg:TF 23 xmm2 [94])
        (mem/u/c:TF (reg:SI 0 ax [93]) [1  S16 A128])) pr63620.c:21 126
{*movtf_internal}
     (nil))
(insn 21 47 22 3 (set (mem:TF (pre_dec:SI (reg/f:SI 7 sp)) [1  S16 A128])
        (reg:TF 23 xmm2 [94])) pr63620.c:21 121 {*pushtf}
     (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
        (nil)))

When the constant is pushed to a memory to satisfy operand constraints, the PIC
register should be marked as live (== used by the insn that reads memory). RA
even sets the REG_EQUAL to a symbol_ref in the reloading insn.

The patch at Comment #2 will just paper over the issue.
>From gcc-bugs-return-465009-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 26 18:36:47 2014
Return-Path: <gcc-bugs-return-465009-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14850 invoked by alias); 26 Oct 2014 18:36:47 -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 14816 invoked by uid 48); 26 Oct 2014 18:36:43 -0000
From: "richard at netbsd dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63650]=?UTF-8?Q? conflicting type attributes specified for ‘virtual?=..'
Date: Sun, 26 Oct 2014 18:38: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.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: richard at netbsd 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: attachments.created
Message-ID: <bug-63650-4-5TIZYyg9jv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63650-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63650-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/msg02030.txt.bz2
Content-length: 4087

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

--- Comment #2 from Richard PALO <richard at netbsd dot org> ---
Created attachment 33812
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3812&actioníit
nsFastLoadFile.ii

this is the original error:
> gmake[4]: Entering directory '/tmp/pkgsrc/devel/xulrunner192/work/mozilla-1.9.2/xpcom/io'
> nsFastLoadFile.cpp
> g++ -o nsFastLoadFile.o -c -I../../dist/system_wrappers -include ../../config/gcc_hidden.h -DMOZILLA_INTERNAL_API -DOSTYPE=\"SunOS5\" -DOSARCH=SunOS -D_IMPL_NS_COM -I.. -I. -I. -I../../dist/include -I../../dist/include/nsprpub  -I/tmp/pkgsrc/devel/xulrunner192/work/mozilla-1.9.2/dist/include/nspr -I/tmp/pkgsrc/devel/xulrunner192/work/mozilla-1.9.2/dist/include/nss      -I/opt/local/include   -fPIC  -I/usr/include -I/opt/local/include -I/opt/local/include/libdrm -I/opt/local/include/freetype2  -I/opt/local/include -fno-rtti -fno-exceptions -Wno-long-long -O2 -I/usr/include -I/opt/local/include -I/opt/local/include/libdrm -I/opt/local/include/freetype2 -fno-strict-aliasing -fshort-wchar -pthread  -DNDEBUG -DTRIMMED -O2  -I/usr/include -I/opt/local/include -I/opt/local/include/libdrm -I/opt/local/include/freetype2  -I/opt/local/include -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsFastLoadFile.pp nsFastLoadFile.cpp
> nsFastLoadService.cpp
> g++ -o nsFastLoadService.o -c -I../../dist/system_wrappers -include ../../config/gcc_hidden.h -DMOZILLA_INTERNAL_API -DOSTYPE=\"SunOS5\" -DOSARCH=SunOS -D_IMPL_NS_COM -I.. -I. -I. -I../../dist/include -I../../dist/include/nsprpub  -I/tmp/pkgsrc/devel/xulrunner192/work/mozilla-1.9.2/dist/include/nspr -I/tmp/pkgsrc/devel/xulrunner192/work/mozilla-1.9.2/dist/include/nss      -I/opt/local/include   -fPIC  -I/usr/include -I/opt/local/include -I/opt/local/include/libdrm -I/opt/local/include/freetype2  -I/opt/local/include -fno-rtti -fno-exceptions -Wno-long-long -O2 -I/usr/include -I/opt/local/include -I/opt/local/include/libdrm -I/opt/local/include/freetype2 -fno-strict-aliasing -fshort-wchar -pthread  -DNDEBUG -DTRIMMED -O2  -I/usr/include -I/opt/local/include -I/opt/local/include/libdrm -I/opt/local/include/freetype2  -I/opt/local/include -DMOZILLA_CLIENT -include ../../mozilla-config.h -Wp,-MD,.deps/nsFastLoadService.pp nsFastLoadService.cpp
> In file included from nsFastLoadService.cpp:47:0:
> nsFastLoadFile.h:298:19: error: conflicting type attributes specified for 'virtual nsresult nsFastLoadFileReader::ReadSegments(nsWriteSegmentFun, void*, PRUint32, PRUint32*)'
>      NS_IMETHODIMP ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
>                    ^
> In file included from ../../dist/include/nsIBinaryInputStream.h:10:0,
>                  from ../../dist/include/nsIObjectInputStream.h:10,
>                  from nsBinaryStream.h:44,
>                  from nsFastLoadFile.h:49,
>                  from nsFastLoadService.cpp:47:
> nsBinaryStream.h:113:5: error:   overriding 'virtual nsresult nsBinaryInputStream::ReadSegments(nsWriteSegmentFun, void*, PRUint32, PRUint32*)'
>      NS_DECL_NSIINPUTSTREAM
>      ^
> In file included from nsFastLoadFile.cpp:58:0:
> nsFastLoadFile.h:298:19: error: conflicting type attributes specified for 'virtual nsresult nsFastLoadFileReader::ReadSegments(nsWriteSegmentFun, void*, PRUint32, PRUint32*)'
>      NS_IMETHODIMP ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
>                    ^
> In file included from ../../dist/include/nsIBinaryInputStream.h:10:0,
>                  from ../../dist/include/nsIObjectInputStream.h:10,
>                  from nsBinaryStream.h:44,
>                  from nsFastLoadFile.cpp:57:
> nsBinaryStream.h:113:5: error:   overriding 'virtual nsresult nsBinaryInputStream::ReadSegments(nsWriteSegmentFun, void*, PRUint32, PRUint32*)'
>      NS_DECL_NSIINPUTSTREAM
>      ^
> ../../config/rules.mk:1408: recipe for target 'nsFastLoadService.o' failed
> gmake[4]: *** [nsFastLoadService.o] Error 1
> gmake[4]: *** Waiting for unfinished jobs....
> ../../config/rules.mk:1408: recipe for target 'nsFastLoadFile.o' failed


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

* [Bug c++/63650] conflicting type attributes specified for ‘virtual..'
  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
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-10-26 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Richard PALO from comment #3)
> I initially replied that there was an error in my original, please
> correct the first three lines to:
> #ifndef HIDDEN
> #define HIDDEN __attribute__((visibility("hidden")))
> #endif

This now leads to another error in regard  to #endif without #if.

Please provide a complete code that demonstrates the error.
>From gcc-bugs-return-465013-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 26 19:32:10 2014
Return-Path: <gcc-bugs-return-465013-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4084 invoked by alias); 26 Oct 2014 19:32:09 -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 4024 invoked by uid 48); 26 Oct 2014 19:32:04 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/63651] New: Lot of failures in obj(c|-c++) with yosemite
Date: Sun, 26 Oct 2014 19:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
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 cc cf_gcchost cf_gcctarget cf_gccbuild
Message-ID: <bug-63651-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/msg02034.txt.bz2
Content-length: 1823

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

            Bug ID: 63651
           Summary: Lot of failures in obj(c|-c++) with yosemite
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: howarth at bromo dot med.uc.edu, iains at gcc dot gnu.org
              Host: x86_64-apple-darwin14
            Target: x86_64-apple-darwin14
             Build: x86_64-apple-darwin14

I get a lot of failures in obj(c|-c++) with yosemite (4.9.2 and 5.0, see
https://gcc.gnu.org/ml/gcc-testresults/2014-10/msg02799.html). AFAICT they are
of the kind

FAIL: objc.dg/headers.m -fnext-runtime (test for excess errors)
Excess errors:
/usr/include/objc/NSObject.h:22:4: error: unknown type name 'instancetype'
/usr/include/objc/NSObject.h:36:4: error: unknown type name 'instancetype'
/usr/include/objc/NSObject.h:38:4: error: unknown type name 'instancetype'
/usr/include/objc/NSObject.h:60:4: error: unknown type name 'instancetype'
/usr/include/objc/NSObject.h:62:4: error: unknown type name 'instancetype'
/usr/include/objc/NSObject.h:63:4: error: unknown type name 'instancetype'
/usr/include/objc/NSObject.h:64:4: error: unknown type name 'instancetype'
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:187:110:
error: expected ')' before '^' token
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:187:112:
error: expected ')' before '(' token
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:188:41:
error: expected ')' before '^' token
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:188:43:
error: expected ')' before '(' token


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

* [Bug c++/63650] conflicting type attributes specified for ‘virtual..'
  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
  3 siblings, 0 replies; 5+ messages in thread
From: richard at netbsd dot org @ 2014-10-26 20:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard PALO <richard at netbsd dot org> ---
(In reply to Daniel Krügler from comment #4)
> (In reply to Richard PALO from comment #3)
> > I initially replied that there was an error in my original, please
> > correct the first three lines to:
> > #ifndef HIDDEN
> > #define HIDDEN __attribute__((visibility("hidden")))
> > #endif
> 
> This now leads to another error in regard  to #endif without #if.
> 
> Please provide a complete code that demonstrates the error.

you are kidding, no? here it is complete:
--------------->8------------------------------
#ifndef HIDDEN
#define HIDDEN __attribute__((visibility("hidden")))
#endif
#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------------------------------
>From gcc-bugs-return-465015-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 26 20:49:19 2014
Return-Path: <gcc-bugs-return-465015-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2542 invoked by alias); 26 Oct 2014 20:49: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 2513 invoked by uid 48); 26 Oct 2014 20:49:13 -0000
From: "richard at netbsd dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63650]=?UTF-8?Q? conflicting type attributes specified for ‘virtual?=..'
Date: Sun, 26 Oct 2014 21:22: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.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: richard at netbsd 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:
Message-ID: <bug-63650-4-2N4oAjKFIk@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63650-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63650-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/msg02036.txt.bz2
Content-length: 637

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

--- Comment #6 from Richard PALO <richard at netbsd dot org> ---
For that matter, the following is sufficient to
reproduce the problem, the rest is mostly to simulate
the xulrunner environment that is failing to build.
 --------------->8------------------------------
#ifndef CDECL
#define CDECL __attribute__((regparm(0),cdecl))
#endif

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

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

 --------------->8------------------------------

I should perhaps mention that this is on SunOS 5.11 (illumos) i386.


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

* [Bug c++/63650] conflicting type attributes specified for ‘virtual..'
  2014-10-26 17:14 [Bug c++/63650] New: conflicting type attributes specified for ‘virtual..' richard at netbsd dot org
                   ` (2 preceding siblings ...)
  2014-10-26 20:49 ` richard at netbsd dot org
@ 2021-12-26  5:22 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-26  5:22 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|WAITING                     |RESOLVED
      Known to fail|                            |12.0, 5.1.0
         Resolution|---                         |INVALID

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
To summarize here is the full testcase which can be used even to test under
MSVC:
#ifdef __GNUC__
#ifndef CDECL
#define CDECL __attribute__((regparm(0),cdecl))
#endif
#else
#define CDECL __cdecl
#endif

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

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


---- CUT ---
Note MSVC also rejects this code as invalid:
<source>(16): error C2695: 'B::foo': overriding virtual function differs from
'A::foo' only by calling convention
<source>(11): note: see declaration of 'A::foo'

so I think GCC is correct, you need the CDECL on the foo when overriding the
virtual function too. why clang and ICC accepts it, I have no idea maybe ask
them.

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