Commit Graph

5 Commits

Author SHA1 Message Date
Douglas Gregor 580cd4a23e When we're building a CXXExprWithTemporaries, only include those
temporaries that are within our current evaluation context. That way,
nested evaluation contexts (e.g., within a sizeof() expression) won't
see temporaries from outer contexts. Also, make sure to push a new
evaluation context when instantiating the initializer of a variable;
this may be an unevaluated context or a potentially-evaluated context,
depending on whether it's an in-class initializer or not. Fixes PR5672.

llvm-svn: 90460
2009-12-03 17:10:37 +00:00
Douglas Gregor ff790f15c4 Refactor our handling of expression evaluation contexts, so that Sema
maintains a stack of evaluation contexts rather than having the parser
do it. This change made it simpler to track in which contexts
temporaries were created, so that we could...

"Forget" about temporaries created within unevaluated contexts, so
that we don't build a CXXExprWithTemporaries and, therefore, destroy
the integral-constness of our expressions. Fixes PR5609.

llvm-svn: 89908
2009-11-26 00:44:06 +00:00
Owen Anderson 0e0189d64d Update for LLVM API change.
llvm-svn: 77267
2009-07-27 22:29:56 +00:00
Douglas Gregor d612997e73 When instantiating a variable without an initializer, call
ActOnUninitializedDecl.

llvm-svn: 77211
2009-07-27 17:43:39 +00:00
Douglas Gregor ef1a09a336 Implement template instantiation for static data members of class
templates, including in-class initializers. For example:

  template<typename T, T Divisor>
  class X {
  public:
    static const T value = 10 / Divisor;
  };

instantiated with, e.g.,

  X<int, 5>::value

to get the value '2'.

llvm-svn: 67715
2009-03-25 23:32:15 +00:00