Bug 66539 - Internal error when an ?: operator used in template parameter
Internal error when an ?: operator used in template parameter
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-06-11 18:01 EDT by Rafal Dabrowa
Modified: 2007-04-18 12:43 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 16:36:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rafal Dabrowa 2002-06-11 18:01:06 EDT
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 16:36:51 EST
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.