summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix PR20886 - enforce CUDA target match in method callsEli Bendersky2014-09-251-0/+21
| | | | | | http://reviews.llvm.org/D5298 llvm-svn: 218482
* Don't perform ADL when looking up operator=; there is no non-member form ofRichard Smith2014-09-231-4/+7
| | | | | | | | | that function, and apart from being slow, this is unnecessary: ADL can trigger instantiations that are not permitted here. The standard isn't *completely* clear here, but this seems like the intent, and in any case this approach is permitted by [temp.inst]p7. llvm-svn: 218330
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-291-3/+1
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216710
* Objective-C. When multiple nullary selectors are found inFariborz Jahanian2014-08-271-1/+11
| | | | | | | | | | global pool in the course of method selection for a messaging expression, select one with the most general return type of 'id'. This is to remove type-mismatch warning (which is useless) as result of random selection of method with more restrictive return type. rdar://18095772 llvm-svn: 216560
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-271-2/+2
| | | | | | just letting them be implicitly created. llvm-svn: 216528
* C++1y is now C++14!Aaron Ballman2014-08-191-8/+8
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Objective-C. Minor refactoring of my last patch.Fariborz Jahanian2014-08-131-1/+5
| | | | | | // rdar://16808765 llvm-svn: 215581
* Objective-C. This patch is to resolve the method used in methodFariborz Jahanian2014-08-131-0/+73
| | | | | | | expression to the best method found in global method pools. This is wip. // rdar://16808765 llvm-svn: 215577
* MS ABI: Handle member function pointers returning a member data pointerDavid Majnemer2014-08-071-0/+4
| | | | | | | | | MSVC doesn't decide what the inheritance model for a returned member pointer *until* a call expression returns it. This fixes PR20017. llvm-svn: 215164
* Use the correct from type in a SCSEhsan Akhgari2014-07-221-0/+1
| | | | | | | | | | | | | | | | | | Summary: If during constructing a standard conversion sequence, we resolve an overload, we need to adjust the from type in the SCS according to the resolved operator. I found this bug when debugging PR20218. This doesn't seem to be observable, so there is no good way of testing it. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4402 llvm-svn: 213680
* Remove dead code.Richard Smith2014-07-141-11/+0
| | | | llvm-svn: 213013
* In C++98, if an rvalue reference binds to a function lvalue (or an xvalue or anRichard Smith2014-07-141-1/+1
| | | | | | | | array prvalue), treat that as a direct binding. Only the class prvalue case needs to be excluded here; the rest are extensions anyway, so we can treat them as we would in C++11. llvm-svn: 212978
* Superficial fix for PR20218: binding a function lvalue to a const reference toRichard Smith2014-07-141-17/+28
| | | | | | | | | | | | | a function pointer is neither better nor worse than binding a function lvalue to a function rvalue reference. Don't get confused and think that both bindings are binding to a function lvalue (which would make the lvalue form win); the const reference is binding to an rvalue. The "real" bug in PR20218 is still present: we're getting the wrong answer from template argument deduction, and that's what leads us to this weird overload set. llvm-svn: 212916
* Import MutableArrayRef into clang namespace.Craig Topper2014-06-281-1/+1
| | | | llvm-svn: 211988
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-281-2/+2
| | | | llvm-svn: 211987
* Refactoring. Remove Owned method from Sema.Nikola Smiljanic2014-05-291-49/+37
| | | | llvm-svn: 209812
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-36/+36
| | | | | | takeAs to getAs. llvm-svn: 209800
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-96/+100
| | | | llvm-svn: 209613
* Add hasSameType overload to ASTContext for Type pointers. Switch a typeRichard Trieu2014-05-221-2/+1
| | | | | | comparison check to use this instead of calling Type::getCanonicalTypeInternal llvm-svn: 209378
* Fix diagnostic message for member function pointer mismatches where one of theRichard Trieu2014-05-201-1/+2
| | | | | | classes is a template argument. llvm-svn: 209190
* More fixes for isBetterOverloadCandidate not being a strict weak ordering. TheRichard Smith2014-05-171-19/+8
| | | | | | bug was obvious from inspection, figuring out a way to test it was... less so. llvm-svn: 209060
* Switch to a more efficient expression of this check.Richard Smith2014-05-171-20/+24
| | | | llvm-svn: 209055
* Correct incoherent function versus function template partial ordering for ↵Richard Smith2014-05-171-24/+30
| | | | | | conversion operators (the comparison could claim that two conversion operators are both better than each other). Actually implement DR495, rather than passing its test by chance because the declarations happened to be in the "lucky" order. llvm-svn: 209054
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-0/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* Try harder to ensure a strict weak ordering of overload candidates thatKaelyn Takata2014-05-071-6/+11
| | | | | | have arity mismatches. llvm-svn: 208146
* Fix crash when one overload candidate is a template instead of a function. ↵Nick Lewycky2014-05-061-0/+1
| | | | | | | | | | Patch by Kaelyn Takata. Testcase coming out of creduce will land in a separate commit shortly. Also, it appears that this callback is used even in a SFINAE context where the results are never displayed. llvm-svn: 208062
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-031-2/+1
| | | | llvm-svn: 207896
* Use std::abs(int) portably.David Blaikie2014-05-011-2/+3
| | | | | | Code review feedback from Reid Kleckner on r207806. llvm-svn: 207811
* Fix some -Wabsolute-value warnings introduced in r207796.David Blaikie2014-05-011-2/+2
| | | | llvm-svn: 207806
* When sorting overload candidates, sort arity mismatches in ascendingKaelyn Takata2014-05-011-3/+16
| | | | | | | | order by the number of missing or extra parameters. This is useful if there are more than a few overload candidates with arity mismatches, particularly in the presence of -fshow-overloads=best. llvm-svn: 207796
* Implement [over.match.oper]p3 properly, by filtering the non-candidates outRichard Smith2014-04-171-22/+78
| | | | | | | when building the candidate set, rather than trying to contort name lookup into handling this. llvm-svn: 206436
* Try harder about not suggesting methods as corrections when theyKaelyn Takata2014-04-041-1/+2
| | | | | | | | obviously won't work. Specifically, don't suggest methods (static or not) from unrelated classes when the expression is a method call through a specific object. llvm-svn: 205653
* Add defensive check that argument may be null in call to ↵Ted Kremenek2014-04-011-1/+1
| | | | | | | | | | | compareConversionFunctions() on incorrect code. I'm looking into getting a reduced test case, but it's not immediately available. Fixes <rdar://problem/16344806> llvm-svn: 205285
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-1/+1
| | | | | | class. llvm-svn: 203640
* [C++11] Remove the remaining uses of OwningPtr.Ahmed Charles2014-03-091-1/+1
| | | | | | Replace OwningArrayPtr with std::unique_ptr<T[]>. llvm-svn: 203388
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-3/+1
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* Don't suggest non-static methods as corrections when they obviouslyKaelyn Uhrain2014-02-281-1/+1
| | | | | | | won't work (i.e. when not doing a member lookup and not in a method from the same class or a descendant class). llvm-svn: 202520
* Fix crash with enable_if on constructors.Nick Lewycky2014-02-281-1/+2
| | | | llvm-svn: 202467
* Tighten lax vector-conversion rules and enforce them consistently.John McCall2014-02-041-6/+5
| | | | | | | | | | | | | | | | | | | | When a lax conversion featured a vector and a non-vector, we were only requiring the non-vector to be a scalar type, but really it needs to be a real type (i.e. integral or real floating); it is not reasonable to allow a pointer, member pointer, or complex type here. r198474 required lax conversions to match in "data size", i.e. element size * element count, forbidding matches that happen only because a vector is rounded up to the nearest power of two in size. Unfortunately, the erroneous logic was repeated in several different places; unify them to use the new condition, so that it triggers for arbitrary conversions and not just those performed as part of binary operator checking. rdar://15931426 llvm-svn: 200810
* [Sema] Follow-up on r200521 for the -Wnon-literal-null-conversion warning ↵Argyrios Kyrtzidis2014-02-021-15/+1
| | | | | | and revert its behavior for C++. llvm-svn: 200622
* [Sema] For -Wnon-literal-null-conversion warning, look through integer ↵Argyrios Kyrtzidis2014-01-311-1/+15
| | | | | | | | | | casts, which are used by some projects in their null macro. rdar://15925483 llvm-svn: 200521
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-39/+34
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Added missing StandardConversionSequence initializationIsmail Pazarbasi2014-01-241-0/+1
| | | | | | | This is the second msan failure where UserDefinedConversion does not initialize its `Before` member as identity conversion. llvm-svn: 199997
* Initialize StandardConversionSequence correctlyIsmail Pazarbasi2014-01-241-1/+1
| | | | | | | | MSAN detected a path that leaves DeprecatedStringLiteralToCharPtr uninitialized. UserDefinedConversionSequence::First is a StandardConversionSequence that must be initialized with setAsIdentityConversion. llvm-svn: 199988
* Introduce and use Decl::getAsFunction() to simplify templated function checksAlp Toker2014-01-221-12/+3
| | | | | | | | | | | | | | Lift the getFunctionDecl() utility out of the parser into a general Decl::getAsFunction() and use it to simplify other parts of the implementation. Reduce isFunctionOrFunctionTemplate() to a simple type check that works the same was as the other is* functions and move unwrapping of shadowed decls to callers so it doesn't get run twice. Shuffle around canSkipFunctionBody() to reduce virtual dispatch on ASTConsumer. There's no need to query when we already know the body can't be skipped. llvm-svn: 199794
* Simplify expression, made possible by r199702.Nick Lewycky2014-01-211-2/+2
| | | | llvm-svn: 199703
* Update FunctionTypeLoc and related names to match r199686Alp Toker2014-01-211-17/+17
| | | | llvm-svn: 199699
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-201-44/+45
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Fix string-literal to char* conversion in overload resolution for C++11Ismail Pazarbasi2014-01-171-20/+50
| | | | | | | | String literal to char* conversion is deprecated in C++03, and is removed in C++11. We still accept this conversion in C++11 mode as an extension, if we find it in the best viable function. llvm-svn: 199513
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-141-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. llvm-svn: 199209
OpenPOWER on IntegriCloud