public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38764] New: bogus 'changes meaning' error?
@ 2009-01-08 12:22 pluto at agmk dot net
2009-01-08 12:50 ` [Bug c++/38764] " rguenth at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: pluto at agmk dot net @ 2009-01-08 12:22 UTC (permalink / raw)
To: gcc-bugs
following code snipet is reducted testcase from external application.
g++ and comeau online accept/reject source differently.
template < class T >
struct A
{
};
template < class U >
struct B
{
#if 1
typedef A< float > A; // <-- accepted by comeau but...
// g++: error: declaration of typedef struct A<float> B<U>::A
// g++: error: changes meaning of A from struct A<float>
#else
typedef ::A< float > A; // <-- accepted by g++ but...
// comeau: class member typedef may not be redeclared
// typedef ::A< float > A;
// ^
#endif
};
--
Summary: bogus 'changes meaning' error?
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/38764] bogus 'changes meaning' error?
2009-01-08 12:22 [Bug c++/38764] New: bogus 'changes meaning' error? pluto at agmk dot net
@ 2009-01-08 12:50 ` rguenth at gcc dot gnu dot org
2009-01-08 12:56 ` pluto at agmk dot net
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-08 12:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2009-01-08 12:50 -------
I suggest filing a problem report with Comeau. EDG accepts both in
-strict_ansi mode.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/38764] bogus 'changes meaning' error?
2009-01-08 12:22 [Bug c++/38764] New: bogus 'changes meaning' error? pluto at agmk dot net
2009-01-08 12:50 ` [Bug c++/38764] " rguenth at gcc dot gnu dot org
@ 2009-01-08 12:56 ` pluto at agmk dot net
2009-01-08 19:16 ` [Bug c++/38764] New: " Andrew Thomas Pinski
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pluto at agmk dot net @ 2009-01-08 12:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pluto at agmk dot net 2009-01-08 12:56 -------
(In reply to comment #1)
> I suggest filing a problem report with Comeau. EDG accepts both in
> -strict_ansi mode.
>
i've tested it on comeau online to verify g++ behaviour :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bug c++/38764] New: bogus 'changes meaning' error?
2009-01-08 12:22 [Bug c++/38764] New: bogus 'changes meaning' error? pluto at agmk dot net
2009-01-08 12:50 ` [Bug c++/38764] " rguenth at gcc dot gnu dot org
2009-01-08 12:56 ` pluto at agmk dot net
@ 2009-01-08 19:16 ` Andrew Thomas Pinski
2009-01-08 19:16 ` [Bug c++/38764] " pinskia at gmail dot com
2009-01-09 19:39 ` pluto at agmk dot net
4 siblings, 0 replies; 6+ messages in thread
From: Andrew Thomas Pinski @ 2009-01-08 19:16 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
On Jan 8, 2009, at 4:22 AM, "pluto at agmk dot net" <gcc-bugzilla@gcc.gnu.org
> wrote:
> following code snipet is reducted testcase from external application.
> g++ and comeau online accept/reject source differently.
>
> template < class T >
> struct A
> {
> };
> template < class U >
> struct B
> {
> #if 1
> typedef A< float > A; // <-- accepted by comeau but...
> // g++: error: declaration of typedef struct A<float> B<U>::A
> // g++: error: changes meaning of A from struct A<float>
> #else
> typedef ::A< float > A; // <-- accepted by g++ but...
> // comeau: class member typedef may not be redeclared
> // typedef ::A< float > A;
> // ^
> #endif
> };
GCC is correct. This code is invalid but the standard says for this
case no diagnostic is required so both compilers are correct according
to the standard. Just that edg could be enchened to error about this
case.
>
>
>
> --
> Summary: bogus 'changes meaning' error?
> Product: gcc
> Version: 4.3.3
> Status: UNCONFIRMED
> Severity: normal
> Priority: P3
> Component: c++
> AssignedTo: unassigned at gcc dot gnu dot org
> ReportedBy: pluto at agmk dot net
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/38764] bogus 'changes meaning' error?
2009-01-08 12:22 [Bug c++/38764] New: bogus 'changes meaning' error? pluto at agmk dot net
` (2 preceding siblings ...)
2009-01-08 19:16 ` [Bug c++/38764] New: " Andrew Thomas Pinski
@ 2009-01-08 19:16 ` pinskia at gmail dot com
2009-01-09 19:39 ` pluto at agmk dot net
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gmail dot com @ 2009-01-08 19:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gmail dot com 2009-01-08 19:16 -------
Subject: Re: New: bogus 'changes meaning' error?
On Jan 8, 2009, at 4:22 AM, "pluto at agmk dot net" <gcc-bugzilla@gcc.gnu.org
> wrote:
> following code snipet is reducted testcase from external application.
> g++ and comeau online accept/reject source differently.
>
> template < class T >
> struct A
> {
> };
> template < class U >
> struct B
> {
> #if 1
> typedef A< float > A; // <-- accepted by comeau but...
> // g++: error: declaration of typedef struct A<float> B<U>::A
> // g++: error: changes meaning of A from struct A<float>
> #else
> typedef ::A< float > A; // <-- accepted by g++ but...
> // comeau: class member typedef may not be redeclared
> // typedef ::A< float > A;
> // ^
> #endif
> };
GCC is correct. This code is invalid but the standard says for this
case no diagnostic is required so both compilers are correct according
to the standard. Just that edg could be enchened to error about this
case.
>
>
>
> --
> Summary: bogus 'changes meaning' error?
> Product: gcc
> Version: 4.3.3
> Status: UNCONFIRMED
> Severity: normal
> Priority: P3
> Component: c++
> AssignedTo: unassigned at gcc dot gnu dot org
> ReportedBy: pluto at agmk dot net
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/38764] bogus 'changes meaning' error?
2009-01-08 12:22 [Bug c++/38764] New: bogus 'changes meaning' error? pluto at agmk dot net
` (3 preceding siblings ...)
2009-01-08 19:16 ` [Bug c++/38764] " pinskia at gmail dot com
@ 2009-01-09 19:39 ` pluto at agmk dot net
4 siblings, 0 replies; 6+ messages in thread
From: pluto at agmk dot net @ 2009-01-09 19:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pluto at agmk dot net 2009-01-09 19:39 -------
as mentioned, gcc is correct.
--
pluto at agmk dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-09 19:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-08 12:22 [Bug c++/38764] New: bogus 'changes meaning' error? pluto at agmk dot net
2009-01-08 12:50 ` [Bug c++/38764] " rguenth at gcc dot gnu dot org
2009-01-08 12:56 ` pluto at agmk dot net
2009-01-08 19:16 ` [Bug c++/38764] New: " Andrew Thomas Pinski
2009-01-08 19:16 ` [Bug c++/38764] " pinskia at gmail dot com
2009-01-09 19:39 ` pluto at agmk dot net
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).