From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4284 invoked by alias); 19 Feb 2009 15:20:50 -0000 Received: (qmail 4230 invoked by uid 48); 19 Feb 2009 15:20:36 -0000 Date: Thu, 19 Feb 2009 15:20:00 -0000 Message-ID: <20090219152036.4229.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/39242] [4.4 Regression] Inconsistent reject / accept of code In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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: 2009-02/txt/msg01729.txt.bz2 ------- Comment #8 from rguenth at gcc dot gnu dot org 2009-02-19 15:20 ------- Note that the patch only affects extern explicit template instantiations. /* Check to see whether we know that this template will be instantiated in some other file, as with "extern template" extension. */ external_p = (DECL_INTERFACE_KNOWN (d) && DECL_REALLY_EXTERN (d)); /* In general, we do not instantiate such templates... */ if (external_p /* ... but we instantiate inline functions so that we can inline them and ... */ && ! (TREE_CODE (d) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (d)) For them we would no longer inline (or rather instantiate) not inline declared members. This may affect parts of libstdc++, but I don't know. In YCP the extern trick seems to be used to break a dependency cycle, so the situation is somewhat special. The ultimate question is of course if the standard allows (or even requires) an error here. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39242