From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21335 invoked by alias); 12 Nov 2006 11:04:54 -0000 Received: (qmail 21303 invoked by uid 48); 12 Nov 2006 11:04:46 -0000 Date: Sun, 12 Nov 2006 11:04:00 -0000 Message-ID: <20061112110446.21302.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/29518] [4.0/4.1/4.2/4.3 Regression] rejects valid template argument, enums vs templates In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "news at derived-software dot ltd dot uk" 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 X-SW-Source: 2006-11/txt/msg01035.txt.bz2 List-Id: ------- Comment #12 from news at derived-software dot ltd dot uk 2006-11-12 11:04 ------- >>From Aleksey Gurtovoy (co-author Boost.MPL): [wrt to this bug] Actually, no, enums in the bug's subject and reduced test case are a red herring. For example, this still fails for me on 4.1.1: template< int C > int assertion_failed(int); template< class > struct N { static int const value = 1; static int const t = sizeof( assertion_failed(0) ); }; int main() { N n; return n.t; } As a matter of fact, my current workaround for this issue involves _introducing_ an auxiliary enum for the values that are used in function templates' non-type arguments, e.g.: template< int C > int assertion_failed(int); template< class > struct N { static int const value = 1; enum { gcc_workaround = value }; static int const t = sizeof( assertion_failed(0) ); // it compiles, yay! }; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29518