Bug 66539 - Internal error when an ?: operator used in template parameter
Summary: Internal error when an ?: operator used in template parameter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-06-11 22:01 UTC by Rafal Dabrowa
Modified: 2007-04-18 16:43 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-12-15 21:36:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Rafal Dabrowa 2002-06-11 22:01:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
Construction:
    template <int i, int j> longint<(i>j?i:j)> 
causes an internal compiler error. See Additional information for an example 
program.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Extract program from additional information box and paste to an empty file
2. compile using g++
3.
	

Actual Results:  bug2.cc: In function `int main ()':
bug2.cc:7: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Additional info:

This is an example program:
-------------------------------------------
template <int i>
class longint {};

template <int i, int j>
longint<(i>j?i:j)> operator+( longint<i> a, longint<j> b )
{
}

int main()
{
    longint<3> a;
    longint<4> b, c;

    c = a+b;
}

Comment 1 Alan Cox 2002-12-15 21:36:51 UTC
Verified this works ok on g++ 3.2 / 8.0



Note You need to log in before you can comment on or make changes to this bug.