From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31302 invoked by alias); 4 May 2003 13:46: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 31277 invoked by uid 71); 4 May 2003 13:46:01 -0000 Resent-Date: 4 May 2003 13:46:01 -0000 Resent-Message-ID: <20030504134601.31276.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, gccbugs@contacts.eelis.net Received: (qmail 29655 invoked by uid 48); 4 May 2003 13:39:04 -0000 Message-Id: <20030504133904.29654.qmail@sources.redhat.com> Date: Sun, 04 May 2003 13:46:00 -0000 From: gccbugs@contacts.eelis.net Reply-To: gccbugs@contacts.eelis.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10619: Instantiation through function template return type causes too cryptic error. X-SW-Source: 2003-05/txt/msg00233.txt.bz2 List-Id: >Number: 10619 >Category: c++ >Synopsis: Instantiation through function template return type causes too cryptic error. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Sun May 04 13:46:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Eelis van der Weegen >Release: gcc version 3.2.2 (mingw special 20030208-1) >Organization: >Environment: Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c++,f77,objc --disable-win32-registry --disable-shared --enable-sjlj-exceptions Thread model: win32 >Description: When templates are instantiated through function template return types, errors during the instantiation are not always properly emitted. For example, given the following code: template struct A; template struct F { typename A::type t; }; template typename A::type f (); Instantiating F using: F<0> x; causes a very clear error message: In instantiation of 'F<0>': instantiated from here [..] invalid use of undefined type 'struct A<0>' However, performing the same instantiation through instantiating f() using: f<0>(); causes the following error: no matching function for call to 'f()' This error seems to indicate an argument or CV-qualifier mismatch or something similar. It does not indicate that the problem occurs during the instantiation of the return type. Therefore, I think this error is too cryptic and, since cryptic errors lead to more time spent debugging, needs improvement. Something like: In instantiation of 'f<0>': instatiated from here [..] in instantiation of return type: invalid use of undefined 'struct A<0>' would be ideal. What are your thoughts on this? >How-To-Repeat: Compile the code from the description. >Fix: >Release-Note: >Audit-Trail: >Unformatted: