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

Re: [C++ PATCH] (regression) Set TREE_CONSTANT for STATIC_EXPR and CAST_EXPR


Mark Mitchell <mark@codesourcery.com> writes:

| On Wed, 2003-06-18 at 12:20, Gabriel Dos Reis wrote:
| > Jason Merrill <jason@redhat.com> writes:
| > 
| > | Hmm, it seems odd to me that we would be analyzing whether or not an
| > | expression is a constant-expression when parsing a template, since we can't
| > | always tell.
| > 
| > Completly agreed.  Those semantics restrictions should be checked only
| > at full instantiation points. 
| 
| Au contraire!
| 
| They can be checked whenever we want to check them, and early is good.

In processing

  template<class Q>
   struct X {
      typedef typename Q::T T;
      static const T a = Q::a; 
   };

there is no way of knowing whether Q::a is a valid initializer.

-- Gaby


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