From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24540 invoked by alias); 3 Dec 2001 17:16:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24499 invoked by uid 71); 3 Dec 2001 17:16:01 -0000 Resent-Date: 3 Dec 2001 17:16:01 -0000 Resent-Message-ID: <20011203171601.24498.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, scott_k_macdonald@yahoo.com Received:(qmail 22579 invoked by uid 61); 3 Dec 2001 17:11:00 -0000 Message-Id:<20011203171100.22571.qmail@sources.redhat.com> Date: Mon, 03 Dec 2001 09:16:00 -0000 From: scott_k_macdonald@yahoo.com Reply-To: scott_k_macdonald@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.2 (1.1.1.1.2.21) Subject: c++/4990: ice when using multiple non-class template parameters (works on 2.95.3) X-SW-Source: 2001-12/txt/msg00239.txt.bz2 List-Id: >Number: 4990 >Category: c++ >Synopsis: ice when using multiple non-class template parameters (works on 2.95.3) >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Mon Dec 03 09:16:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Scott MacDonald >Release: gcc-3.0.2 >Organization: >Environment: Red Hat Linux 7.1, Intel >Description: This problem is an extension of bug #3911. The code posted in that report compiles fine, but the addition of another operator causes an Internal error: Segmentation fault . The code works fine using gcc 2.95.3 and using Comeau Computing's online compiler (4.2.45.2). This was the result of a compile of test-1.cc (code below). > g++ test-1.cc test1.cc: In function `int main()': test1.cc:28: Internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. As a side note I also posted this a while back but the version was a snapshot and not a full release. That posting (#4377) seems to have been lost in the noise. I reposted because I don't have access to modify a report and the end results are slightly different. =================================================== code for test1.cc template < int I1, int I2 > class unit { public: unit() {} unit( const unit& ) {} template< int Q1, int Q2 > unit< I1 + Q1, I2 + Q2 > operator * ( const unit< Q1, Q2 >& rhs ) const { return unit< I1 + Q1, I2 + Q2 >(); } template< int Q1, int Q2 > unit< I1 - Q1, I2 - Q2 > operator / ( const unit< Q1, Q2 >& rhs ) const { return unit< I1 - Q1, I2 - Q2 >(); } }; int main() { const unit<1,0> u1; const unit<2,0> u2; unit<-1,0> u3( u1 / u2 ); unit< 3,0> u4( u1 * u2 ); } >How-To-Repeat: g++ test1.cc >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/x-c++src; name="test1.cc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test1.cc" Cgp0ZW1wbGF0ZSA8IGludCBJMSwgaW50IEkyID4KY2xhc3MgdW5pdAp7CnB1YmxpYzoKIHVuaXQo KSB7fQogdW5pdCggY29uc3QgdW5pdDxJMSxJMj4mICkge30KCiB0ZW1wbGF0ZTwgaW50IFExLCBp bnQgUTIgPgogdW5pdDwgSTEgKyBRMSwgSTIgKyBRMiA+IG9wZXJhdG9yICogKCBjb25zdCB1bml0 PCBRMSwgUTIgPiYgcmhzICkgY29uc3QgewogcmV0dXJuIHVuaXQ8IEkxICsgUTEsIEkyICsgUTIg PigpOwogfQogCiB0ZW1wbGF0ZTwgaW50IFExLCBpbnQgUTIgPgogdW5pdDwgSTEgLSBRMSwgSTIg LSBRMiA+IG9wZXJhdG9yIC8gKCBjb25zdCB1bml0PCBRMSwgUTIgPiYgcmhzICkgY29uc3Qgewog cmV0dXJuIHVuaXQ8IEkxIC0gUTEsIEkyIC0gUTIgPigpOwogfQogCn07CiAKaW50IG1haW4oKQp7 CiBjb25zdCB1bml0PDEsMD4gdTE7CiBjb25zdCB1bml0PDIsMD4gdTI7CiAKIHVuaXQ8LTEsMD4g dTMoIHUxIC8gdTIgKTsKIHVuaXQ8IDMsMD4gdTQoIHUxICogdTIgKTsKfQoK