From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30096 invoked by alias); 19 May 2004 14:07:49 -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 30008 invoked by uid 48); 19 May 2004 14:07:46 -0000 Date: Thu, 20 May 2004 15:10:00 -0000 Message-ID: <20040519140746.30007.qmail@sourceware.org> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040519095559.15538.igodard@pacbell.net> References: <20040519095559.15538.igodard@pacbell.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15538] Message does not indicate that we are trying to look into an incomplete type X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg02146.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2004-05-19 14:07 ------- The problem is actually simpler: --------------- template struct A { typename D::Q r;}; template struct H : A > { typedef G* Q; }; H h; --------------- While you can pass the incomplete type H as a template argument to the base class, you can't look into it from the base class (precisely because it is incomplete at the time). We get this here: g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In instantiation of `A >': x.cc:5: instantiated from `H' x.cc:7: instantiated from here x.cc:2: error: no type named `Q' in `struct H' This is indeed not very helpful, since there _is_ a type Q in H. While the code is invalid, we could do a better job with the diagnostic. Here is, for example, what we get from icc: g/x> icc -Xc -ansi -c x.cc x.cc(2): error: incomplete type is not allowed struct A { typename D::Q r;}; ^ detected during: instantiation of class "A [with D=H]" at line 5 instantiation of class "H [with G=bool]" at line 7 compilation aborted for x.cc (code 2) W. -- What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |2.95.3 3.3.1 3.0.4 3.4.0 | |3.5.0 Summary|Fails to recognize type name|Message does not indicate | |that we are trying to look | |into an incomplete type http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15538