From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2309 invoked by alias); 11 May 2005 10:28:07 -0000 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 Received: (qmail 2262 invoked by uid 48); 11 May 2005 10:28:01 -0000 Date: Wed, 11 May 2005 10:28:00 -0000 From: "sven at clio dot in-berlin dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20050511102800.21510.sven@clio.in-berlin.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/21510] New: Possible bug X-Bugzilla-Reason: CC X-SW-Source: 2005-05/txt/msg01498.txt.bz2 List-Id: The following code contains a test template is_class which tries to determine, if the given argument is a class. Unlike other implementations it should not return true if the argument is a union. I have used the 'substitution failure is not an error' principle but g++ V3.3.5 (Debian 1:3.3.5-12) (i486-linux) fails with an error though it has a default function available. Since I do not have the standard I can't declare this a bug. ---- bug.c cusing namespace std; #include template struct is_class { typedef char no; struct yes { char c[2]; }; template struct c: _U { c(int); }; template static no test (...); template static yes test(c<_U>); static const bool v = (sizeof (test<_T>(0))==sizeof(yes)); }; union u { int i; double f; }; struct c {}; int main (void) { cout << "union:" << is_class::v << endl; cout << "class:" << is_class::v << endl; cout << "int:" << is_class::v << endl; return 0; }; -- Summary: Possible bug Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sven at clio dot in-berlin dot de CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i486-linux GCC host triplet: i486-linux GCC target triplet: i486-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21510