summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Change FixOverloadedFunctionReference to return a (possibly new) expression. ↵Anders Carlsson2009-10-211-2/+3
| | | | | | Substitute TemplateIdRefExprs with DeclRefExprs. Doug, plz review :) llvm-svn: 84763
* Remove default argument for ImpCastExprToType. Add appropriate argument Eli Friedman2009-10-201-13/+35
| | | | | | | | | | | | | to all callers. Switch a few other users of CK_Unknown to proper cast kinds. Note that there are still some situations where we end up with CK_Unknown; they're pretty easy to find with grep. There are still a few missing conversion kinds, specifically pointer/int/float->bool and the various combinations of real/complex float/int->real/complex float/int. llvm-svn: 84623
* Parse a simple-template-id following a '~' when calling a destructor, e.g.,Douglas Gregor2009-10-191-8/+26
| | | | | | | | t->~T<A0, A1>() Fixes PR5213. llvm-svn: 84545
* When building a cast argument, make sure to bind the result to a temporary.Anders Carlsson2009-10-181-4/+9
| | | | llvm-svn: 84448
* When type-checking a C++ "new" expression, don't type-check the actual Douglas Gregor2009-10-171-2/+5
| | | | | | | initialization if any of the constructor/initialization arguments are type-dependent. Fixes PR5224. llvm-svn: 84365
* Don't add implicit casts of explicit address-taking of overloaded functions.Sebastian Redl2009-10-171-1/+6
| | | | | | Taking the address of an overloaded function with an explicit address-of operator wrapped the operator in an implicit cast that added yet another pointer level, leaving us with a corrupted AST, which crashed CodeGen in the test case I've added. Fix this by making FixOverloadedFunctionReference return whether there was an address-of operator and not adding the implicit cast in that case. llvm-svn: 84362
* Implement derived-to-base AST/code gen. There is aFariborz Jahanian2009-10-161-3/+43
| | | | | | | FIXME in CGCXX.cpp that I would like Anders to take a look at. llvm-svn: 84265
* The operator loc points to the operator, not the function decl.Anders Carlsson2009-10-131-1/+1
| | | | llvm-svn: 84048
* Check the return type of binary operators and the arrow operator.Anders Carlsson2009-10-131-1/+1
| | | | llvm-svn: 84043
* Test exception spec compatibility on return type and parameters.Sebastian Redl2009-10-111-32/+0
| | | | | | | Along the way, use RequireCompleteType when testing exception spec types. Separate all the ugly spec stuff into its own file. llvm-svn: 83764
* Implement the core checking for compatible exception specifications in ↵Sebastian Redl2009-10-101-1/+39
| | | | | | | | | assignment and initialization. The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet. This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment. llvm-svn: 83710
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-6/+10
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* Refactor the code that walks a C++ inheritance hierarchy, searchingDouglas Gregor2009-10-061-3/+3
| | | | | | | | | for bases, members, overridden virtual methods, etc. The operations isDerivedFrom and lookupInBases are now provided by CXXRecordDecl, rather than by Sema, so that CodeGen and other clients can use them directly. llvm-svn: 83396
* Note location of operators caused the circularity.Fariborz Jahanian2009-09-301-1/+5
| | | | llvm-svn: 83153
* Spare the processors of those poor wretches who have no choice but to writeJohn McCall2009-09-301-4/+3
| | | | | | unbounded chains of operator-> delegations. llvm-svn: 83134
* Detect operator-> chains of arbitrary length. Use a terrible data structureJohn McCall2009-09-301-3/+9
| | | | | | to strike fear into the hearts of CPUs everywhere. llvm-svn: 83133
* self-referecing operator '->' member function was causingFariborz Jahanian2009-09-301-0/+5
| | | | | | infinit recursion. This patch fixes it. [13.3.1.2]-p2 llvm-svn: 83124
* Find operators new/delete in base classes. FIXME -= 2;Douglas Gregor2009-09-301-5/+4
| | | | llvm-svn: 83119
* The C++ delete expression strips cv-qualifiers from the pointed-to type. My ↵Douglas Gregor2009-09-291-0/+12
| | | | | | previous fix eliminated this behavior, so bring it back again. llvm-svn: 83113
* Handle C++ delete expressions when the overloaded delete operator is aDouglas Gregor2009-09-291-18/+23
| | | | | | | | | | | "usual deallocation function" with two arguments. CodeGen will have to handle this case specifically, since the value for the second argument (the size of the allocated object) may have to be computed at run time. Fixes the Sema part of PR4782. llvm-svn: 83080
* Define and use a helper method to call a type conversionFariborz Jahanian2009-09-281-14/+20
| | | | | | function. llvm-svn: 83027
* Refixed pr5050 per Anders comment. Test case enhancedFariborz Jahanian2009-09-251-3/+16
| | | | | | per Doug's comment. llvm-svn: 82791
* Fix the AST tree so ir-gen can do the conversion via copy construction.Fariborz Jahanian2009-09-251-1/+3
| | | | | | Fixed pr5050. llvm-svn: 82783
* Fix checking for a null pointer constant when the expression itself isDouglas Gregor2009-09-251-4/+6
| | | | | | | | | | | | value-dependent. Audit (and fixed) all calls to Expr::isNullPointerConstant() to provide the correct behavior with value-dependent expressions. Fixes PR5041 and a crash in libstdc++ <locale>. In the same vein, properly compute value- and type-dependence for ChooseExpr. Fixes PR4996. llvm-svn: 82748
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-18/+41
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Improve diagnostic location information when checking the initialization of ↵Douglas Gregor2009-09-231-0/+3
| | | | | | a reference llvm-svn: 82666
* This patch addresses a few issues related to 8.5.3 [dcl.init.ref]Fariborz Jahanian2009-09-231-0/+9
| | | | | | | | | It uses a recent API to find inherited conversion functions to do the initializer to reference lvalue conversion (and removes a FIXME). It issues the ambiguity diagnostics when multiple conversions are found. WIP. llvm-svn: 82649
* Cast the array size expr to a size_tAnders Carlsson2009-09-231-1/+4
| | | | llvm-svn: 82594
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-2/+2
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* When implicitly declaring operators new, new[], delete, and delete[],Douglas Gregor2009-09-151-5/+54
| | | | | | | | | | | | give them the appropriate exception specifications. This, unfortunately, requires us to maintain and/or implicitly generate handles to namespace "std" and the class "std::bad_alloc". However, every other approach I've come up with was more hackish, and this standard requirement itself is quite the hack. Fixes PR4829. llvm-svn: 81939
* 1) don't do overload resolution in selecting conversionFariborz Jahanian2009-09-151-26/+20
| | | | | | | | to pointer function for delete expression. 2) Treat type conversion function and its 'const' version as identical in building the visible conversion list. llvm-svn: 81930
* Perform overload resolution when selecting a pointer conversionFariborz Jahanian2009-09-151-12/+25
| | | | | | | function for delete of a class expression and issue good diagnostic when result is ambiguous. llvm-svn: 81870
* If a conversion operator exists in a base class, make sure to cast the ↵Anders Carlsson2009-09-151-1/+7
| | | | | | object to that base class. llvm-svn: 81852
* When performing an user defined conversion sequence, perform the initial ↵Anders Carlsson2009-09-151-4/+21
| | | | | | standard conversion sequence. This lets us remove a workaround in SemaCompleteConstructorCall. llvm-svn: 81847
* Revert for real.Anders Carlsson2009-09-151-5/+3
| | | | llvm-svn: 81844
* Whoops, didn't mean to commit this.Anders Carlsson2009-09-151-5/+1
| | | | llvm-svn: 81842
* Only reuse an already existing ImplicitCastExpr if the cast kinds are the same.Anders Carlsson2009-09-151-3/+9
| | | | llvm-svn: 81841
* If a function call returns a reference, don't bind it to a temporary.Anders Carlsson2009-09-141-0/+9
| | | | llvm-svn: 81743
* More work toward having an access method for visibleFariborz Jahanian2009-09-121-1/+1
| | | | | | conversion functions. llvm-svn: 81618
* Use the correct CastKind for derived-to-base pointer conversions.Anders Carlsson2009-09-121-11/+14
| | | | llvm-svn: 81608
* Patch to build visible conversion function list lazily and make its Fariborz Jahanian2009-09-111-3/+3
| | | | | | first use in calling the conversion function on delete statements. llvm-svn: 81576
* Diagnose VLAs as an error in C++.Douglas Gregor2009-09-111-13/+19
| | | | | | | Also, treat the GNU __null as an integral constant expression to match GCC's behavior. llvm-svn: 81490
* For a C++ delete expression where the operand is of class type thatDouglas Gregor2009-09-091-5/+38
| | | | | | | has a single conversion to pointer-to-object type, implicitly convert to that pointer-to-object type (C++ [expr.delete]p1). llvm-svn: 81401
* Improve handling of initialization by constructor, by ensuring thatDouglas Gregor2009-09-091-8/+24
| | | | | | | | such initializations properly convert constructor arguments and fill in default arguments where necessary. This also makes the ownership model more clear. llvm-svn: 81394
* If a cast expression needs either a conversion function or a constructor to ↵Anders Carlsson2009-09-091-34/+71
| | | | | | be called, generate implicit child expressions that call them. llvm-svn: 81383
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-122/+111
| | | | llvm-svn: 81346
* BuildCXXConstructExpr now takes a MultiExprArg.Anders Carlsson2009-09-071-3/+4
| | | | llvm-svn: 81160
* Pass the ConstructLoc to BuildCXXConstructExpr.Anders Carlsson2009-09-051-2/+4
| | | | llvm-svn: 81068
* If a destructor is referenced or a pseudo-destructor expression isDouglas Gregor2009-09-041-7/+23
| | | | | | | formed without a trailing '(', diagnose the error (these expressions must be immediately called), emit a fix-it hint, and fix the code. llvm-svn: 81015
* Implement AST, semantics, and CodeGen for C++ pseudo-destructorDouglas Gregor2009-09-041-19/+12
| | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud