Commit Graph

11 Commits

Author SHA1 Message Date
John McCall 622114cfe3 Clarify the logic for when to build an overloaded binop. In particular,
build one when either of the operands calls itself type-dependent;
previously we were building when one of the operand types was dependent,
which is not always the same thing and which can lead to unfortunate
inconsistencies later.  Fixes PR8739.

llvm-svn: 120990
2010-12-06 05:26:58 +00:00
Douglas Gregor 1262b0636e Fix an corner-case assertion introduced by the refactoring in r112258;
when we're taking the address of a unresolvable value, it might be an
implicit member access. Fixes some Boost.Spirit regressions.

llvm-svn: 112487
2010-08-30 16:00:47 +00:00
Douglas Gregor 678f90df09 Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

  p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.

llvm-svn: 97092
2010-02-25 01:56:36 +00:00
John McCall 7173903ea6 Unresolved implicit member accesses are dependent if the object type is dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution.  In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.

llvm-svn: 91747
2009-12-19 02:05:44 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Douglas Gregor 01df946664 Make sure to grab CVR qualifiers from the canonical type. ARGH!
llvm-svn: 86079
2009-11-05 00:07:36 +00:00
Douglas Gregor 3c8a0cfa5b When a template-id expression refers to a member function template, turn it into an (implicit) member access expression. Fixes PR5220
llvm-svn: 84848
2009-10-22 07:19:14 +00:00
Douglas Gregor ad8a336b40 Implement AST, semantics, and CodeGen for C++ pseudo-destructor
expressions, e.g.,

  p->~T()

when p is a pointer to a scalar type. 

We don't currently diagnose errors when pseudo-destructor expressions
are used in any way other than by forming a call.

llvm-svn: 81009
2009-09-04 17:36:40 +00:00
Douglas Gregor f816bd70ce Implement tree transformations for DeclarationNames. Among other
things, this means that we can properly cope with member access
expressions such as 

  t->operator T()

where T is a template parameter (or other dependent type).

llvm-svn: 80957
2009-09-03 22:13:48 +00:00
Douglas Gregor 2b6ca46c6b Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.

llvm-svn: 80953
2009-09-03 21:38:09 +00:00
Douglas Gregor 64792e021d Add a wicked little test-case that illustrates what we have to deal
with to properly support member access expressions in templates. This
test is XFAIL'd, because we get it completely wrong, but I've made the
minimal changes to the representation to at least avoid a crash.

llvm-svn: 80856
2009-09-02 23:58:38 +00:00