This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ with templates and enum regression ?



The following piece of code used to compile with g++-2.95.2 and 
g++-2.96 19990718 but does not compile with g++-2.96 19991104. If you 
remove the template, then everything compiles OK. I assume this has 
been introduced with function-at-a-time mode. This bug affects the 
blitz library.

ithaque->cat Bug1.C

// Build don't link:
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>

template <typename T>
struct foo {
    enum { A = 4 >= 4, B = (1 ? true : A) };
};
 
foo<int> bar;

ithaque->g++ -v
Reading specs from /usr/local/gcc/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
gcc version 2.95.2 19991024 (release)
ithaque->g++ -c Bug1.C
ithaque->/net/home/robotvis/gnu/bin/egcs/bin/g++ -v
Reading specs from /u/corse/2/robotvis/gnu/bin/egcs/lib/gcc-lib/sparc-sun-solaris2.6/2.96/specs
gcc version 2.96 19990718 (experimental)
ithaque->/net/home/robotvis/gnu/bin/egcs/bin/g++ -c Bug1.C
ithaque->/net/home/robotvis/gnu/egcs/bin/g++ -v
Reading specs from /u/corse/2/robotvis/gnu/egcs/lib/gcc-lib/sparc-sun-solaris2.6/2.96/specs
gcc version 2.96 19991104 (experimental)
ithaque->/net/home/robotvis/gnu/egcs/bin/g++ -c Bug1.C
Bug1.C: In instantiation of `foo<int>':
Bug1.C:6:   instantiated from here
Bug1.C:6: conversion to incomplete type
Bug1.C:6: operands to ?: have different types
Bug1.C:6: enumerator value for `B' not integer constant

 --------------------------------------------------------------------
 Theodore Papadopoulo
 Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]