This is the mail archive of the 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]
Other format: [Raw text]

Re: PATCH C++: speed up templates

On Thursday, Feb 20, 2003, at 10:53 US/Pacific, Mark Mitchell wrote:

--On Thursday, February 20, 2003 10:49:28 AM -0800 Matt Austern <austern at apple dot com> wrote:

Giving a friendlier diagnostic for incorrect code, at the cost of being
slower when compiling correct programs, isn't obviously a good tradeoff.

It's not a friendlier diagnostic -- the compiler now *terminates*.

Running forever is pretty unfriendly.

Well... I'm having difficulty reproducing the infinite loop which your patch purports to fix!

I checked out the sources as of 2002-11-08T01:00-0000, i.e., right _before_ your patch went in, and built the compiler.
Then, I tried compiling your crash2.C test case with it, expecting the compiler to hang. No such luck (see below).
This is all under RedHat Linux 8.0.

So, can you point me to a date or release tag where the bug is reproducible?



======================================================================== =======

zlaski at johada4:tests> cat mark.templ.crash2.C
// { dg-options "" }

template <class EnumType>
class A
  static const EnumType size = max; // { dg-error "" }
  int table[size];
template <class EnumType>
const EnumType A<EnumType>::size;

namespace N { enum E { max = 5 };

struct B
  A<E> a; // { dg-error "" }


  N::B b;

return 0;
zlaski at johada4:tests> gcc_r 2002. g++ -c mark.templ.crash2.C
+ /home/zlaski/fsf/dst/gcc/2002. -c mark.templ.crash2.C
mark.templ.crash2.C: In instantiation of `A<N::E>':
mark.templ.crash2.C:20: instantiated from here
mark.templ.crash2.C:7: error: `max' was not declared in this scope

real    0m0.021s
user    0m0.014s
sys     0m0.008s
+ exit 1

Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477

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