summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-17/+17
| | | | | | to the new constants. llvm-svn: 112047
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-251-4/+3
| | | | llvm-svn: 112044
* Move more stuff out of Sema.h.John McCall2010-08-251-1/+3
| | | | llvm-svn: 112026
* Catch the case of trying to turn '&(X::a)' into a member pointer as well.John McCall2010-08-241-10/+20
| | | | llvm-svn: 111997
* When trying to resolve the address of an overloaded expression,John McCall2010-08-241-7/+27
| | | | | | | | only form pointers-to-member if the expression has the appropriate form. This avoids assertions later on on invalid code, but also allows us to properly resolve mixed-staticity overloads. llvm-svn: 111987
* Move some of SemaOverload's API to various places in Overload.h, and killJohn McCall2010-08-241-321/+380
| | | | | | some of it off completely. llvm-svn: 111957
* Struggle mightily against header inclusion in Sema.h.John McCall2010-08-241-0/+2
| | | | llvm-svn: 111904
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-20/+20
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Fold ASTOwningResult back into ActionResult.John McCall2010-08-241-2/+2
| | | | llvm-svn: 111902
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-80/+56
| | | | llvm-svn: 111863
* In Sema::AddBuiltinOperatorCandidates, candidate pointer types set can also ↵Argyrios Kyrtzidis2010-08-231-14/+12
| | | | | | | | contain a ObjCObjectPointerType since r111699. Don't assume that they are only PointerTypes or we will crash. llvm-svn: 111798
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-1/+1
| | | | llvm-svn: 111795
* twik to my previous patch for pr7936.Fariborz Jahanian2010-08-211-2/+8
| | | | | | | Build qualified version of ObjC pointers (not pointers) when doing overload resolution. llvm-svn: 111740
* patch to support comparison involvingFariborz Jahanian2010-08-211-6/+14
| | | | | | objctive-c pointer conversions. Fixes pr7936. llvm-svn: 111699
* Remove dead code.Fariborz Jahanian2010-08-201-3/+1
| | | | llvm-svn: 111693
* Rmove dead code.Fariborz Jahanian2010-08-201-3/+0
| | | | llvm-svn: 111680
* We don't actually need to check the implicit object argument'sDouglas Gregor2010-08-191-15/+0
| | | | | | | | | conversion a second time for a conversion candidate (with the real acting context), because the only problems we would find are access or ambiguity issues that won't be diagnosed until we pick this candidate. Add a test case to prove it to myself. llvm-svn: 111526
* Properly implement the part of C++ [over.match.funcs]p4 that treatsDouglas Gregor2010-08-191-9/+29
| | | | | | | | | | | conversion functions as if their acting context were the class that we're converting from (the implicit object argument's type). Retroactively tweaking the implicit conversion sequence, as we were trying to do before, breaks the invariants of that implicit conversion sequence (e.g., the types and conversions don't match up). Fixes <rdar://problem/8018274>. llvm-svn: 111520
* Include a proper citation for the wacky hijinks involving conversion ↵Douglas Gregor2010-08-191-3/+5
| | | | | | functions and the implicit object parameter type. No functionality change. llvm-svn: 111519
* There is no pointer conversion between to similar types (i.e., sameDouglas Gregor2010-08-181-0/+5
| | | | | | | type ignoring cv-qualifiers). These are qualification conversions. Fixes PR7934. llvm-svn: 111428
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-3/+3
| | | | llvm-svn: 110945
* Handle the obvious case for diagnosing redeclarations of extern "C" functions.John McCall2010-08-121-0/+5
| | | | | | Fixes PR7859. llvm-svn: 110906
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-4/+11
| | | | llvm-svn: 110860
* Improve our handling of user-defined conversions when computingDouglas Gregor2010-08-111-61/+95
| | | | | | | | | | | | | | | | | | | | | | implicit conversion sequences. In particular, model the "standard conversion" from a class to its own type (or a base type) directly as a standard conversion in the normal path *without* trying to determine if there is a valid copy constructor. This appears to match the intent of C++ [over.best.ics]p6 and more closely matches GCC and EDG. As part of this, model non-lvalue reference initialization via user-defined conversion in overloading the same way we handle it in InitializationSequence, separating the "general user-defined conversion" and "conversion to compatible class type" cases. The churn in the overload-call-copycon.cpp test case is because the test case was originally wrong; it assumed that we should do more checking for copy constructors that we actually should, which affected overload resolution. Fixes PR7055. Bootstrapped okay. llvm-svn: 110773
* Silence GCC warning about && and || without explicit grouping.Chandler Carruth2010-08-081-2/+2
| | | | llvm-svn: 110537
* Allow reference binding of a reference of Objective-C object type toDouglas Gregor2010-08-071-7/+20
| | | | | | | | an lvalue of another, compatible Objective-C object type (e.g., a subclass). Introduce a new initialization sequence step kind to describe this binding, along with a new cast kind. Fixes PR7741. llvm-svn: 110513
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-9/+10
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Introduce implicit conversions between AltiVec vectors and GCCDouglas Gregor2010-08-061-9/+13
| | | | | | vectors, from Anton Yartsev! llvm-svn: 110437
* TDK_InconsistentQuals is really totally different from TDK_Inconsistent.John McCall2010-08-051-8/+31
| | | | | | | Rename it to TDK_Underqualified to avoid this sort of confusion and give it its own diagnostic. llvm-svn: 110318
* Get rid of isObjectType; when C++ says "object type", it generallyEli Friedman2010-08-051-2/+3
| | | | | | | just means "not a function type", not "not a function type or void". This changes behavior slightly, but generally in a way which accepts more code. llvm-svn: 110303
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-24/+4
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-3/+5
| | | | llvm-svn: 108807
* When determining whether an overload set with explicit templateDouglas Gregor2010-07-141-1/+2
| | | | | | | arguments only resolves to a single specialization, make sure to look through using declarations. Fixes PR7641. llvm-svn: 108376
* Whenever we're creating an expression that is typically an rvalueDouglas Gregor2010-07-131-1/+1
| | | | | | | | | | | | | | | | (e.g., a call, cast, etc.), immediately adjust the expression's type to strip cv-qualifiers off of all non-class types (in C++) or all types (in C). This effectively extends my previous fix for PR7463, which was restricted to calls, to other kinds of expressions within similar characteristics. I've audited every use of getNonReferenceType() in the code base, switching to the newly-renamed getNonLValueExprType() where necessary. Big thanks to Eli for pointing out just how incomplete my original fix for PR7463 actually was. We've been handling cv-qualifiers on rvalues wrong for a very, very long time. Fixes PR7463. llvm-svn: 108253
* When forming a function call or message send expression, be sure toDouglas Gregor2010-07-131-8/+8
| | | | | | | | | | | | | | | | | strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234
* Introduce a new routine, LookupConstructors(), and use it for allDouglas Gregor2010-07-021-5/+1
| | | | | | constructor-name lookup. llvm-svn: 107536
* Extend the "cannot convert from base class pointer to derived classDouglas Gregor2010-07-011-6/+14
| | | | | | pointer" diagnostic to handle references, too. llvm-svn: 107372
* Improve diagnostic when we fail to pick an overload because it wouldDouglas Gregor2010-06-301-0/+32
| | | | | | require a base-to-derived pointer conversion. llvm-svn: 107349
* Add a return to silence a warning. Alternately a default: return falseEric Christopher2010-06-301-0/+2
| | | | | | | would work. Sebastian: figure out which one you want :) llvm-svn: 107305
* Make both old and new versions of reference binding use the new ↵Sebastian Redl2010-06-301-133/+159
| | | | | | classification functions, and updated them for N3092. llvm-svn: 107301
* Implement C++ DR299, which allows an implicit conversion from a classDouglas Gregor2010-06-301-5/+44
| | | | | | | | | | | type to an integral or enumeration type in the size of an array new expression, e.g., new int[ConvertibleToInt(10)]; This is a GNU and C++0x extension. llvm-svn: 107229
* Re-improve recovery when the condition of a switch statement does notDouglas Gregor2010-06-291-5/+3
| | | | | | | | have integral or enumeration type, so that we still check the contents of the switch body. My previous patch made this worse; now we're back to where we were previously. llvm-svn: 107223
* Factor the conversion from a switch condition to an integral orDouglas Gregor2010-06-291-0/+134
| | | | | | | | enumeration type out into a separate, reusable routine. The only functionality change here is that we recover a little more aggressively from ill-formed switch conditions. llvm-svn: 107222
* Vector types are not arithmetic types, either. Note that we now banDouglas Gregor2010-06-221-3/+2
| | | | | | | | | __real myvec and __imag myvec, since they aren't all that useful (it's just an identity function) but we might want to use them in more restricted cases in the future (e.g., "__real mycomplexvec" could extract the real parts of a vector of complex numbers). llvm-svn: 106601
* Type Type::isRealFloatingType() that vectors are not floating-pointDouglas Gregor2010-06-221-3/+3
| | | | | | | | | types, updating callers of both isFloatingType() and isRealFloatingType() accordingly. Caught at least one issue where we allowed one to declare a vector of vectors (!), along with cleaning up the standard-conversion logic for C++. llvm-svn: 106595
* Change Type::isFloatingType() to reflect the actual definition of aDouglas Gregor2010-06-221-6/+2
| | | | | | | | | | | "floating type" in C, which does not include vector types. Introduce Type::hasFloatingRepresentation() for the places where we want to know whether the underlying representation is one or more floating-point values. Remove some hacks we had where the former behavior of Type::isFloatingType() was at odds with the language definition of the term. llvm-svn: 106584
* Don't allow vector conversions to sneak in under the guise ofDouglas Gregor2010-06-221-4/+9
| | | | | | | | floating-point conversions or floating-integral conversions. We really, really, really need to make isFloatingType() and friends not apply to vector types. llvm-svn: 106551
* Use UnaryOperator as the representation of dependent expressions whenDouglas Gregor2010-06-171-0/+6
| | | | | | | no overloaded operators were found in scope, mirroring what we already do for BinaryOperator. llvm-svn: 106222
* Fix a point of semantics with using declaration hiding: method templatesJohn McCall2010-06-161-7/+46
| | | | | | | | | | | | | | | | | introduced by using decls are hidden even if their template parameter lists or return types differ from the "overriding" declaration. Propagate using shadow declarations around more effectively when looking up template-ids. Reperform lookup for template-ids in member expressions so that access control is properly set up. Fix some number of latent bugs involving template-ids with totally invalid base types. You can only actually get these with a scope specifier, since otherwise the template-id won't parse as a template-id. Fixes PR7384. llvm-svn: 106093
* Give Type::isIntegralType() an ASTContext parameter, so that itDouglas Gregor2010-06-161-4/+3
| | | | | | | | | | | | provides C "integer type" semantics in C and C++ "integral type" semantics in C++. Note that I still need to update isIntegerType (and possibly other predicates) using the same approach I've taken for isIntegralType(). The two should have the same meaning, but currently don't (!). llvm-svn: 106074
OpenPOWER on IntegriCloud