This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7550: g++ 3.1 does not compile legal struct declaration under special circumstances


>Number:         7550
>Category:       c++
>Synopsis:       g++ 3.1 does not compile legal struct declaration under special circumstances
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 09 04:46:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jochen Theis
>Release:        3.1 (MinGW port)
>Organization:
>Environment:
Windows NT, service pack 4
>Description:
The compiler does not accept the following code:

template <class C>
class Array
{};

typedef struct { struct { } Array; } TESTSTRUCT;

It appears to interpret the token "Array" in the last line to refer to the template class declaration above. The problem does not occur when class Array is not declared as a template class or when the inner struct{} is replaced by a simple type.

The problem occurred originally in the file "winnt.h" in the MinGW distribution of GCC 3.1 for some code where a template class Array was also defined before including "winnt.h".
>How-To-Repeat:
Compile the five code lines in the description with g++ 3.1.
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]