From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32382 invoked by alias); 9 Feb 2003 03:16:01 -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 32343 invoked by uid 71); 9 Feb 2003 03:16:01 -0000 Resent-Date: 9 Feb 2003 03:16:01 -0000 Resent-Message-ID: <20030209031601.32342.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, poschmid@lbl.gov Received: (qmail 32080 invoked from network); 9 Feb 2003 03:13:16 -0000 Received: from unknown (HELO peem.als.lbl.gov) (131.243.70.122) by 172.16.49.205 with SMTP; 9 Feb 2003 03:13:16 -0000 Received: from peem.als.lbl.gov (localhost.localdomain [127.0.0.1]) by peem.als.lbl.gov (8.12.5/8.12.5) with ESMTP id h193DFP2029312 for ; Sat, 8 Feb 2003 19:13:15 -0800 Received: (from pschmid@localhost) by peem.als.lbl.gov (8.12.5/8.12.5/Submit) id h193DFU6029310; Sat, 8 Feb 2003 19:13:15 -0800 Message-Id: <200302090313.h193DFU6029310@peem.als.lbl.gov> Date: Sun, 09 Feb 2003 03:16:00 -0000 From: peter schmid Reply-To: poschmid@lbl.gov To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c++/9634: Problems with templates (SFINAE) X-SW-Source: 2003-02/txt/msg00425.txt.bz2 List-Id: >Number: 9634 >Category: c++ >Synopsis: Problems with templates (SFINAE) >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Sun Feb 09 03:16:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Peter Schmid >Release: 3.4 20030204 (experimental) >Organization: LBNL >Environment: System: Linux linux 2.4.19-4GB #1 Wed Nov 27 00:56:40 UTC 2002 i686 unknown Architecture: i686 SuSE 8.1 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c++,f77,objc --enable-__cxa_atexit --disable-nls >Description: g++ 3.4 does not accept the code taken from traits/isclasst.hpp from >How-To-Repeat: source code t.C template class IsFunctionT { private: typedef char One; typedef struct { char a[2]; } Two; template static One test(...); template static Two test(U (*)[1]); public: enum { Yes = sizeof(IsFunctionT::test(0)) == 1 }; enum { No = !Yes }; }; compiling t.C gcc 3.4 g++ -v t.C -W -Wall Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs Configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c++,f77,objc --enable-__cxa_atexit --disable-nls Thread model: posix gcc version 3.4 20030204 (experimental) /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=4 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE t.C -D__GNUG__=3 -quiet -dumpbase t.C -auxbase t -W -Wall -version -o /tmp/ccSkY98I.s GNU C++ version 3.4 20030204 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 3.4 20030204 (experimental). ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include/c++/3.4 /usr/local/include/c++/3.4/i686-pc-linux-gnu /usr/local/include/c++/3.4/backward /usr/local/include /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include /usr/include End of search list. t.C:9: error: expected primary-expression t.C:2: warning: all member functions in class `IsFunctionT' are private gcc 3.2 /usr/bin/g++ -v t.C -W -Wall Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.2/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux Thread model: posix gcc version 3.2 /usr/lib/gcc-lib/i486-suse-linux/3.2/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i486__ t.C -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase t.C -W -Wall -version -o /tmp/cctz9rQi.s GNU CPP version 3.2 (cpplib) (i386 Linux/ELF) GNU C++ version 3.2 (i486-suse-linux) compiled by GNU C version 3.2. #include "..." search starts here: #include <...> search starts here: /usr/include/g++ /usr/include/g++/i486-suse-linux /usr/include/g++/backward /usr/local/include /usr/lib/gcc-lib/i486-suse-linux/3.2/include /usr/i486-suse-linux/include /usr/include End of search list. t.C:2: warning: all member functions in class `IsFunctionT' are private /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/as -V -Qy -o /tmp/ccfqXMMs.o /tmp/cctz9rQi.s GNU assembler version 2.12.90.0.15 (i486-suse-linux) using BFD version 2.12.90.0.15 20020717 (SuSE) /usr/lib/gcc-lib/i486-suse-linux/3.2/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../crt1.o /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../crti.o /usr/lib/gcc-lib/i486-suse-linux/3.2/crtbegin.o -L/usr/lib/gcc-lib/i486-suse-linux/3.2 -L/usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/lib -L/usr/lib/gcc-lib/i486-suse-linux/3.2/../../.. /tmp/ccfqXMMs.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc-lib/i486-suse-linux/3.2/crtend.o /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../crtn.o /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../crt1.o: In function `_start': /usr/lib/gcc-lib/i486-suse-linux/3.2/../../../crt1.o(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status >Fix: >Release-Note: >Audit-Trail: >Unformatted: >the book C++ templates by Vandevoorde and Josuttis. gcc 3.2 accepts >this code. I believe this a regression.