This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/6424: sizeof() with overload resolution (core issue 339)
- From: Jens dot Maurer at gmx dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 23 Apr 2002 14:13:33 -0000
- Subject: c++/6424: sizeof() with overload resolution (core issue 339)
- Reply-to: Jens dot Maurer at gmx dot net
>Number: 6424
>Category: c++
>Synopsis: sizeof() with overload resolution (core issue 339)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Apr 23 07:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Jens Maurer
>Release: gcc version 3.0.4
>Organization:
>Environment:
Linux 2.4.17
>Description:
The attached program causes gcc 3.0.4 to die with:
const-expression-i339.cc: In function `int main()':
const-expression-i339.cc:11: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
A similar death occurs with gcc version 3.2 20020325 (experimental)
See ISO C++ core issue 339.
>How-To-Repeat:
template <int I> struct A {};
char xxx(int);
char xxx(float);
template <class T> A<sizeof(xxx((T)0))> f(T){}
int main()
{
f(1);
}
>Fix:
According to John Spicer, a solution might require
enhancing template name mangling to be able to include
arbitrary expressions.
>Release-Note:
>Audit-Trail:
>Unformatted: