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++/10639: using an inner class in a template class, G++ can't detect invalid constructor


>Number:         10639
>Category:       c++
>Synopsis:       using an inner class in a template class, G++ can't detect invalid constructor
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue May 06 09:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Francois Delobel
>Release:        gcc version 2.95.4 20011002 (Debian prerelease) & gcc 3.2.3 20030415 (Debian prerelease) & version gcc 3.3 20030415 (Debian prerelease)
>Organization:
>Environment:
Linux (debian sarge, 2.4.20-k7, running on AMD XP1900)
>Description:
context: using an inner class in a template class

error: g++ can't detect an incorrect line (constructor returning a value) and exits with internal compiler error.

---- essai.cpp (preprocessed, 30 lines)--
# 1 "essai.cpp"
# 1 "<interne>"
# 1 "<ligne de commande>"
# 1 "essai.cpp"
template <class T>
class C {
public:
        class Inner;
        C(const T& t);
};

template <class T>
class C<T>::Inner {
public:
        Inner();
};


template <class T>
C<T>::C(const T& t)
{ }

template <class T>
T C<T>::Inner::Inner()
{ }

int main()
{
        C<int> o(7);
}
>How-To-Repeat:
g++ -Wall -ansi essai.cpp
>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]