This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/7983: ICE for friend declaration using typedef in class template
- From: austern at apple dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Sep 2002 00:14:53 -0000
- Subject: c++/7983: ICE for friend declaration using typedef in class template
- Reply-to: austern at apple dot com
>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: