This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/5093: internal error with template template argument class and overloaded out stream operator
- From: tobias dot oberstein at gmx dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 12 Dec 2001 13:26:56 -0000
- Subject: c++/5093: internal error with template template argument class and overloaded out stream operator
- Reply-to: tobias dot oberstein at gmx dot de
>Number: 5093
>Category: c++
>Synopsis: internal error with template template argument class and overloaded out stream operator
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Wed Dec 12 05:36:09 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: tobias.oberstein@gmx.de
>Release: 2.95.3
>Organization:
>Environment:
SuSE Linux 7.2 off-the-shelf
>Description:
Look at this template class, which takes a (unused)
template template argument:
template <typename T,
template <typename> class C = std::vector>
struct Bug
{
T x_;
};
now try the following
Bug<int> x;
std::cout << x;
even without defining the overloaded out operator, g++
will exit with an "internal compiler error" ;(
>How-To-Repeat:
toberste@grenada:~/work/pre/suffixtree > g++ -Wall -o bug bug.cpp
bug.cpp: In function `int main()':
bug.cpp:50: Internal compiler error.
bug.cpp:50: Please submit a full bug report.
bug.cpp:50: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.cpp"
LyoKICogVGhpcyBzb3VyY2UgcmVwcm9kdWNlcyBhIGdjYyBjb21waWxlciBidWcgd2l0aAogKgog
KiAgICAgPj4+IHRlbXBsYXRlIHRlbXBsYXRlIGFyZ3VtZW50cyBhbmQgU1RMIHN0cmVhbXMgPDw8
CiAqCiAqIGdjYyAyLjk1LjMsIFN1U0UgTGludXggNy4yCiAqCiAqIHRvYmlhcy5vYmVyc3RlaW5A
Z214LmRlCiAqIDEyLzEyLzIwMDEKIC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