Re: [RFC] c++ template instantiation generates zero-sized array (pr 19989)

2005-11-02 Thread Josh Conner
Mark Mitchell wrote: > Josh Conner wrote: > > >>I think this is consistent with my proposal -- the first example was >>non-conforming, but accepted without -pedantic (as we do with other >>zero-sized arrays). The second example was conforming and the only way >>to alter its behavior was with the

Re: [RFC] c++ template instantiation generates zero-sized array (pr 19989)

2005-11-02 Thread Mark Mitchell
Josh Conner wrote: > I think this is consistent with my proposal -- the first example was > non-conforming, but accepted without -pedantic (as we do with other > zero-sized arrays). The second example was conforming and the only way > to alter its behavior was with the -fpermissive option. My po

Re: [RFC] c++ template instantiation generates zero-sized array (pr 19989)

2005-11-02 Thread Josh Conner
Mark Mitchell wrote: > I understand what you're after: tolerate uses of the extension where > it's sufficiently harmless. > > I don't think your proposed solution is correct, though, because we want > to maintain the invariant that all conforming programs compile and > behave as required by the s

Re: [RFC] c++ template instantiation generates zero-sized array (pr 19989)

2005-11-01 Thread Mark Mitchell
Josh Conner wrote: > I've been investigating PR 19989, where we are rejecting code when a > template instantiation generates a zero-sized array, such as: > > template struct A > { > static const int i = 0; > } > > template struct B > { > int x[A::i]; > }; > > B<0> b; > > T

[RFC] c++ template instantiation generates zero-sized array (pr 19989)

2005-11-01 Thread Josh Conner
I've been investigating PR 19989, where we are rejecting code when a template instantiation generates a zero-sized array, such as: template struct A { static const int i = 0; } template struct B { int x[A::i]; }; B<0> b; This is rejected on the grounds that not failing cou