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++/6424: sizeof() with overload resolution (core issue 339)



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]