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++/7983: ICE for friend declaration using typedef in class template


>Number:         7983
>Category:       c++
>Synopsis:       ICE for friend declaration using typedef in class template
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 19 17:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     austern@apple.com
>Release:        3.1, TOT
>Organization:
>Environment:
Linux, MacOS X
>Description:
The following snippet gives misleading warnings and an ICE:
template<class T> class smart_ptr2 {
    T* real_ptr;
 public:
    typedef typename T::subT  td;
    friend class td;
};

There is a real error in this code: it's illegal to use an elaborated-type-specifier with a typedef name.  (7.1.3, paragraph 4, and 7.1.5.3.)  However, an ICE is not the friendliest diagnostic.

The ICE is in pop_binding.
>How-To-Repeat:

>Fix:

>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]