From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21143 invoked by alias); 4 Mar 2005 15:05:24 -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 20774 invoked by uid 48); 4 Mar 2005 15:05:16 -0000 Date: Fri, 04 Mar 2005 15:05:00 -0000 Message-ID: <20050304150516.20771.qmail@sourceware.org> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20000312002600.99.martin@loewis.home.cs.tu-berlin.de> References: <20000312002600.99.martin@loewis.home.cs.tu-berlin.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/99] Bug in template type in error message. X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg00521.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2005-03-04 15:05 ------- Here's another very nice example from PR 20313: ------------------------- template struct s; template s::s(int j) {} ------------------------- Note that the definition of the constructor is invalid because the struct isn't complete. Here's what we get: g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc x.cc:2: error: invalid use of undefined type ?struct s? x.cc:1: error: declaration of ?struct s? x.cc:2: error: template definition of non-template ?s::s(int)? Note how the compiler uses the template argument 'j', although we use template argument 'i' in line 2! W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=99