c++/10867: Internal compiler error with constant enum
llewins@raytheon.com
llewins@raytheon.com
Mon May 19 17:53:00 GMT 2003
>Number: 10867
>Category: c++
>Synopsis: Internal compiler error with constant enum
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 19 16:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Lloyd Lewins
>Release: gcc version 3.2
>Organization:
>Environment:
Cygwin
>Description:
The attached file generates the following error:
conversion.cc:8: warning: all member functions in class `Conversion<T, U>' are
private
conversion.cc: In instantiation of `const unsigned int Conversion<double, int>::
t':
conversion.cc:23: instantiated from `Conversion<double, int>'
conversion.cc:23: instantiated from here
conversion.cc:15: Internal compiler error in instantiate_decl, at cp/pt.c:10052
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="conversion.cc"
Content-Disposition: inline; filename="conversion.cc"
#include <vector>
#include <iostream>
using namespace std;
template<class T, class U>
class Conversion
{
typedef char Small;
class Big { char dummy[2]; };
static Small Test(U);
static Big Test(...);
static T MakeT();
public:
static const unsigned t = sizeof(MakeT());
enum {
exists = t
};
};
int main(void)
{
Conversion<double, int> d;
}
More information about the Gcc-bugs
mailing list