From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11128 invoked by alias); 2 May 2006 20:59:53 -0000 Received: (qmail 10946 invoked by uid 48); 2 May 2006 20:59:49 -0000 Date: Tue, 02 May 2006 20:59:00 -0000 Subject: [Bug c++/27402] New: error on SFINAE X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sebor at roguewave dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg00221.txt.bz2 List-Id: I believe the program below is well-formed (the latest EDG eccp 3.7 concurs), but gcc 4.1.0 rejects it. $ cat t.cpp && gcc --version && gcc t.cpp template struct A { typedef int I; }; struct X { }; template struct B { typedef typename T::J J; }; template struct B { typedef X J; }; template typename A::I foo (T) { return 0; } template typename B::J foo (T) { return typename B::J (); } int main () { foo (""); } gcc (GCC) 4.1.0 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. t.cpp: In function 'int main()': t.cpp:15: error: invalid operands of types 'const char*' and 'const char*' to binary 'operator|' -- Summary: error on SFINAE Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sebor at roguewave dot com GCC build triplet: sparc-sun-solaris2.9 GCC host triplet: sparc-sun-solaris2.9 GCC target triplet: sparc-sun-solaris2.9 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27402