From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23692 invoked by alias); 22 Nov 2006 14:57:26 -0000 Received: (qmail 23574 invoked by uid 48); 22 Nov 2006 14:57:12 -0000 Date: Wed, 22 Nov 2006 14:57:00 -0000 Message-ID: <20061122145712.23573.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/29927] template instantiation with function type In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "s__nakayama at infoseek dot jp" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-11/txt/msg01946.txt.bz2 ------- Comment #3 from s__nakayama at infoseek dot jp 2006-11-22 14:57 ------- (In reply to comment #2) (In reply to comment #2) > What exactly do you expect the code to do? > foo(); > leads to an instantiation of foo with > T= int()() > i.e. reference to "no-arg function returning int". From > thereon I am a bit confused what exactly you intend to > do in foo()... I expected that the compiler reject it. But Comeau compiler also accepted this code. gcc 2.95.3 don't generate code that causes segmentation fault.(LINK error) another test case: following invalid code causes ICE. template void foo() { T bar = 0; bar(); } int main() { foo(); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29927