From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8799 invoked by alias); 25 Nov 2007 00:11:44 -0000 Received: (qmail 8766 invoked by uid 48); 25 Nov 2007 00:11:35 -0000 Date: Sun, 25 Nov 2007 00:11:00 -0000 Subject: [Bug c++/34219] New: [4.3] gcc doesn't accept const members of variadic templates as const X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rbuergel at web dot de" 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: 2007-11/txt/msg02346.txt.bz2 template struct max { static const T value = a > max::value ? a : max::value; }; template struct max { static const T value = a > b ? a : b; }; static const int value1 = max< int, 1, 2>::value; static const int value2 = max< int, 1, 3, 5>::value; As the initialization for value1 is accepted as valid, that should be also the case for value2. But g++ fails with the following error: g++-4.3.0 -std=c++0x -c -o test.o test.cpp test.cpp: In instantiation of 'const int max::value': test.cpp:14: instantiated from here test.cpp:4: error: 'max::value' cannot be initialized by a non-constant expression when being declared g++ Version is "gcc version 4.3.0 20071123 (experimental) (GCC)" -- Summary: [4.3] gcc doesn't accept const members of variadic templates as const Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rbuergel at web dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34219