This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34774] [4.1/4.2/4.3 Regression] templates, enumerations, overflow, ice
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jan 2008 19:24:37 -0000
- Subject: [Bug c++/34774] [4.1/4.2/4.3 Regression] templates, enumerations, overflow, ice
- References: <bug-34774-9709@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-01-13 19:24 -------
Reduced testcase that is accepted by 3.3 and 3.4 w/o diagnostic but ICEs
starting with 4.0.
typedef unsigned int op_type_u_t;
typedef op_type_u_t op_type_t;
template<int shifts, op_type_u_t sig>
struct shift {
enum {
num_bits = op_type_u_t(sizeof(op_type_t) * 8),
max_shift = num_bits - 1u,
is_left = shifts < 0 ? true : false,
n0 = is_left ? op_type_u_t(-shifts) : op_type_u_t(shifts),
n = n0 > max_shift ? max_shift : n0,
n_comp = max_shift - n
} x;
};
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34774