History log of /external/clang/lib/Sema/SemaOverload.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5acb0c98b363400f6ade0ae7250f0102224e806b 17-Oct-2011 John McCall <rjmccall@apple.com> Teach the ARC compiler to not require __bridge casts when
passing/receiving CF objects at +0 to/from Objective-C methods
or audited C functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5405b817e2e56b8d37faee7ddfe4c05c16339562 16-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Implement overload resolution from init lists for scalar parameter types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
091fffeed8971a577bc3c8057c1ec40015a22775 16-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Drop the Diagnose parameter from Sema::PerformImplicitConversion again and instead use TryImplicitConversion in CheckSingleAssignmentConstraints when that function is in no-diagnostics mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
aa4a99b4a62615db243f7a5c433169f2fc704420 15-Oct-2011 Anton Korobeynikov <asl@math.spbu.ru> Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ce1846e4ed7cec16518894073f7642a9b1a48004 15-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Attempt to fix Windows buildbot, round 2.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1c522f7c35ced263528896705cbeddf0aac30a19 14-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Attempt to fix buildbot failure on Windows.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b8989f27f116ff2400e92a52c067a69846119eb5 14-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.

Passing a pointer was a bad idea as it collides with the overload for void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6dbba4fc128e2e2f5b26be996392bd32c0707f13 12-Oct-2011 John McCall <rjmccall@apple.com> Catch placeholder types in DefaultLvalueConversion
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
25aaff9cf8a66bc236e5ccaf6183d11c14674cd3 10-Oct-2011 Douglas Gregor <dgregor@apple.com> Always add the built-in overload candidates for operators &&, ||, and
!. Fixes PR9865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7cc58b4c927fca539d43eaa58e00dca95946eb7c 05-Oct-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added a flag to identify resolved overloaded function references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
203050c2d5413c3f7e18dfa39451bf6f954136ca 05-Oct-2011 Douglas Gregor <dgregor@apple.com> Don't allow an rvalue reference to bind to the result of a calling a
conversion function whose result type is an lvalue reference. The
initialization code already handled this properly, but overload
resolution was allowing the binding. Fixes PR11003 /
<rdar://problem/10233078>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
78dd67e78c50a7abdc7c358e5eac1770d5fea22a 03-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: diagnose invalid calls across targets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
78213e4aec6d8d22b5828dd2687fa19116ebaa26 28-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc arc: Diagnose block pointer type mismatch when
some arguments types are ns_consumed and some otherwise
matching types are not. This is objc side of
// rdar://10187884


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f9d9527a0f52937a1a99da465b42c3cfe080bc6a 28-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc++ arc: Diagnose block pointer type mismatch when
some arguments types are ns_consumed and some otherwise
matching types are not. This fixes the objc++ side only *auch*.
// rdar://10187884


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8987b2385d9ba63ada66e1344ace79b04d5cb5c3 28-Sep-2011 Douglas Gregor <dgregor@apple.com> Only print _Bool as 'bool' when 'bool' is defined as an object-like
macro whose only replacement token is '_Bool'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
30c42404202d2e2512e51efc6066bd614cfdb5a4 28-Sep-2011 Douglas Gregor <dgregor@apple.com> When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d6471f7c1921c7802804ce3ff6fe9768310f72b9 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename Diagnostic to DiagnosticsEngine as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fd2a00a60837d19fcf27449d1c580bb1b24ba429 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Add a special note for overload resolution when an initializer list argument
cannot be converted.
This is in preparation for overload resolution of initializer lists.
Currently, you will always get this message when you try to pass an init
list to an overloaded function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
14b0c194b356a1204d081765b3e6699687bed97c 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Give InitListChecker a verification-only mode, where it neither emits diagnostics nor
builds a semantic (structured) initializer list, just reports on whether it can match
the given list to the target type.
Use this mode for doing init list checking in the initial step of initialization, which
will eventually allow us to do overload resolution based on the outcome.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ca82a82082edc982a1fb5fcfef2dd2c8cf9bc824 21-Sep-2011 John McCall <rjmccall@apple.com> Enforce access control for conversion operators used in contextual
conversions (rather than just call-arguments).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1c98d627e5f0b79365d4e64cd4c6795ebed895f3 18-Sep-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode(-fms-compatibility), prefer an integral conversion to a floating-to-integral conversion if the integral conversion is between types of the same size.

For example:
void f(float);
void f(int);
int main {
long a;
f(a);
}
Here, MSVC will call f(int) instead of generating a compile error as clang will do in standard mode.
This fixes a few errors when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
62ec1f2fd7368542bb926c04797fb07023547694 17-Sep-2011 Francois Pichet <pichet2000@gmail.com> Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.

Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
afc5b15022886c9e9e84d7aa0f2168b83e712310 10-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence "end of non-void function" warnings with llvm_unreachable and add an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
78bf680ddf8522676474883fad2fe245f839d2ab 10-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Fix a -Wreturn-type warning due to this field not explicitly having the
enumeration type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fd641f943a7d5508858fb5f449a0f5767fa34ac7 09-Sep-2011 Kaelyn Uhrain <rikka@google.com> Add smarter sorting of overload candidates that failed template deduction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0bcc9bc6cd46757000245fb7b91302e6ec3478a1 09-Sep-2011 John McCall <rjmccall@apple.com> Contextually converting to 'id' is not a useful operation. Contextually
converting to an arbitrary Objective-C pointer type is. Without
significantly re-implementing anything, change the API to reflect this,
and as a minor optimization, strip the pointer conversion off before
potentially building it.

Mostly, this removes a really bizarre-looking bit of code from
BuildInstanceMessage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1d9b3b25f7ac0d0195bba6b507a684fe5e7943ee 09-Sep-2011 John McCall <rjmccall@apple.com> Give conversions of block pointers to ObjC pointers a different cast kind
than conversions of C pointers to ObjC pointers. In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0f74d1e441fdf2229118b7ca5c88db29d5e8f44f 07-Sep-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, if we are inside a template class member function and we can't resolve a function call then create a type-dependent CallExpr even if the function has no type dependent arguments. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes.

With this patch in, clang will generate only 37 errors (down from 212) when parsing a typical MFC source file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2148011bffc011f8e5f5b6dc1e312fa4afbc10a9 30-Aug-2011 John McCall <rjmccall@apple.com> Be sure to emit lvalue-to-rvalue casts for loads from x-values.
Doing this happens to disrupt the pattern that ARC was looking for
for move optimizations, so we need to fix that simultaneously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1795d371c3ef79c3a2316677ea2014b2952915ac 26-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Make sure we don't crash printing builtin candidates for overloads of deleted operators. Fixes PR10757.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f20d27288c7f124dcc9c50c7c6bf766d522ceb31 15-Aug-2011 Douglas Gregor <dgregor@apple.com> Teach reference initialization from the result of a user-defined
conversion to initialize the standard conversion *after* the
user-defined conversion properly. Fixes PR10644.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ace5e76e5c707f4a8447abc01ef540fa6d57ff95 05-Aug-2011 Kaelyn Uhrain <rikka@google.com> Have the typo correction in DiagnoseEmptyLookup properly handle template
functions when performing function overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f0c1d8f804e7854bedf3f241409185951ee67866 03-Aug-2011 Kaelyn Uhrain <rikka@google.com> Improve overloaded function handling in the typo correction code.

Change TypoCorrection to store a set of NamedDecls instead of a single
NamedDecl. Also add initial support for performing function overload
resolution to Sema::DiagnoseEmptyLookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f3546eeef1eed4661b77b93b91a29be1bf5f7d0b 28-Jul-2011 Anna Zaks <ganna@apple.com> Refactor the */& mismatch fixit generation out of SemaOverload and provide a simple conversion checking function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bf6e3179eaf66b3eca43cbdbd09b71db40fa85fc 23-Jul-2011 Douglas Gregor <dgregor@apple.com> Tests for explicit conversion operators, along with a fix to avoid
considering explicit conversion operators when determining surrogate
functions. Fixes PR10453. Note that there are a few test cases where
Clang is still wrong because it does not implement DR899; see PR10456.

Patch by Jonathan Sauer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0ad92314852c4349685946997ca0967a32ccdb99 22-Jul-2011 David Majnemer <david.majnemer@gmail.com> kill a FIXME in IsIntegralPromotion

IsIntegralPromotion should consider the signedness of FromType when
calculating promotions. This, as of now, cannot be exercised on any
platform so there is no corresponding test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ffe9edd45f26873d58e7ddf79d403dd8072b748b 21-Jul-2011 Anna Zaks <ganna@apple.com> Addressing code review comments for commit 135509 - Add FixItHints in case a C++ function call is missing * or & operators on

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
909bcb37c4bc1ea1a62d505881defc3c3ba0eca3 20-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> arc-objc++: Issue an arc specific diagnostic when overload resolution
fails because of lifetime differences of parameter and argument type.
// rdar://9790531


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b89fe6b04c5b8a2d080c1c5605b72f809fc9ee68 19-Jul-2011 Anna Zaks <ganna@apple.com> Add FixItHints in case a C++ function call is missing * or & operators on one/several of it's parameters (addresses http://llvm.org/PR5941).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5b8968cc599eb6100bb73ae87be9d6cd2577ac9e 15-Jul-2011 Douglas Gregor <dgregor@apple.com> Store bracket locations for array subscript expressions, from Erik Verbruggen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
87c1f1f7c400deb2eb40d4599a40006072fb948c 14-Jul-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR8800: When building a conversion to A& using a member operatorA&(), do not require A to be a complete type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ae19806d2cae48b3ba8160fe5914b6436e51cf62 27-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix missing braces around two statements that were intended to be part
of a single if block. This is really annoying to track down and test.
Silly changes to the test case caused it to stop showing up. I wish
there were a more concrete way of asserting that a note attaches to the
intended diagnostic.

This fixes PR10195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2ced044c34311d8e6301f2b4566f4b612bc8b628 27-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10187: when diagnosing a two-phase-lookup-related failure, don't assert that any names we find are valid candidates for the call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b8b0313e84700b5c6d597b3be4de41c97b7550f1 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about 'ownership', not 'lifetime'.

rdar://9477613.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
572bbec2e0e23f684108e3a410a67c8c60ff9179 23-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow unavailable function calls inside unavailable functions in C++/ObjC++ as well. rdar://9660196

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
18e0461ad72dcf6ec93cd3b1df7bf1b5a30b10b7 18-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Accept no-return stripping conversions for pointer type arguments after
deducing template parameter types. Recently Clang began enforcing the
more strict checking that the argument type and the deduced function
parameter type (after substitution) match, but that only consideres
qualification conversions.

One problem with this patch is that we check noreturn conversions and
qualification conversions independently. If a valid conversion would
require *both*, perhaps interleaved with each other, it will be
rejected. If this actually occurs (I'm not yet sure it does) and is in
fact a problem (I'm not yet sure it is), there is a FIXME to implement
more intelligent conversion checking.

However, this step at least allows Clang to resume accepting valid code
we're seeing in the wild.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
45cad4adb802b818211b1c697f550d3bf1e98e51 08-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a regression in the two-phase lookup diagnostics that switching the
namespace set algorithm (re-)introduced. We may not have seen the 'std'
namespace, but we should still suggested associated namespaces. Easy
fix, but a bit annoying to test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
74d487e085c1555fb694c7ddf58315ae5e1bbecd 06-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Richard Smith was correct about how the sets should be computed for
this. My suggestion assumed a viable erase method for iterators on
SmallPtrSet.

This patch restores his original pattern.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f50e88a793dd5bc7073c717fec78912e3234e95a 06-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10053: Improve diagnostics and error recovery for code which some compilers incorrectly accept due to a lack of proper support for two-phase name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4ae5b7208ef72dec2a79d3d1c602cb47e9750d69 05-Jun-2011 Douglas Gregor <dgregor@apple.com> Identity and non-identity standard conversion sequences can be
compared even when one is a reference binding and the other is not
(<rdar://problem/9173984>), but the definition of an identity sequence
does not involve lvalue-to-rvalue adjustments (PR9507). Fix both
inter-related issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
82713174914bdb927a254c5ee188e35fd79c4948 26-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Update our diagnostics to properly account for move operations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
84ee2eeec9f63e4938bafd060105fa4f0c9cd89b 22-May-2011 Douglas Gregor <dgregor@apple.com> Audit and finish the implementation of C++0x nullptr, fixing two
minor issues along the way:
- Non-type template parameters of type 'std::nullptr_t' were not
permitted.
- We didn't properly introduce built-in operators for nullptr ==,
!=, <, <=, >=, or > as candidate functions .

To my knowledge, there's only one (minor but annoying) part of nullptr
that hasn't been implemented: catching a thrown 'nullptr' as a pointer
or pointer-to-member, per C++0x [except.handle]p4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a8ef3ac9fa7637fad33d52614794b92e2261d65b 09-May-2011 Francois Pichet <pichet2000@gmail.com> Allow implicit conversion from function pointer to void* in Microsoft mode.
Necessary to parse MFC code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
377e1bd6853118c5b1718503569e5179c40f09b7 08-May-2011 Douglas Gregor <dgregor@apple.com> Relax the conversion rules for Objective-C GC qualifiers a
bit by allowing __weak and __strong to be added/dropped as part of
implicit conversions (qualification conversions in C++). A little
history: GCC lets one add/remove/change GC qualifiers just about
anywhere, implicitly. Clang did roughly the same before, but we
recently normalized the semantics of qualifiers across the board to
get a semantics that we could reason about (yay). Unfortunately, this
tightened the screws a bit too much for GC qualifiers, where it's
common to add/remove these qualifiers at will.

Overall, we're still in better shape than we were before: we don't
permit directly changing the GC qualifier (e.g., __weak -> __strong),
so type safety is improved. More importantly, we're internally
consistent in our handling of qualifiers, and the logic that allows
adding/removing GC qualifiers (but not adding/removing address
spaces!) only touches two obvious places.

Fixes <rdar://problem/9402499>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2174d4c11c1544a6729637790637b765e35b67a3 06-May-2011 Anders Carlsson <andersca@mac.com> Warn when trying to call a pure virtual member function in a class from the class constructor/destructor. Fixes PR7966.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
439d3c3d76f858df5f25239f2a70f04312eacb5b 05-May-2011 Douglas Gregor <dgregor@apple.com> With invalid overloaded operators, we can get into funny cases where
the overloading of member and non-member functions results in arity
mismatches that don't fit well into our overload-printing scheme. This
only happens for invalid code (which breaks the arity invariants for
these cases), so just suppress the diagnostic rather than inventing
anything new. Fixes <rdar://problem/9222009>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3aa8140bde5b9bedf13e46ec0a668daa54814196 02-May-2011 Chandler Carruth <chandlerc@gmail.com> Add an optional field attached to a DeclRefExpr which points back to the
Decl actually found via name lookup & overload resolution when that Decl
is different from the ValueDecl which is actually referenced by the
expression.

This can be used by AST consumers to correctly attribute references to
the spelling location of a using declaration, and otherwise gain insight
into the name resolution performed by Clang.

The public interface to DRE is kept as narrow as possible: we provide
a getFoundDecl() which always returns a NamedDecl, either the ValueDecl
referenced or the new, more precise NamedDecl if present. This way AST
clients can code against getFoundDecl without know when exactly the AST
has a split representation.

For an example of the data this provides consider:
% cat x.cc
namespace N1 {
struct S {};
void f(const S&);
}
void test(N1::S s) {
f(s);
using N1::f;
f(s);
}

% ./bin/clang -fsyntax-only -Xclang -ast-dump x.cc
[...]
void test(N1::S s) (CompoundStmt 0x5b02010 <x.cc:5:20, line:9:1>
(CallExpr 0x5b01df0 <line:6:3, col:6> 'void'
(ImplicitCastExpr 0x5b01dd8 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
(DeclRefExpr 0x5b01d80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)'))
(ImplicitCastExpr 0x5b01e20 <col:5> 'const struct N1::S' lvalue <NoOp>
(DeclRefExpr 0x5b01d58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S')))
(DeclStmt 0x5b01ee0 <line:7:3, col:14>
0x5b01e40 "UsingN1::;")
(CallExpr 0x5b01fc8 <line:8:3, col:6> 'void'
(ImplicitCastExpr 0x5b01fb0 <col:3> 'void (*)(const struct N1::S &)' <FunctionToPointerDecay>
(DeclRefExpr 0x5b01f80 <col:3> 'void (const struct N1::S &)' lvalue Function 0x5b01a20 'f' 'void (const struct N1::S &)' (UsingShadow 0x5b01ea0 'f')))
(ImplicitCastExpr 0x5b01ff8 <col:5> 'const struct N1::S' lvalue <NoOp>
(DeclRefExpr 0x5b01f58 <col:5> 'N1::S':'struct N1::S' lvalue ParmVar 0x5b01b60 's' 'N1::S':'struct N1::S'))))

Now we can tell that the second call is 'using' (no pun intended) the using
declaration, and *which* using declaration it sees. Without this, we can
mistake calls that go through using declarations for ADL calls, and have no way
to attribute names looked up with using declarations to the appropriate
UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a6ce3e6513f56e4d46399da9e35a3165b097f59e 28-Apr-2011 Douglas Gregor <dgregor@apple.com> When determining whether two types are reference-compatible, check
non-CVR qualifiers as well as CVR qualifiers. For example, don't allow
a reference to an integer in address space 1 to bind to an integer in
address space 2.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f5307514ee48978b5e17e42542e111afee4ce62b 27-Apr-2011 John McCall <rjmccall@apple.com> FixOverloadedFunctionReference needs to rebuild member accesses of
instance methods to have bound-member type.

Fixing that broke __unknown_anytype, which I've in turn fixed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0f7b3dcece1475130e2946d66dbe3075059b31f7 27-Apr-2011 Douglas Gregor <dgregor@apple.com> When comparing Objective-C pointers during overload resolution to
determine which is a better conversion to "void*", be sure to perform
the comparison using the safe-for-id
ASTContext::canAssignObjCInterfaces() rather than the asserts-with-id
ASTContext::canAssignObjCInterfaces().

Fixes <rdar://problem/9327203>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
028ea4bf0c643e0e2a8fa086c28beb0d5b594ba7 27-Apr-2011 Douglas Gregor <dgregor@apple.com> When computing Objective-C pointer conversions in C++, retain
the qualifiers (e.g., GC qualifiers) on the type we're converting
from, rather than just blindly adopting the qualifiers of the type
we're converting to or dropping qualifiers altogether.

As an added bonus, properly diagnose GC qualifier mismatches to
eliminate a crash in the overload resolution failure diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
864c041e118155c2b1ce0ba36942a3da5a4a055e 26-Apr-2011 John McCall <rjmccall@apple.com> Make yet another placeholder type, this one marking that an expression is a bound
member function, i.e. something of the form 'x.f' where 'f' is a non-static
member function. Diagnose this in the general case. Some of the new diagnostics
are probably worse than the old ones, but we now get this right much more
universally, and there's certainly room for improvement in the diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
621c92a582546e2fa5ae28cf8b7e14d5a60fab11 25-Apr-2011 Douglas Gregor <dgregor@apple.com> Minor tweak to avoid having to dig through canonical types multiple times when checking a qualification conversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e36bca6f2abd868b9ae68ff1c0d691de7520ca8c 22-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In IsUserDefinedConversion try to recover from RequireCompleteType returning true.

Fixes an assertion later on, rdar://9122862 & http://llvm.org/PR9460.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f9af524b818f7a6f0ed812334482a5d657b2ff5b 15-Apr-2011 Douglas Gregor <dgregor@apple.com> For the purposes of overload resolution, consider a conversion from an
Objective-C pointer to void* as a "conversion to void*". This allows
us to prefer an Objective-C object pointer conversion to a superclass
object pointer over an Objective-C object pointer conversion to
cv-void*. Fixes PR9735.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5da3c08728d3d1091f4f3fa01f9d813a45d150f5 14-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Match pointer of compatible vection types.
// rdar://9208404


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b6006696358572a668d6de773af8f550e54259bf 09-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Clean up the bool conversion warning. Group it with other conversion
warnings, and make its text appropriate for constant bool expressions
other than 'false'. This should finish off PR9612.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
88f0aed95d2a0faf3cad66af2dc54596495a7d41 09-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Add support for warning on general null pointer expressions of boolean
type rather than just the literal 'false'. This begins fixing PR9612,
but the message is now wrong. WIP, the cleanup of the messaging is next.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
429bb276991ff2dbc7c5b438828b9b7737cb15eb 08-Apr-2011 John Wiegley <johnw@boostpro.com> Use ExprResult& instead of Expr *& in Sema

This patch authored by Eric Niebler.

Many methods on the Sema class (e.g. ConvertPropertyForRValue) take Expr
pointers as in/out parameters (Expr *&). This is especially true for the
routines that apply implicit conversions to nodes in-place. This design is
workable only as long as those conversions cannot fail. If they are allowed
to fail, they need a way to report their failures. The typical way of doing
this in clang is to use an ExprResult, which has an extra bit to signal a
valid/invalid state. Returning ExprResult is de riguour elsewhere in the Sema
interface. We suggest changing the Expr *& parameters in the Sema interface
to ExprResult &. This increases interface consistency and maintainability.

This interface change is important for work supporting MS-style C++
properties. For reasons explained here
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013180.html>,
seemingly trivial operations like rvalue/lvalue conversions that formerly
could not fail now can. (The reason is that given the semantics of the
feature, getter/setter method lookup cannot happen until the point of use, at
which point it may be found that the method does not exist, or it may have the
wrong type, or overload resolution may fail, or it may be inaccessible.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d593190132244b0194d480ec3e55f94f369c8863 04-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR9615: make sure we destroy any temporaries returned by operator->.

I'm pretty sure this is the right fix, but I would appreciate it if someone
else would double-check.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fc5c8fc5ff02fb4ae2d4cf693d2ceabd1d8a1845 29-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Fix an unused variable warning in release builds and make the
assert-less codepath marginally more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
90434238b7edfc806437f1d40742a60ff92fbf6a 29-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Fix a bug in how we were resolving the address of overloaded functions
when the resolution took place due to a single template specialization
being named with an explicit template argument list. In this case, the
"resolution" doesn't take into account the target type at all, and
therefore can take place for functions, static member functions, and
*non-static* member functions. The latter weren't being properly checked
and their proper form enforced in this scenario. We now do so.

The result of this last form slipping through was some confusing logic
in IsStandardConversion handling of these resolved address-of
expressions which eventually exploded in an assert. Simplify this logic
a bit and add some more aggressive asserts to catch improperly formed
expressions getting into this routine.

Finally add systematic testing of member functions, both static and
non-static, in the various forms they can take. One of these is
essentially PR9563, and this commit fixes the crash in that PR. However,
the diagnostics for this are still pretty terrible. We at least are now
accepting the correct constructs and rejecting the invalid ones rather
than accepting invalid or crashing as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d97f558f48865aa96e7bdf9c1c9315790c3d77c9 23-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Support for Transparent unions used as overloadable
function parameter. // rdar:// 9129552
and PR9406.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0a0d2b179085a52c10402feebeb6db8b4d96a140 23-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
db2eae639d3b7ed61ceb56890b73168517ef57f1 16-Mar-2011 Douglas Gregor <dgregor@apple.com> Clean up our handling of template-ids that resolve down to a single
overload, so that we actually do the resolution for full expressions
and emit more consistent, useful diagnostics. Also fixes an IRGen
crasher, where Sema wouldn't diagnose a resolvable bound member
function template-id used in a full-expression (<rdar://problem/9108698>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fadb53b351977ca7f99a9a613596cba6531979a3 12-Mar-2011 Douglas Gregor <dgregor@apple.com> Fixes for some more expressions containing function templateids that
should be resolvable, from Faisal Vali!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
67714230a191bc3c01f33378f34f34ef377991a6 03-Mar-2011 Douglas Gregor <dgregor@apple.com> When we use the default template arguments of a template template
parameter, save the instantiated default template arguments along with
the explicitly-specified template argument list. That way, we prefer
the default template template arguments corresponding to the template
template parameter rather than those of its template template argument.

This addresses the likely direction of C++ core issue 150, and fixes
PR9353/<rdar://problem/9069136>, bringing us closer to the behavior of
EDG and GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e34e3f16580c586b032035e2612d12ae4569f21e 01-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Move the bool-conversions behind the DiagRuntimeBehavior logic. It's
possible for these to show up due to metaprogramming both in unevaluated
contexts and compile-time dead branches.

Those aren't the bugs we're looking for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
40d96a69c0e1e8c10f92d450c305a7aae696ca9c 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier location information into DeclRefExpr and
MemberExpr, the last of the expressions with qualifiers!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4c9be89bb615ec07eb3ed507c8fa9d0baa8a5ad7 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
UnresolvedLookupExpr and UnresolvedMemberExpr.

Also, improve the computation that checks whether the base of a member
expression (either unresolved or dependent-scoped) is implicit. The
previous check didn't cover all of the cases we use in our
representation, which threw off source-location information for these
expressions (which, in turn, caused some breakage in libclang's token
annotation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5e24f2a4ad3a3623349f058e99c7c71e1c8d705f 25-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Sprinkle optional text of the "unavailable' attribute
where ever such attribute causes an error diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
25ca421a6049350a2748c8fd0c19a052eba6ae99 25-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Remove the FIXME I introduced last night, and pull the logic for
marking selected overloads into the callers. This allows a few callers
to skip it altogether (they would have anyways because they weren't
interested in successful overloads) or defer until after further checks
take place much like the check required for PR9323 to avoid marking
unused copy constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2b982b778d265c337af5d1b4c74ce49479cbda7d 25-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Print optional message for attr(unavailable) in C++ mode.
// rdar://9046492


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
30028234f38945981ebf9c8a2cb915fc2f9a63a4 25-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Rough fix for PR9323 that prevents Clang from marking copy constructor
declarations as referenced when in fact we're not going to even form
a call in the AST. This is significant because we attempt to allow as an
extension classes with intentionally private and undefined copy
constructors to have temporaries bound to references, and so shouldn't
warn about the lack of definition for that copy constructor when the
class is internal.

Doug, John wasn't really satisfied with the presence of overloading at
all. This is a stop-gap and there may be a better solution. If you can
give me some hints for how you'd prefer to see this solved, I'll happily
switch things over.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c34348a7ef1a6b3f92a644a227953800cd1f9947 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Retain complete source-location information for C++
nested-name-specifiers throughout the parser, and provide a new class
(NestedNameSpecifierLoc) that contains a nested-name-specifier along
with its type-source information.

Right now, this information is completely useless, because we don't
actually store the source-location information anywhere in the
AST. Call this Step 1/N.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9ddba32f25c0315cd3a6c7b63e0275b27cc1d973 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Tweak the CXXScopeSpec API a bit, so that we require the
nested-name-specifier and source range to be set at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5e971530928e7432da9f3d8488d3a0fdb67968ed 20-Feb-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1be8eec3ddd2a23c19b453c2639226174eb5d4a8 19-Feb-2011 Douglas Gregor <dgregor@apple.com> Handle the resolution of a reference to a function template (which
includes explicitly-specified template arguments) to a function
template specialization in cases where no deduction is performed or
deduction fails. Patch by Faisal Vali, fixes PR7505!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
462dae559c2377db365a8da1d84c5400284ebd30 13-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Use hasSameType in one more, hopefully, last place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
569bd8f4269df71b2176da940149aa5a959ae25d 13-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Some refactoring and using more modern APIs for
implementation of co/contra-variance objc++
block pointers. // rdar://8979379.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e3c8c64e7735c3589e1a34e6000c93183a55920c 12-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Implement objective-c++'s block pointer type matching involving
types which are contravariance in argument types and covariance
in return types. // rdar://8979379.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e08ce650a2b02410eddd1f60a4aa6b3d4be71e73 09-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f677ea3cc9598d9952ad7ffab5fb322ba4c5be31 05-Feb-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Basic implementation of inherited constructors. Only generates declarations, and probably only works for very basic use cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
395cc3728047b999cafe2a640147a20f1a8d4696 31-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement reasonable conversion ranking for Objective-C pointer
conversions (<rdar://problem/8592139>) for overload resolution. The
conversion ranking mirrors C++'s conversion ranking fairly closely,
except that we use a same pseudo-subtyping relationship employed by
Objective-C pointer assignment rather than simple checking
derived-to-base conversions. This change covers:

- Conversions to pointers to a specific object type are better than
conversions to 'id', 'Class', qualified 'id', or qualified 'Class'
(note: GCC doesn't perform this ranking, but it matches C++'s rules
for ranking conversions to void*).
- Conversions to qualified 'id' or qualified 'Class' are better than
conversions to 'id' or 'Class', respectively.
- When two conversion sequences convert to the same type, rank the
conversions based on the relationship between the types we're
converting from.
- When two conversion sequences convert from the same non-id,
non-Class type, rank the conversions based on the relationship of
the types we're converting to. (note: GCC allows this ranking even
when converting from 'id', which is extremeley dangerous).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dfbb02a16ac8c764b5ba1742450513d6212d2f9f 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0099530a2288df7c2140dd8992b7310b9f6930a9 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> 7bit-ize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
14d0aee957f11b9613fa4312919bec3cc5456a1c 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Fix a horrible bug in our handling of C-style casting, where a C-style
derived-to-base cast that also casts away constness (one of the cases
for static_cast followed by const_cast) would be treated as a bit-cast
rather than a derived-to-base class, causing miscompiles and
heartburn.

Fixes <rdar://problem/8913298>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b145ee6cc7d7db42ca4351ff3fe91f04e86a2f67 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the restriction that a function with a ref-qualifier cannot
overload a function without a ref-qualifier (C++0x
[over.load]p2). This, apparently, completes the implementation of
rvalue references for *this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fcab48b626b7ce43625958e857061d721a43a5bc 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this: explicitly keep track of whether a
reference binding is for the implicit object parameter of a member
function with a ref-qualifier. My previous comment, that we didn't
need to track this explicitly, was wrong: we do in fact get
rvalue-references-prefer-rvalues overloading with ref-qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2c9a03f3b249e4d9d76eadf758a33142adc4d0a4 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this: implement the implicit conversion rules
for the implicit object argument to a non-static member function with
a ref-qualifier (C++0x [over.match.funcs]p4).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
57c9f4f278fe15dc4964f2999486ffdbabce635c 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this: allow functions to be overloaded based on
the presence and form of a ref-qualifier. Note that we do *not* yet
implement the restriction in C++0x [over.load]p2 that requires either
all non-static functions with a given parameter-type-list to have a
ref-qualifier or none of them to have a ref-qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
440a48318c53647d6416bcb1ff1af1452aa5d453 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Reinstate r124236 (tweaking the rvalue-reference overload resolution
rules), now that we've actually have a clean build for me to sully.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4d4feead7e240bf24264658b5abb0b88d52ed684 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Speculatively revert r124236

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b7cd135215501a154eb4f68159f3af020783099e 25-Jan-2011 Douglas Gregor <dgregor@apple.com> Speculatively implement a tweak to the C++0x overload resolution rules
for reference binding (C++ [over.rank.ics]p3b1sb4), so that we prefer
the binding of an lvalue reference to a function lvalue over the
binding of an rvalue reference. This change resolves the ambiguity
with std::forward and lvalue references to function types in a way
that seems consistent with the original rvalue references proposal.

My proposed wording for this change is shown in
isBetterReferenceBindingKind(); we'll try to get this change adopted
in the C++0x working paper as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
48a4ce7d484a448490edfe9e1d47b806cee85f30 25-Jan-2011 Douglas Gregor <dgregor@apple.com> Fix the ranking of reference bindings during overload resolution
(C++0x [over.ics.rank]p3) when one binding is an lvalue reference and
the other is an rvalue reference that binds to an rvalue. In
particular, we were using the predict "is an rvalue reference" rather
than "is an rvalue reference that binds to an rvalue", which was
incorrect in the one case where an rvalue reference can bind to an
lvalue: function references.

This particular issue cropped up with std::forward, where Clang was
picking an std::forward overload while forwarding an (lvalue)
reference to a function. However (and unfortunately!), the right
answer for this code is that the call to std::forward is
ambiguous. Clang now gets that right, but we need to revisit the
std::forward implementation in libc++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8dde14e7f43a4b29e592b3e8e576eb467ddb6c6e 24-Jan-2011 Douglas Gregor <dgregor@apple.com> Re-instate r123977/r123978, my updates of the reference-binding
implementation used by overload resolution to support rvalue
references. The original commits caused PR9026 and some
hard-to-reproduce self-host breakage.

The only (crucial!) difference between this commit and the previous
commits is that we now properly check the SuppressUserConversions flag
before attempting to perform a second user-defined conversion in
reference binding, breaking the infinite recursion chain of
user-defined conversions.

Rvalue references should be working a bit better now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
aa5952c53f6c6a844a22fa2294186e16018b31e1 22-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> revert r123977 and r123978 to fix PR9026.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b13ede9f440f52ccfce046f1eba98679e9ffc0e6 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Add test for overload resolution's preference for binding an rvalue
reference to an rvalue rather than binding a const-qualified lvalue
reference to that rvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0baa92292ba26aa4ff1cf202623a2c7dc7c43aaf 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Eliminate an unused variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
68ed68b227c25babfbdd38d9a5b4b423d501951f 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Update the reference-binding implementation used for overload
resolution to match the latest C++0x working paper's semantics. The
implementation now matching up with the reference-binding
implementation used for initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2ad746aeb90e86cea7afaf552a02ae3f3b5ec859 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the special template argument deduction rule for T&& in a
call (C++0x [temp.deduct.call]p3).

As part of this, start improving the reference-binding implementation
used in the computation of implicit conversion sequences (for overload
resolution) to reflect C++0x semantics. It still needs more work and
testing, of course.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
83eecbefa4931b95231c9f2a61fb7b9b15e00eec 20-Jan-2011 Douglas Gregor <dgregor@apple.com> When building a user-defined conversion sequence, keep track of the
declaration that name lookup actually found, so that we can use it for
access checking later on. Fixes <rdar://problem/8876150>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f2ae52605a49e5fc7a581f2c1ae02f1811034578 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Sema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
so allow it to propagate the failure outward. Fixes the crashing part
of <rdar://problem/8876150>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dfc331e04d4c6a09fb693a15fc5a57d29a198c86 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Explicitly track the number of call arguments provided when performing
overload resolution, so that we only use that number of call arguments
for partial ordering. Fixes PR9006, a recent regression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3b6575108a5b6d8b92ac3a9a7794bf6c3a210907 19-Jan-2011 John McCall <rjmccall@apple.com> Change the canonical representation of array types to store qualifiers on the
outermost array types and not on the element type. Move the CanonicalType
member from Type to ExtQualsTypeCommonBase; the canonical type on an ExtQuals
node includes the qualifiers on the ExtQuals. Assorted optimizations enabled
by this change.

getQualifiers(), hasQualifiers(), etc. should all now implicitly look through
array types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f4c7371fb1d3cebcfb40abad4537bb82515704ea 19-Jan-2011 John McCall <rjmccall@apple.com> Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dbee3411a22b0dbb03267f5445f7b796104991bb 18-Jan-2011 Francois Pichet <pichet2000@gmail.com> Add support for explicit constructor calls in Microsoft mode.
For example:

class A{
public:
A& operator=(const A& that) {
if (this != &that) {
this->A::~A();
this->A::A(that); // <=== explicit constructor call.
}
return *this;
}
};

More work will be needed to support an explicit call to a template constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5c7bf42ef16dc767615bed10f3b7b3c1265314e1 11-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement C++ [temp.func.order]p5 more directly, by passing down the
number of explicit call arguments. This actually fixes an erroneous
test for [temp.deduct.partial]p11, where we were considering
parameters corresponding to arguments beyond those that were
explicitly provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f5c65ffbd7374b6c8d9f1e361041578640cab320 06-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement template argument deduction from a call to a function
template whose last parameter is a parameter pack. This allows us to
form a call to, e.g.,

template<typename ...Args1, typename ...Args2>
void f(std::pair<Args1, Args2> ...pairs);

given zero or more instances of "pair".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2fdc5e8199e1e239620f2faae88997153703e16f 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Many of the built-in operator candidates introduced into overload
resolution require that the pointed-to type be an object type, but we
weren't filtering out non-object types. Do so, fixing PR7851.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cfddf7be7992d386391968db448c3abbdc6e324a 21-Dec-2010 Douglas Gregor <dgregor@apple.com> For member pointer conversions potentially involving derived-to-base
conversions, make sure that the (possibly) derived type is complete
before looking for base classes.

Finishes the fix for PR8801.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
00ccbefcffeb88ea3e2e6323e594fa968753ad14 21-Dec-2010 John McCall <rjmccall@apple.com> Fix the noreturn conversion to only strip off a single level of indirection.
Apply the noreturn attribute while creating a builtin function's type.
Remove the getNoReturnType() API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bebbe0d9b7568ce43a464286bee49429489ef483 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Variadic templates: extend the Expr class with a bit that specifies
whether the expression contains an unexpanded parameter pack, in the
same vein as the changes to the Type hierarchy. Compute this bit
within all of the Expr subclasses.

This change required a bunch of reshuffling of dependency
calculations, mainly to consolidate them inside the constructors and
to fuse multiple loops that iterate over arguments to determine type
dependence, value dependence, and (now) containment of unexpanded
parameter packs.

Again, testing is painfully sparse, because all of the diagnostics
will change and it is more important to test the to-be-written visitor
that collects unexpanded parameter packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6a57746ea8e94aaf3fbcc961dc95756f5f3dda52 13-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Reduce the number of builtin operator overload candidates added in certain
cases. First, omit all builtin overloads when no non-record type is in the set
of candidate types. Second, avoid arithmetic type overloads for non-arithmetic
or enumeral types (counting vector types as arithmetic due to Clang
extensions). When heavily using constructs such as STL's '<<' based stream
logging, this can have a significant impact. One logging-heavy test case's
compile time dropped by 10% with this. Self-host shows 1-2% improvement in
compile time, but that's likely in the noise.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6d695587032d82c16078b769400701c3c666bea3 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Finish cleaning up the static utility code for adding builtin operator overload
candidates. They're now wrapped in nice APIs which hide the tables, etc. Also
removes some repetitive code from clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
38ca8d1298ed1bf4512be920917559766a498916 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Clean up the helpers used to compute the usual arithmetic conversions' result
type. Localize all of the logic within a single function rather than spreading
it throughout the class.

Also fixes a buglet where we failed to check for a RHS arithmetic type wider
than the LHS and return its canonical type. I've yet to produce a test case
that breaks because of this, but it was spotted by inspection by folks on the
IRC channel and is obviously correct now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3c69dc46d5391d5171875310be3edf8ca94db352 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Add a comment to a helper function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7b80b4b9a9df2ee54466922ce14cdfd639ac1972 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Sink the logic to suppress builtin operator overloads in the presence of
user-defined operator overloads on the same enumeral types to the one place
where it is used.

In theory this removes wasted computation from several paths through this code,
but I'm not aware of a case where it actually matters. This is mostly for
cleanliness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
abb71845ef4a2bbd0a20541b92285e44f2190825 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Reorder the cases in the switch to be more logically grouped (to my mind). If
others have another ordering they would prefer, I'm all ears, but this one made
it much easier for me to find the group of operators I'm interested in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c1409467542f2b3dc7f563f7e56ba54158a70b0e 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Remove the final goto from this switch making it explict which overload set is
added for binary operator&.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
32fe0d0831a34f41b9ceabb6475035c5d57c5faf 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Fold away completely identical code with simple fallthrough.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fe62274f48efcd93b2f3fc0fcc67cdf5725083db 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Move and copy function calls around to remove the indirection through gotos
from the switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
daf55d39306dccd13db46586c071262d9ace5533 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Simplify the flow through the switch by explicitly listing the added overloads
for a few cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6df868e8d69347d6141baa41b95a96d22c8eaefd 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Fix 80-column violations and reflowing some code to facilitate those fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3a0f3eff30dfa39ca8f78f98070b888dc8c67e54 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Begin the refactoring of how builtin operators are added to the overload
candidate set. This breaks apart a huge switch + goto system into distinct
methods on a class. It also places the current mess of tables and other static
state used in the process within that class.

This is still a work in progress. I did a few simplifications that jumped out
at me as I went, but I plan to iterate on this a bit before it's truly clean.
However, this is easily the most invasive chunk. I benchmarked it on
all-std-headers.cpp and an internal testcase that has a major hotspot in
overload resolution and saw no real performance impact.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
49f4e1cbd839da27ff4814b4ea6d85a79f786cbd 10-Dec-2010 John McCall <rjmccall@apple.com> It's kindof silly that ExtQuals has an ASTContext&, and we can use that
space better. Remove this reference. To make that work, change some APIs
(most importantly, getDesugaredType()) to take an ASTContext& if they
need to return a QualType. Simultaneously, diminish the need to return a
QualType by introducing some useful APIs on SplitQualType, which is
just a std::pair<const Type *, Qualifiers>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
143c7acef37824bca93c34d4b1d07c4560ce49a6 06-Dec-2010 Douglas Gregor <dgregor@apple.com> Objective-C pointer conversions to 'id' or qualified 'id' subsume
cv-qualification conversions. More specifically, there's an implicit
cv-qualification conversion (even one that drops qualifiers) when
converting to 'id' or qualified 'id'. Fixes <rdar://problem/8734046>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0e800c9c20d1a658a91096c756c4a4a9e90264fc 04-Dec-2010 John McCall <rjmccall@apple.com> Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
be required, and then fix up some missing loads on overloaded-operator
paths which that exposed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
da80f74d8a3f9a78a48d5fdc2d26eb125b70e0d7 01-Dec-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of cv-qualifiers in Objective-C pointer
conversions. Previously, we would end up collapsing qualification
conversions into the Objective-C pointer conversion step, including
(possibly) stripping qualifiers that shouldn't be removed.

This generalizes BuildSimilarlyQualifiedPointerType() to also work on
Objective-C object pointers, then eliminates the (redundant, not
totally correct) BuildSimilarlyQualifiedObjCObjectPointerType()
function.

Fixes <rdar://problem/8714395>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7eb0a9eb0cde8444b97f9c5b713d9be7a6f1e607 24-Nov-2010 John McCall <rjmccall@apple.com> Switch a lot of call-sites over to using the new value-kind calculations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7663f396651716c82280f8fdcf97ad8e27c1ce5a 20-Nov-2010 Nick Lewycky <nicholas@mxc.ca> A bundle of whitespace changes, separated out from the functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f89e55ab1bfb3ea997f8b02997c611a02254eb2d 18-Nov-2010 John McCall <rjmccall@apple.com> Calculate the value kind of an expression when it's created and
store it on the expression node. Also store an "object kind",
which distinguishes ordinary "addressed" l-values (like
variable references and pointer dereferences) and bitfield,
@property, and vector-component l-values.

Currently we're not using these for much, but I aim to switch
pretty much everything calculating l-valueness over to them.
For now they shouldn't necessarily be trusted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
64ccf2480609f4b5c27b31f6beaa157e6ec4f065 16-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve diagnostic for calling non-const method on const object. Fixes rdar://7743000

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
daa8e4e888758d55a7a759dd4a91b83921cef222 15-Nov-2010 John McCall <rjmccall@apple.com> Assorted work leading towards the elimination of CK_Unknown.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ae2cf767de457df939d07c44b162de5fe0b5e607 13-Nov-2010 Douglas Gregor <dgregor@apple.com> When complaining about ambiguous overload resolution for a unary or
binary operator, provide the types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7d14d389f0539545715e756629127c1fe5a4773a 13-Nov-2010 Douglas Gregor <dgregor@apple.com> When we're type-checking the result of calling a conversion function
(while computing user conversion sequences), make sure that a result
of class type is a complete class type. Had we gone through
ActOnCallExpr, this would have happened when we built the CallExpr.

Fixes PR8425.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
00071ec8f2f46201327b26e7092ffa40a53876be 13-Nov-2010 John McCall <rjmccall@apple.com> Pre-compute all possible usual-arithmetic-conversions results for the
promoted arithmetic types for which builtin operator candidates are
emitted. A few of these need further analysis.

Removes all the uses of UsualArithmeticConversionsType except the
core function in SemaExpr.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
72a014197ceb759f14eeca78c713caf64d6d196d 13-Nov-2010 John McCall <rjmccall@apple.com> Store the list of arithmetic types as a static array of member pointers
instead of copying them all out at the start. Not a significant
optimization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d7945c6bfd9e0cc7ed451e6c4acd8860f2d0eaba 10-Nov-2010 John McCall <rjmccall@apple.com> Friend function declarations can overload with tag declarations.
Fixes PR7915.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6493cc50b66c2d097b3e22514bbe303048c4a8ff 08-Nov-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of C++ [class.copy]p3, which specifies that a
constructor template will not be used to copy a class object to a
value of its own type. We were eliminating all constructor templates
whose specializations look like a copy constructor, which eliminated
important candidates. Fixes PR8182.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8e960435696b4ccf6a8ad0ed0530e3280b77af8b 08-Nov-2010 Douglas Gregor <dgregor@apple.com> Properly diagnose invalid casts to function references. Patch by
Faisal Vali, tweaked by me. Fixes PR8230.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c8df0b634ee5ca8573852fdc96252b8bba5a10db 05-Nov-2010 Anders Carlsson <andersca@mac.com> Implement [over.ics.rank]p4: A conversion that does not convert an std::nullptr_t to bool is better than one than does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2bd6250f8e14750033362664ee298c2cc0e64853 04-Nov-2010 Anders Carlsson <andersca@mac.com> std::nullptr_t is a fundamental type for RTTI purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fec56e7e341cd1d9a861d64bffc80a97aed89802 03-Nov-2010 Douglas Gregor <dgregor@apple.com> When producing overload candidates for binary built-in operators, keep
the sets of available conversions for the first and second arguments
separate. This is apparently the indent of C++ [over.built], and
reduces the number of overload candidates generated, eliminating some
ambiguities. Fixes PR8477.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3fa5cae9b3812cab9fab6c042c3329bb70a3d046 26-Oct-2010 John McCall <rjmccall@apple.com> No really, we don't have a retain/release system for statements/expressions
anymore.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
202422eea3b7c1c455edd168e6e79a50e732d7a9 26-Oct-2010 John McCall <rjmccall@apple.com> Actually, that doesn't really work, and anyway we should choose
conversion to id over conversion to void*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6d09da00bf5b5841380eae76571798ced6697f4c 26-Oct-2010 John McCall <rjmccall@apple.com> Consider conversions of Objective-C pointers to 'id' to be basically of
the same rank as conversions of normal pointers to 'void*'.

Also, resurrect a test case.

Fixes rdar://problem/8592139



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0b8ddb9a4743465cd76e9f134a2f55ab2330a0a4 21-Oct-2010 Douglas Gregor <dgregor@apple.com> Implement the integral promotion rules for the C++0x char16_t and
char32_t character types and enable built-in overloaded operator
candidates for these types. Fixes PR8432.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5a1f97ee183d2614db58452a4380dd11cb309263 15-Oct-2010 Douglas Gregor <dgregor@apple.com> Add builtin conditional operator candidates for scoped enumeration
types, from Alp Toker! Fixes PR8344.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5f3aeb6f8b1e1cc00015407ef6886429f9b7fb78 13-Oct-2010 Douglas Gregor <dgregor@apple.com> Teach the warning about unnamed/local types in template arguments to
actually walk the template argument type to find any unnamed/local
types within it. Fixes PR6784.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9b623639378d53a675921ddfa7316034d571881e 13-Oct-2010 Douglas Gregor <dgregor@apple.com> Introduce support for emitting diagnostics (warnings + their notes)
that are suppressed during template argument deduction. This change
queues diagnostics computed during template argument deduction. Then,
if the resulting function template specialization or partial
specialization is chosen by overload resolution or partial ordering
(respectively), we will emit the queued diagnostics at that point.

This addresses most of PR6784. However, the check for unnamed/local
template arguments (which existed before this change) is still only
skin-deep, and needs to be extended to look deeper into types. It must
be improved to finish PR6784.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1274ccd90aec0b205fc838c3d504821ccfb55482 09-Oct-2010 Douglas Gregor <dgregor@apple.com> Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fbb6fad63acac2bef36cfa13e0706fa3e2a1ed7d 29-Sep-2010 Douglas Gregor <dgregor@apple.com> When performing template argument deduction of a function template
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b3358724d985dc08889f7905f20284718361e885 28-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn with -Wbool-conversions if the user wrote an explicit cast like "(void *)false".
Fixes rdar://8459342.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3e9438b5251a547253d64169863c2909b9b2772a 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
745da3a5bb4ea35f93f50301e7fbbb7d78d3b6bb 24-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Patch implements passing arrays to functions expecting
vla. Implements pr7827.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
78c057e5a16b3ba186cc6453ca26b15745f2b79d 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Don't assert when attempting to take the address of an overloaded
function fails due to ambiguities in partial ordering of function
templates. Fixes PR8033.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8fcc516a5d5b2fec0023a9dced29285a38b95355 12-Sep-2010 Douglas Gregor <dgregor@apple.com> When performing overload resolution, only compare the final conversion
sequences for two conversion functions when in fact we are in the text
of initialization by a user-defined conversion sequences. Fixes PR8034.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
661b4939ae3f84380dc3e670a06e963b4b9d3b6e 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Implement the "note" in C++ [over.built]p1, which is actually meant to
be a semantic requirement that a built-in overloaded operator is not
added to the overload set of there is already a user-defined
overloaded operator with the same parameter types. Fixes PR8087.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5dde1605da5e6db8a9214f4a5d094ae0bbc64a4e 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Don't perform integral promotions from an incompletion enumeration
type. Fixes PR8089 in a slightly different way than had been suggested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a1a04786cea2445759026edacd096abd1fbf4a05 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Eliminate the comma locations from all of the Sema routines that deal
with comma-separated lists. We never actually used the comma
locations, nor did we store them in the AST, but we did manage to
waste time during template instantiation to produce fake locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9996a7f06a3c5b4554692e7177930cf4e8ef09af 28-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the memory leak of FloatingLiteral/IntegerLiteral.

For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers.
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Fixes rdar://7637185

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9c72c6088d591ace8503b842d39448c2040f3033 27-Aug-2010 John McCall <rjmccall@apple.com> Propagate whether an id-expression is the immediate argument of
an '&' expression from the second caller of ActOnIdExpression.

Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.

Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a
permitted form of use for member functions.

Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f312b1ea179f1c44371f9ee0cd0bc006f612de11 27-Aug-2010 John McCall <rjmccall@apple.com> One who seeks knowledge learns something new every day.
One who seeks the Tao unlearns something new every day.
Less and less remains until you arrive at non-action.
When you arrive at non-action,
nothing will be left undone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2d88708cbe4e4ec5e04e4acb6bd7f5be68557379 26-Aug-2010 John McCall <rjmccall@apple.com> Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5baba9d98364a3525d6afa15a04cdad82fd6dd30 25-Aug-2010 John McCall <rjmccall@apple.com> More incremental progress towards not including Expr.h in Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2a7fb27913999d132cf9e10e03dc5271faa2e9d3 25-Aug-2010 John McCall <rjmccall@apple.com> Move more stuff out of Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c988fab9860e83f25ef51101fef162b49380582b 25-Aug-2010 John McCall <rjmccall@apple.com> Catch the case of trying to turn '&(X::a)' into a member pointer as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fb97e75e627599aaa7a613778134e290f9de663b 25-Aug-2010 John McCall <rjmccall@apple.com> When trying to resolve the address of an overloaded expression,
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
120d63cd4465230c2cd56508c7cd8e0ad00848e7 24-Aug-2010 John McCall <rjmccall@apple.com> Move some of SemaOverload's API to various places in Overload.h, and kill
some of it off completely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7cd088e519d7e6caa4c4c12db52e0e4ae35d25c2 24-Aug-2010 John McCall <rjmccall@apple.com> Struggle mightily against header inclusion in Sema.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
60d7b3a319d84d688752be3870615ac0f111fb16 24-Aug-2010 John McCall <rjmccall@apple.com> OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
182f7093dd9dabbcf6df44b4ae004ead38804b48 24-Aug-2010 John McCall <rjmccall@apple.com> Fold ASTOwningResult back into ActionResult.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9ae2f076ca5ab1feb3ba95629099ec2319833701 24-Aug-2010 John McCall <rjmccall@apple.com> Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
42d0f2a03eb9e56a8293152ad9530848377a2c91 23-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Sema::AddBuiltinOperatorCandidates, candidate pointer types set can also contain a ObjCObjectPointerType since r111699.

Don't assume that they are only PointerTypes or we will crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ca0408fb49c1370430672acf2d770b7151cf71de 23-Aug-2010 John McCall <rjmccall@apple.com> Sundry incremental steps towards killing off Action.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
957b4dfd64bce51be396048e6c10485229f4bc7b 21-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> twik to my previous patch for pr7936.
Build qualified version of ObjC pointers (not pointers) when
doing overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2e2acec770a414bf1ebaf2664a752f67494200d1 21-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> patch to support comparison involving
objctive-c pointer conversions. Fixes pr7936.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4b6e6567f778133e25ec21e98e3e7e93d2c81e6a 21-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a266ebc09b2b7e097341791b7ffe9d0a09a474a2 20-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Rmove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
06ebc98ff017fadfaed515bc06f50ce94ca468d6 19-Aug-2010 Douglas Gregor <dgregor@apple.com> We don't actually need to check the implicit object argument's
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c774b2f66478008196f497a227d5ab88ea157582 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Properly implement the part of C++ [over.match.funcs]p4 that treats
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>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bca393259bc01955b334709de0f5a202470f913a 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Include a proper citation for the wacky hijinks involving conversion functions and the implicit object parameter type. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4e938f57bdd68b3716a4476acf151cdd27bb8a50 18-Aug-2010 Douglas Gregor <dgregor@apple.com> There is no pointer conversion between to similar types (i.e., same
type ignoring cv-qualifiers). These are qualification
conversions. Fixes PR7934.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e737f5041a36d0befb39ffeed8d50ba15916d3da 12-Aug-2010 Douglas Gregor <dgregor@apple.com> Move Sema's headers into include/clang/Sema, renaming a few along the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7b49202090678f45fa0c0bb5fa560d8a27b0c604 12-Aug-2010 John McCall <rjmccall@apple.com> Handle the obvious case for diagnosing redeclarations of extern "C" functions.

Fixes PR7859.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2577743c5650c646fb705df01403707e94f2df04 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
604eb65686590f73551d4ea608b174d2244cdd0f 11-Aug-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of user-defined conversions when computing
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c45eb9cad8beb8a2be275cafeaa5fe4de823ac29 08-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Silence GCC warning about && and || without explicit grouping.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
569c3166874324c24011f8ade6978421f0d39b3c 07-Aug-2010 Douglas Gregor <dgregor@apple.com> Allow reference binding of a reference of Objective-C object type to
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f871d0cc377a1367b519a6cce26be74607566eba 07-Aug-2010 John McCall <rjmccall@apple.com> Store inheritance paths after CastExprs instead of inside them.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
255210ef415b9893f0e3794e8d9a704194c12f3c 06-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce implicit conversions between AltiVec vectors and GCC
vectors, from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
57e97786433e70197a089360228d8f0d82e3ad4c 05-Aug-2010 John McCall <rjmccall@apple.com> TDK_InconsistentQuals is really totally different from TDK_Inconsistent.
Rename it to TDK_Underqualified to avoid this sort of confusion and give it
its own diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1357869bc5983cdfbc986db1f3d18265bb34cb0e 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of isObjectType; when C++ says "object type", it generally
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ff331c15729f7d4439d253c97f4d60f2a7ffd0c6 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
906082edf2aea1c6de2926f93a8d7121e49d2a54 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update ImplicitCastExpr to be able to represent an XValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
66a8c9a6b1f9bcd78779e5d414f3c9ae3cabdd93 15-Jul-2010 Douglas Gregor <dgregor@apple.com> When determining whether an overload set with explicit template
arguments only resolves to a single specialization, make sure to look
through using declarations. Fixes PR7641.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6398235d7890a81b785ea5af3b6e66d86bf184cc 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Whenever we're creating an expression that is typically an rvalue
(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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5291c3cec0dbe8ad1d8e7e67e93af2b1586d5400 13-Jul-2010 Douglas Gregor <dgregor@apple.com> When forming a function call or message send expression, be sure to
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).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e5eee5a52d98021de862b7965c88577598d52ccb 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce a new routine, LookupConstructors(), and use it for all
constructor-name lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2f9d8740f557bc1f8746a2d5c4498b324b63eeb9 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Extend the "cannot convert from base class pointer to derived class
pointer" diagnostic to handle references, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8578981ada66dae44a5a0752f949a5e65b477588 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostic when we fail to pick an overload because it would
require a base-to-derived pointer conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1c3d5029dbfb5bb01ab38d53e7d4dc29e9a8591f 30-Jun-2010 Eric Christopher <echristo@apple.com> Add a return to silence a warning. Alternately a default: return false
would work.

Sebastian: figure out which one you want :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4680bf233caeebe89aa297eb5a25709dd15a4b11 30-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make both old and new versions of reference binding use the new classification functions, and updated them for N3092.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6bc574daab3d3571d888cc4a21df67f2e2a14792 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Implement C++ DR299, which allows an implicit conversion from a class
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
acb0bd85d30ecacbe872ca9d9cfac5d7b6038a43 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Re-improve recovery when the condition of a switch statement does not
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c30614b7e2bad089f2509499379de509f33162d6 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Factor the conversion from a switch condition to an integral or
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
00619623af0b9d3271e31402ec1a95e84c2c4526 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Vector types are not arithmetic types, either. Note that we now ban
__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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0c293ea13d452c1a47a05ada5a5ee9acc69c66cc 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Type Type::isRealFloatingType() that vectors are not floating-point
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++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8eee119bf4f1693dde17b8552c1f9f81bf2b681e 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Change Type::isFloatingType() to reflect the actual definition of a
"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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7c5b1097f5833326b4f5046d6a7d5cb7b9060145 22-Jun-2010 Douglas Gregor <dgregor@apple.com> Don't allow vector conversions to sneak in under the guise of
floating-point conversions or floating-integral conversions. We
really, really, really need to make isFloatingType() and friends not
apply to vector types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1ec8ef7cd60e9615979e618ec39ab88305917949 17-Jun-2010 Douglas Gregor <dgregor@apple.com> Use UnaryOperator as the representation of dependent expressions when
no overloaded operators were found in scope, mirroring what we already
do for BinaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ad00b7705f9bbee81beeac428e7c6587734ab5a6 16-Jun-2010 John McCall <rjmccall@apple.com> Fix a point of semantics with using declaration hiding: method templates
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9d3347a5887d2d25afe8b0bd35783a72ec86cce2 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Give Type::isIntegralType() an ASTContext parameter, so that it
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 (!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2ade35e2cfd554e49d35a52047cea98a82787af9 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ddb0ce750c425af474008f091fb7a3483e980335 11-Jun-2010 John McCall <rjmccall@apple.com> Conversions from Objective C object pointers to bool are "pointer conversions
to bool" in the sense of C++ [over.ics.rank]p4 bullet 1. I have decreed it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
258de301b6b219b21c53e75924ad945291c5af08 11-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> Fix the 64-bit build. operator<<(DiagnosticBuilder, long) doesn't exist, so
ptrdiff_t (long on 64-bit, apparently) is ambiguous between the int and
unsigned int overloads.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5edbdcc62098e305cd55654814dcf783a3f3c477 11-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed. We default to 'all'. At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5a57efd7bf88a4a13018e0471ded8063a4abe8af 09-Jun-2010 Douglas Gregor <dgregor@apple.com> Tweak our handling of the notion of a standard conversion sequence
being a subsequence of another standard conversion sequence. Instead
of requiring exact type equality for the second conversion step,
require type *similarity*, which is type equality with cv-qualifiers
removed at all levels. This appears to match the behavior of EDG and
VC++ (albeit not GCC), and feels more intuitive. Big thanks to John
for the line of reasoning that supports this change: since
cv-qualifiers are orthogonal to the second conversion step, we should
ignore them in the type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ccd471341d2edbb18ac9c46a7c65d280d9c6223e 08-Jun-2010 Douglas Gregor <dgregor@apple.com> A built-in overload candidate is consider a non-template function when
determining whether one overload candidate is better than
another. Fixes PR7319.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d7a95971bd91b21922e5e878ba05bbe42b585cc9 08-Jun-2010 Douglas Gregor <dgregor@apple.com> Implement a warning when converting the literal 'false' to a
pointer. Original patch by Troy D. Straszheim; fixes PR7283.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
af7bea5fb496921c386459dc695485490bb06963 25-May-2010 Douglas Gregor <dgregor@apple.com> Make sure to strip off top-level cv-qualifiers as part of a
derived-to-base conversion on a pointer. Fixes PR7224.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ae65f4bd588f5f5ec26ed188830bf6d14800b09e 24-May-2010 Douglas Gregor <dgregor@apple.com> An identity conversion is better than any non-identity
conversion. Fixes PR7095.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5a84dec38cfa9e084377a3167b474c79283c82fa 23-May-2010 Douglas Gregor <dgregor@apple.com> Provide the overloaded functions for UnresolvedLookupExpr and
UnresolvedMemberExpr in their constructors, rather than adding them
after the fact. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
26bcf67d0156e2aec6ea184f8c2fb6186ec7b1e3 19-May-2010 Douglas Gregor <dgregor@apple.com> Implement C++ builtin operator candidates for vector types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
62ac5d01aade35790a6d8e814edb21062da5d3f7 19-May-2010 Fariborz Jahanian <fjahanian@apple.com> Misc. fixes to bring Objetive-C++'s handling of
gc attributes to be inline with Objective-C
(for radar 7925141).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fb4a5436839aae5f5599f2970997e23ee6b895b6 19-May-2010 Douglas Gregor <dgregor@apple.com> Implement C++ support for vector and extended vector types. This
involves extending implicit conversion sequences to model vector
conversions and vector splats, along with teaching the C++ conditional
operator-checking code about vector types.

Fixes <rdar://problem/7983501>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
91f7ac7e20ba03b8cd711974e2611231077bbe81 18-May-2010 Douglas Gregor <dgregor@apple.com> Tweak typo-correction logic a bit regarding "super", so that we
consider "super" as a candidate whenever we're parsing an expression
within an Objective-C method in an interface that has a superclass. At
some point, we'd like to give "super" a little edge over non-local
names; that will come later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
403783337fc06ce46bc2adeb7f09e0c0471f758e 16-May-2010 Chris Lattner <sabre@nondot.org> fix rdar://7985267 - Don't emit an error about a non-pod argument
passed to va_start, it doesn't actually pass it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44e 15-May-2010 John McCall <rjmccall@apple.com> Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
79d3f04688497857d29fe1f009bbc7b4b830a21b 13-May-2010 Fariborz Jahanian <fjahanian@apple.com> Objective-C++ Sema. Support for conversion of a C++
class object used as a receiver to an objective-c
pointer via a converwsion function. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c6dfe194f623b02c123759f235b504d4850fc178 09-May-2010 Douglas Gregor <dgregor@apple.com> Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
aaa045dbe74366f9dba334fd01c797087898c1cc 08-May-2010 Douglas Gregor <dgregor@apple.com> Don't destroy the data associated with an overload resolution candidate; it's ASTContext-allocated now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ff5adac099e9be58e16cf118ca3eb3f3e570c616 08-May-2010 Douglas Gregor <dgregor@apple.com> Record template argument deduction failures for member function
templates and conversion function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ec20f46740a59758b12c22108002395bcf5b6f9b 08-May-2010 Douglas Gregor <dgregor@apple.com> When printing an overload candidate that failed due to SFINAE, print a
specific message that includes the template arguments, e.g.,

test/SemaTemplate/overload-candidates.cpp:27:20: note: candidate template
ignored: substitution failure [with T = int *]
typename T::type get_type(const T&); // expected-note{{candidate ...
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f1a8445036a2d047c7165d4170e3058cdeaba6eb 08-May-2010 Douglas Gregor <dgregor@apple.com> Improve overload-candidate diagnostic for a function template that
failed because the explicitly-specified template arguments did not
match its template parameters, e.g.,

test/SemaTemplate/overload-candidates.cpp:18:8: note: candidate
template
ignored: invalid explicitly-specified argument for template
parameter 'I'
void get(const T&);
^
test/SemaTemplate/overload-candidates.cpp:20:8: note: candidate
template
ignored: invalid explicitly-specified argument for 1st template
parameter
void get(const T&);
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a95342c9d4209379c07ac8da553688eacf500f98 08-May-2010 Douglas Gregor <dgregor@apple.com> A leak is better than a double-free while I figure out how to address
this issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0ca4c58cba09ea4cb45348ea223227234a363e94 08-May-2010 Douglas Gregor <dgregor@apple.com> Minor cleanup, and ban copying of OverloadCandidateSets. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a18592ec62e898aed7ed71e1f09c314590ce9ec7 08-May-2010 Douglas Gregor <dgregor@apple.com> When template argument deduction fails because the call had too
many/too few arguments, use the same diagnostic we use for arity
mismatches in non-templates (but note that it's a function template).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a933319ebf754396623165f9dc0a29c2a48879f5 08-May-2010 Douglas Gregor <dgregor@apple.com> When printing a non-viable overload candidate that failed due to
conflicting deduced template argument values, give a more specific
reason along with those values, e.g.,

test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template
ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long')
const T& min(const T&, const T&);
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6b6d01fbc297d703f7ad1e605aa97afc6289a64f 07-May-2010 Douglas Gregor <dgregor@apple.com> Reapply the reference-binding patch applied below, along with a fix to
ensure that we complete the type when we need to look at constructors
during reference binding.

When determining whether the two types involved in reference binding
are reference-compatible, reference-related, etc., do not complete the
type of the reference itself because it is not necessary to determine
well-formedness of the program. Complete the type that we are binding
to, since that can affect whether we know about a derived-to-base
conversion.

Re-fixes PR7080.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
44c980611525b607ea3ad5c816bd91f37d1b5df5 07-May-2010 Douglas Gregor <dgregor@apple.com> Revert r103220. It seems to be breaking self-host

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
abfe1925e7cb0fbc36944f376b0695a68eebb455 07-May-2010 Douglas Gregor <dgregor@apple.com> When determining whether the two types involved in reference binding
are reference-compatible, reference-related, etc., do not complete the
type of the reference itself because it is not necessary to determine
well-formedness of the program. Complete the type that we are binding
to, since that can affect whether we know about a derived-to-base
conversion.

Fixes PR7080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b697e084341185a08b3946df032fbc75f76a66e0 06-May-2010 John McCall <rjmccall@apple.com> Diagnose deprecated/unavailable functions selected by overload resolution.
Fixes rdar://problem/4232969, or at least the clang parts of it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0ee93de27c2546fae9a1c7262ebe7eef85c89b66 06-May-2010 Chandler Carruth <chandlerc@gmail.com> Silence a pedantic GCC warning by making the grouping of && and || explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5f970eee81372dfc6a1457c3d6d052af04e32a38 04-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating a function that was declared via a typedef, e.g.,

typedef int functype(int, int);
functype func;

also instantiate the synthesized function parameters for the resulting
function declaration.

With this change, Boost.Wave builds and passes all of its regression
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d8d344191149652bb0f49d4c6e756b2f1bb63cac 03-May-2010 Fariborz Jahanian <fjahanian@apple.com> For the sake of Objective-c++ overload resolution,
treat argument types of objective-c pointer types
which only differ in their protocol qualifiers as
the same type (radar 7925668).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ad4e02f1711e5e90f4e653397b626e0d1929002c 29-Apr-2010 Douglas Gregor <dgregor@apple.com> When determining a standard conversion sequence involves resolving the
address of an overloaded function (or function template), perform that
resolution prior to determining the implicit conversion
sequence. This resolution is not part of the implicit conversion
sequence itself.

Previously, we would always consider this resolution to be a
function pointer decay, which was a lie: there might be an explicit &
in the expression, in which case decay should not occur. This caused
the CodeGen assertion in PR6973 (where we created a
pointer to a pointer to a function when we should have had a pointer
to a function), but it's likely that there are corner cases of
overload resolution where this would have failed.

Cleaned up the code involved in determining the type that will
produced afer resolving the overloaded function reference, and added
an assertion to make sure the result is correct. Fixes PR6973.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b86cf0c11712fa89f14197f3f0ed862e7b2add84 25-Apr-2010 Douglas Gregor <dgregor@apple.com> When copying a temporary object to initialize an entity for which the
temporary needs to be bound, bind the copy object. Otherwise, we won't
end up calling the destructor for the copy. Fixes Boost.Optional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f9d68e1dd015972318b2448f75115ff4fc3d5008 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add base paths for CK_BaseToDerived and CK_BaseToDerivedMemberPointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5cf86ba6b5a724bf91cb52feade1158f1fbeb605 24-Apr-2010 Anders Carlsson <andersca@mac.com> Actually produce base paths for CastExprs of kind CK_DerivedToBase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e25a96c0629b6f928d5e8055510789817db827d0 24-Apr-2010 Anders Carlsson <andersca@mac.com> Pass the base specifiers through to CheckDerivedToBaseConversion. No functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f1b48b7014992155286d58bb1676f9f51031d18b 24-Apr-2010 Anders Carlsson <andersca@mac.com> CastExpr should not hold a pointer to the base path. More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
88465d3e996e627bbaa11099b039ddab66d5af2c 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add an InheritancePath parameter to the ImplicitCastExpr constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
23402af16608841be8dbcb9ddaf885c267c20489 20-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b6eee077b23fa526e89570f01ec52c6ad335827b 18-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Bail out early to avoid comparing the internals of two conversion sequences of
different kinds (aka garbage). This happens if we're comparing a standard
conversion sequence to an ambiguous one which have the same KindRank.

Found by valgrind.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
66821b5515df8a366579d023e472f843ecfa59b2 18-Apr-2010 Douglas Gregor <dgregor@apple.com> When performing reference initialization for the purposes of overload
resolution ([over.ics.ref]), we take some shortcuts required by the
standard that effectively permit binding of a const volatile reference
to an rvalue. We have to treat lightly here to avoid infinite
recursion.

Fixes PR6177.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9dc58bb414394db3b886c0b6425a2738cb4cd785 18-Apr-2010 Douglas Gregor <dgregor@apple.com> Binding a reference to an rvalue is a direct binding in C++0x but not
in C++03.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3fbaf3e5d524bfff219d1e3e9ac4801a8411590f 18-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of user-defined conversions as part of overload
resolution. There are two sources of problems involving user-defined
conversions that this change eliminates, along with providing simpler
interfaces for checking implicit conversions:

- It eliminates a case of infinite recursion found in Boost.

- It eliminates the search for the constructor needed to copy a temporary
generated by an implicit conversion from overload
resolution. Overload resolution assumes that, if it gets a value
of the parameter's class type (or a derived class thereof), there
is a way to copy if... even if there isn't. We now model this
properly.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
900fc6388e803868a34b9483510c345e9b49d7eb 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
575c63a83e1ed5439643e10d55c26931ca043993 17-Apr-2010 Douglas Gregor <dgregor@apple.com> Move Sema::PerformImplicitConversion over to where Sema::TryImplicitConversion is, for my own sanity. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
74e386e8ead6654fade7f8661e28e10100dd4005 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Kill ForceRValue once and for all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b7f9e6a10bf935bd86dcb0a473df3d58f76e3a72 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ForceRValue parameter from TryCopyInitialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
74eb6581973124a0e7e6ffe50bde081379030c34 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Move Sema::TryCopyInitialization into a static function in
SemaOverload.cpp; no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
23ef6c00c2948d49aed3b4c083daa1cc07b2d8d5 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate ForceRValue parameters from reference binding. Did I mention
that we aren't using ForceRValue any more?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c27d6c58b2c1a7fecfb53c4f4016af6773a9d5ba 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ForceRValue parameter to Sema::AddOverloadCandidate

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7ec7752e95bcd0773d9b4682b6a827e195a5cf29 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ForceRValue parameter from most of Sema's Add*Candidate
functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5447a8d88f404059d36b077d338f5a4f399e0e82 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ForceRValue parameter from Sema::IsUserDefinedConversion. It's not the way we're going to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
471e2ceb7c441d46823a00a499f855afd19c45c3 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default value for the UserCast parameter of Sema::IsUserDefinedConversion. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1a8cf73a825ef35917eede448817237b5fd47b05 15-Apr-2010 Douglas Gregor <dgregor@apple.com> Always diagnose and complain about problems in
ResolveAddressOfOverloadedFunction when asked to complain. Previously,
we had some weird handshake where ResolveAddressOfOverloadedFunction
expected its caller to handle some of the diagnostics but not others,
and yet there was no way for the caller to know which case we were
in. Eliminate this madness, fixing <rdar://problem/7765884>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1aae80b173e22fa5d649f114eb6607efac350d79 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Thread a Scope pointer into BuildRecoveryCallExpr to help typo
correction find names when a call failed. Fixes
<rdar://problem/7853795>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
abe183dd2faa124ac0d1f0e29a4f4216a483748c 13-Apr-2010 Douglas Gregor <dgregor@apple.com> Refactor and simplify the computation of implicit conversion sequences
for reference binding. The code attempted to handle both the
computation of the ICS and the actual conversion, but the latter is an
anachronism: we now use InitializationSequence for that.

Sema::CheckReferenceInit is now a static function TryReferenceInit
that's only use within overload resolution, and has been simplified
slightly. It still needs to be updated per C++ [over.ics.ref], by
eliminating more of the lvalue/rvalue checks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
aa0be17ee35e3218b722d90b74789f9e7c602bda 13-Apr-2010 Douglas Gregor <dgregor@apple.com> When returning the result of a call to an object of class type, do not
return a NULL expression; return either an error or a proper
expression. Fixes PR6078.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c520c84f7e9c2d8d4a66ac438e10d815daaeae64 13-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement C++ [over.ics.user]p3, which restricts the final conversion
from a conversion function template specialization to one of exact
match rank. We only know how to test this in C++0x with default
function template arguments, but it's also in the C++03 spec. Fixes
PR6285.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bb6fb465c718f28b8c1bdddb9c22d7d733a741a7 08-Apr-2010 John McCall <rjmccall@apple.com> Fix a (bogus) uninitialized-member-of-local warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
161755a09898c95d21bfff33707da9ca41cd53c5 06-Apr-2010 John McCall <rjmccall@apple.com> Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup. My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b7a09260204f2079e0f998bf7ee52b95122a4c5d 01-Apr-2010 Douglas Gregor <dgregor@apple.com> Overhaul checking of non-type template arguments that should refer to
an object or function. Our previous checking was too lax, and ended up
allowing missing or extraneous address-of operators, among other
evils. The new checking provides better diagnostics and adheres more
closely to the standard.

Fixes PR6563 and PR6749.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
32daa4223ccb2c0afe5fbe151c6eb1ab64816957 31-Mar-2010 John McCall <rjmccall@apple.com> Regularize support for naming conversion functions in using decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6bb8017bb9e828d118e15e59d71c66bba323c364 30-Mar-2010 John McCall <rjmccall@apple.com> Propagate the "found declaration" (i.e. the using declaration instead of
the underlying/instantiated decl) through a lot of API, including "intermediate"
MemberExprs required for (e.g.) template instantiation. This is necessary
because of the access semantics of member accesses to using declarations:
only the base class *containing the using decl* need be accessible from the
naming class.

This allows us to complete an access-controlled selfhost, if there are no
recent regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fe6b2d481d91140923f4541f273b253291884214 30-Mar-2010 Douglas Gregor <dgregor@apple.com> Optimize PartialDiagnostic's memory-allocation behavior by placing a
cache of PartialDiagnostic::Storage objects into an allocator within
the ASTContext. This eliminates a significant amount of malloc
traffic, for a 10% performance improvement in -fsyntax-only wall-clock
time with 403.gcc's combine.c.

Also, eliminate the RequireNonAbstractType hack I put in earlier,
which was but a symptom of this larger problem.

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
29ecaba4ebe8c9a2627cf405e36473b764cc5cfd 26-Mar-2010 Douglas Gregor <dgregor@apple.com> Eliminate the non-InitializedEntity PerformCopyInitialization() and
re-route its only caller to the newer
PerformCopyInitialization(). We're down to one remaining caller of
Sema::CheckReferenceInit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9aa472c45d2bd81b7b52c225e8acc560d716db97 19-Mar-2010 John McCall <rjmccall@apple.com> Remember the "found declaration" for an overload candidate, which is the
entity (if applicable) which was actually looked up. If a candidate was found
via a using declaration, this is the UsingShadowDecl; otherwise, if
the candidate is template specialization, this is the template; otherwise,
this is the function.

The point of this exercise is that "found declarations" are the entities
we do access control for, not their underlying declarations. Broadly speaking,
this patch fixes access control for using declarations.

There is a *lot* of redundant code calling into the overload-resolution APIs;
we really ought to clean that up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
58e6f34e4d2c668562e1c391162ee9de7b05fbb2 16-Mar-2010 John McCall <rjmccall@apple.com> Perform access control for the implicit base and member destructor calls
required when emitting a destructor definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ee9ca6966d63419e4da1ea54151864a4ed8daeed 15-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> objective-c++ must take into account qualifiers when
considering valid objc pointer converions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5fccd36204f11c8491325038e6ffcc784399098e 04-Mar-2010 Douglas Gregor <dgregor@apple.com> Reinstate r97674 with a fix for the assertion that was firing in <list>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a7cb22d27f4440d264f2a1407c43b8d7259d23b0 04-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert r97674; it's causing failures

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b29b37d7e5bba50acc3a6642a2c90db080c22b90 03-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement disambiguation of base class members via a
nested-name-specifier. For example, this allows member access in
diamond-shaped hierarchies like:

struct Base {
void Foo();
int Member;
};

struct D1 : public Base {};
struct D2 : public Base {};

struct Derived : public D1, public D2 { }

void Test(Derived d) {
d.Member = 17; // error: ambiguous cast from Derived to Base
d.D1::Member = 17; // error: okay, modify D1's Base's Member
}

Fixes PR5820 and <rdar://problem/7535045>. Also, eliminate some
redundancy between Sema::PerformObjectMemberConversion() and
Sema::PerformObjectArgumentInitialization() -- the latter now calls
the former.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a9bff30776888977f580c9cac212fd1583ee963e 28-Feb-2010 Douglas Gregor <dgregor@apple.com> Warn about the deprecated string literal -> char* conversion. Fixes PR6428.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9e23932aca7997315a78ea50e9415631a1880fa0 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Allow us to compare derived-to-base conversions between a reference
binding and a copy-construction. Fixes an overloading problem in the
Clang-on-Clang build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3a8133727659077d0c918226e5dad6c16c8274f6 25-Feb-2010 John McCall <rjmccall@apple.com> When comparing two method overload candidates during overload diagnostics,
skip the object argument conversion if either of the candidates didn't
initialize it.

Fixes PR6421, which is such a very straightforward extension of PR6398 that I
should have worked it into the last test case (and therefore caught it then).
Ah well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
23a370f9455698e5501101aea7ad8a884a8d4556 25-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Add a new conversion rank to classify conversions between complex and scalar
types. Rank these conversions below other conversions. This allows overload
resolution when the only distinction is between a complex and scalar type. It
also brings the complex overload resolutin in line with GCC's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b1bdc6232d7b4d8574b5436982435ad57f429a91 25-Feb-2010 John McCall <rjmccall@apple.com> Catch more uses of uninitialized implicit conversion sequences.
When diagnosing bad conversions, skip the conversion for ignored object
arguments. Fixes PR 6398.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bf1764cf59e3158ad47dc1720a74490750923575 22-Feb-2010 Douglas Gregor <dgregor@apple.com> Do not require a complete type when checking for a pointer conversion
between cv1 T* and cv2 T*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
12116062c8243c6f88d79dac9663a359b77741c6 21-Feb-2010 Douglas Gregor <dgregor@apple.com> A constructor template cannot be used to copy to an object of the same class type (per C++ [class.copy]p3). Make sure that includes copies that involve a derived-to-base conversion. Fixes PR6141.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6b2accb4793e16b2e93a8c2589f5df702231f17a 10-Feb-2010 John McCall <rjmccall@apple.com> Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path. Prepare for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5769d6195087229770d7ac90449443e026c47103 09-Feb-2010 John McCall <rjmccall@apple.com> Thread a source location into the template-argument deduction routines. There
may be some other places that could take advantage of this new information,
but I haven't really looked yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dc81c880cad01f01888632d28345077336ca06a4 05-Feb-2010 Douglas Gregor <dgregor@apple.com> When adding ADL candidates for overloaded
post-increment/post-decrement operators, be sure to consider both
arguments. Fixes PR6237.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
86ff308724171494395a840fd2efbe25e62f352e 04-Feb-2010 John McCall <rjmccall@apple.com> Extract a common structure for holding information about the definition
of a C++ record. Exposed a lot of problems where various routines were
silently doing The Wrong Thing (or The Acceptable Thing in The Wrong Order)
when presented with a non-definition. Also cuts down on memory usage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
22c92406f4b043bd872b53761f6a157fcc105594 03-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Top-level const changes do not make a qualification conversion. Fixes PR6089.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
aa74a1e49f7c4b89539830290f76fe2c3e97187f 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement promotion for enumeration types.

WHAT!?!

It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.

In this commit:
- Enum types with a promotion type of "int" or "unsigned int" are
promotable.
- Tweaked the computation of promotable types for enums
- For all of the ABIs, treat enum types the same way as their
underlying types (*not* their promotion types) for argument passing
and return values
- Extend the ABI tester with support for enumeration types



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7bb12da2b0749eeebb21854c77877736969e59f2 02-Feb-2010 John McCall <rjmccall@apple.com> Extract a common base class between UnresolvedLookupExpr and
UnresolvedMemberExpr and employ it in a few places where it's useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5920dbba965a2f2a963313d94be3ff3d2b67ece7 02-Feb-2010 John McCall <rjmccall@apple.com> Improve the diagnostic used when an incompatible overload set is passed
as an argument during overload resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
342fec43c515184a3c0d0600323dfec2b059e74e 01-Feb-2010 John McCall <rjmccall@apple.com> Note that an overload candidate was non-viable because template argument
deduction failed. Right now there's a very vague diagnostic for most cases
and a good diagnostic for incomplete deduction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3faa486935d4c57e89edf2f1883c4ba715a1b2ec 29-Jan-2010 Anders Carlsson <andersca@mac.com> And yet another call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
38f88abead110a514ae626818c7d09a1ec763058 29-Jan-2010 Anders Carlsson <andersca@mac.com> Another PerformCopyInitialization call bites the dust.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
233a6419097ed97b67ff8efcacef9af613262ca3 28-Jan-2010 John McCall <rjmccall@apple.com> Access control for surrogate function calls. Required a moderately gross hack
to get the access bits set properly in conversion sets.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
41d8903731782ee85ee2b19734008b006e01c76f 28-Jan-2010 John McCall <rjmccall@apple.com> Access control for overloaded call operators. Not for surrogates yet,
mostly because we're going to want a better diagnostic for conversions.

Also this API needs to go back to sanity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5357b615364c17ea024c757354c58ae2a520d216 28-Jan-2010 John McCall <rjmccall@apple.com> Access checking for overloaded operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ad323a856c0bf759e07d37d749510ddf4f8c6b96 27-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix a major oversight in the comparison of standard conversion
sequences, where we would occasionally determine (incorrectly) that
one standard conversion sequence was a proper subset of another when,
in fact, they contained completely incomparable conversions.

This change records the types in each step within a standard
conversion sequence, so that we can check the specific comparison
types to determine when one sequence is a proper subset of the
other. Fixes this testcase (thanks, Anders!), which was distilled from
PR6095 (also thanks to Anders).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c373d48502ca7683ab55385f5bd624d778eb288d 27-Jan-2010 John McCall <rjmccall@apple.com> Implement access control for overloaded functions. Suppress access control
diagnostics in "early" lookups, such as during typename checks and when building
unresolved lookup expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
75345163535eb1765ba8fb971974be895645cb45 26-Jan-2010 John McCall <rjmccall@apple.com> Avoid some unnecessary copying of unresolved lookup results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7edb5fdf9703e1abd780417db691b77d5fcbc610 26-Jan-2010 John McCall <rjmccall@apple.com> Handle redeclarations found by ADL deterministically and reasonably.

This solution relies on an O(n) scan of redeclarations, which means it might
scale poorly in crazy cases with tons of redeclarations brought in by a ton
of distinct associated namespaces. I believe that avoiding this
is not worth the common-case cost.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a113e7263c5337731c65fada9de7ff72af25423b 26-Jan-2010 John McCall <rjmccall@apple.com> Allow ADL to find functions imported by using decls. Leave wordy comment
about interaction between ADL and default arguments. Shrug shoulders, commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6e26689f5d513e24ad7783a4493201930fdeccc0 26-Jan-2010 John McCall <rjmccall@apple.com> Preserve access bits through overload resolution much better. Some
general refactoring in operator resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
86820f58e077bfd8fdf7309129b6ff2c5c4eb0e4 26-Jan-2010 John McCall <rjmccall@apple.com> Pass access specifiers around in overload resolution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
258b203b853e1c684c290fccd0088d1f340c137f 23-Jan-2010 John McCall <rjmccall@apple.com> Produce a special diagnostic when users call a function with an argument of
incomplete type (or a pointer/reference to such).

The causes of this problem are different enough to justify a different "design"
for the diagnostic. Most notably, it doesn't give an operand index:
it's usually pretty obvious which operand is the problem, it adds a lot of
clutter to mention it, and the fix is usually in a different part of the file
anyway.

This is yet another diagnostic that should really have an analogue in the
non-overloaded case --- which should be much easier to write because of
the weaker space constraints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
717e8910bb6444f744db78d8d1a020f8f57a83e1 23-Jan-2010 John McCall <rjmccall@apple.com> During overload resolution diagnostics, sort non-viable candidates by the quality of their
conversions. To make this work, fill out all conversions for all candidates
(but only when diagnosing overload failure). Split out a few cases from
ovl_fail_bad_conversion which didn't actually involve a failed argument
conversion.

I'm pretty sure this is not a well-founded ordering, but I'm not sure it matters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f3f91f3719a95036175ad767805657cdfeb54406 22-Jan-2010 Daniel Dunbar <daniel@zuster.org> Use raw_ostream instead of cstdio.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
481683955a28dc5e373d4c380c4737bf3ad51f1c 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f7c43fdd28d4963a16291cb6b000ed955f044262 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Also allow cast of block pointer type to
pointer to an any object. Another variation of
radar 7562285.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b351a7daad4bcac7716d52aa0044a6b7c323ad0d 20-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> In objective-c++ land, a block pointer is another object pointer.
So, casting a generic object pointer ('id' or 'Class') to the
block pointer is allowed. Fixes radar 7562285.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
eec51cf1ba5f0e62c9cdb81b5c63babdd6e649ab 20-Jan-2010 John McCall <rjmccall@apple.com> Give UnresolvedSet the ability to store access specifiers for each declaration.
Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
83b7b31fff0b3b0d6519676c5738b61058202d88 18-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Allow conversion of pointer to an objective-c pointer to
a similar pointer. Fixes radar 7552179.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f3cf22b3b4535282998d74826ccff970a140258f 16-Jan-2010 John McCall <rjmccall@apple.com> Fix a use of uninitialized memory in overload diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1b77e73ef6b7ed886abbc79b89fcb59b0e5c69a1 16-Jan-2010 John McCall <rjmccall@apple.com> Candidates with arity mismatches are extra-special non-viable and need to
stand at the back of the line.

Thanks to Oliver Hunt for reminding me to do this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
651f3eec130099fb46e2ce2c8aee9d01531dc3b5 14-Jan-2010 John McCall <rjmccall@apple.com> Improve overload diagnostics some more by calling out qualifier mismatches
for special diagnostics. Unfortunately, the non-overload diagnostics are not
this good.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e81e15ed0c31f828104b339ceb66648d1c815a8b 14-Jan-2010 John McCall <rjmccall@apple.com> Improve the diagnostic for bad conversions in overload resolution to talk
about 'object argument' vs. 'nth argument'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cefd3ada97faf5a759dac4705900053d3aa071e9 13-Jan-2010 John McCall <rjmccall@apple.com> Don't report ambiguities in the user-defined conversion if we weren't supposed
to be considering user-defined conversions in the first place.

Doug, please review; I'm not sure what we should be doing if we see a real
ambiguity in selecting a copy constructor when otherwise suppressing
user-defined conversions.

Fixes PR6014.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
adbb8f8aa44216d30d204e843c4a74abab929dae 13-Jan-2010 John McCall <rjmccall@apple.com> Record some basic information about bad conversion sequences. Use that
information to feed diagnostics instead of regenerating it. Much room for
improvement here, but fixes some unfortunate problems reporting on method calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
220ccbf2c9ef97034cce80561f9f46c4f1f63bc7 13-Jan-2010 John McCall <rjmccall@apple.com> Improve the reporting of non-viable overload candidates by noting the reason
why the candidate is non-viable. There's a lot we can do to improve this, but
it's a good start. Further improvements should probably be integrated with the
bad-initialization reporting routines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cbce60633c9864261105b289473e5a3ed7b4a729 12-Jan-2010 John McCall <rjmccall@apple.com> So I was sitting around, trying vainly to think of something to commit, and then
I said to myself, self, why don't you go add a couple of parameters to a method
and then fail to use them, and I thought that sounded like a pretty good idea,
so I did it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3c80f573dfbc01f29cc292f6c1fc794705823d52 12-Jan-2010 John McCall <rjmccall@apple.com> Reorganize some of the code to note overload candidates. Improves the
fidelity with which we note them as functions/constructors and templates
thereof. Also will be helpful when reporting bad conversions (next).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bf65c0bb5705430aa7d9a16ca5d441f0cb15071d 12-Jan-2010 John McCall <rjmccall@apple.com> Sort overload results by viability.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1d31833450e6d2947a33cb0840d87661d92eec07 12-Jan-2010 John McCall <rjmccall@apple.com> Introduce a specific representation for the ambiguous implicit conversion
sequence. Lots of small relevant changes. Fixes some serious problems with
ambiguous conversions; also possibly improves associated diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9007328043c9c17029e07c99d89d0488fb3da3a7 11-Jan-2010 Douglas Gregor <dgregor@apple.com> When computing surrogates for calls to a value of object type, look
for all visible conversion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
066b0f122fb919ddffe402de8d43e5395b521b3e 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Remove some pointless FIXMEs. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
48026d26fb58e413544874eead5491b1452e2ebf 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement name lookup for conversion function template specializations
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given

struct X { template<typename T> operator T*(); } x;

when we call

x.operator int*();

we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,

template<> X::operator float*() { /* ... */ }

and when calling or otherwise naming a conversion function (as in the
first example).

This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
81201626aa08bcc9d05c8b3c6a1d38a7d577c3ce 08-Jan-2010 John McCall <rjmccall@apple.com> Change the printing of OR_Deleted overload results to print all the candidates,
not just the viable ones. This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls; users
therefore will want to figure out why some other options were excluded.

Started sorting overload results. Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.

Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a1d7d627a4e6b2f5586644b848b9bd62f54109f4 08-Jan-2010 John McCall <rjmccall@apple.com> Reorganize PrintOverloadCandidates. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
828a197317288e3333b0ce6f5cedadd036e3531f 08-Jan-2010 Douglas Gregor <dgregor@apple.com> Add an "implicit" bit to CXXThisExpr, so that we can track
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1eb3e1003d5cda4d47f54321d81d678c26981e7a 07-Jan-2010 John McCall <rjmccall@apple.com> Improve the lead diagnostic for C++ object subscript expressions with
no viable overloads. Use a different message when the class provides
no operator[] overloads at all; use it for operator(), too.

Partially addresses PR 5900.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b1622a1fd7b7f4ab8d00d0183d17c90ad25c14e3 06-Jan-2010 John McCall <rjmccall@apple.com> Improve the diagnostics used to report implicitly-generated class members
as parts of overload sets. Also, refer to constructors as 'constructors'
rather than functions.

Adjust a lot of tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bb092bafa984e9fa05136b5cef40fd4374dea0f6 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement typo correction for id-expressions, e.g.,

typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
you mean 'radius'?
return radious * pi;
^~~~~~~
radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
28e318cc6008c2bc008f0caee70dc736a03d6289 29-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.

This fixes several aspects of PR5542, but not all of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bd64729ac6de8fed320e7a722597cc5444709c63 29-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Handle using declarations in overloaded and template functions during ADL and
address resolution. This fixes PR5751.

Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2550d70aabb5f603e8f74cc5fb6a69a7af5b51f3 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> move a few more symbols to .rodata/.data.rel.ro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e1a5c17bffba76d20efa89d1d74e5f44159a67bd 23-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix DISABLE_SMART_POINTERS build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
baecfed8b995ace7d6da56e897ee610b8d477828 23-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch Sema::CreateOverloadedUnaryOp over to InitializationSequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4c2458a5ae09fc22fc61aedd380daf54f96d6112 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch parameter passing for overloaded binary operators to
InitializationSequence. Fixes the -fsyntax-only failure in
llvm/lib/Transforms/Scalar/InstructionCombining.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9e9199d8649cf3e10c98a69403f05dbb666d8fb1 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0d6d12b2db47ff34d6cd30917992a8c8ad97aac2 22-Dec-2009 Douglas Gregor <dgregor@apple.com> When converting from a type to itself or one of its base classes via a
constructor call, the conversion is only a standard conversion
sequence if that constructor is a copy constructor. This fixes PR5834
in a semi-lame way, because the "real" fix will be to move over to
InitializationSequence. That will happen "soonish", but not now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4b52e25f3b05ab0f9d2492276a52323a50a84fb7 22-Dec-2009 Douglas Gregor <dgregor@apple.com> When a template-id refers to a single function template, and the
explicitly-specified template arguments are enough to determine the
instantiation, and either template argument deduction fails or is not
performed in that context, we can resolve the template-id down to a
function template specialization (so sayeth C++0x
[temp.arg.explicit]p3). Fixes PR5811.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
adcfab1ffcb754672fb943832e04a79593a07a49 17-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Allow pointer convesion of an objective-c pointer to
'void *' to mimic gcc's behavior. (fixes radar 7477351).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3b4294e5c1e904a2e0f74449dbc3f52f69cc8e9f 16-Dec-2009 John McCall <rjmccall@apple.com> Shift things around so that it's easier to recover from a missing
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.

The diagnostic is still iffy, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
578b69b186d9cba0a6ae1dd7f4c04cd6a49f0aac 16-Dec-2009 John McCall <rjmccall@apple.com> Introduce a centralized routine in Sema for diagnosing failed lookups (when
used as expressions). In dependent contexts, try to recover by doing a lookup
in previously-dependent base classes. We get better diagnostics out, but
unfortunately the recovery fails: we need to turn it into a method call
expression, not a bare call expression. Thus this is still a WIP.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6864748fc9a780e6db0bb5a7bd20aa889882dc94 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix semantic diagnostics that embed English works, from Nicola Gigante!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
019196975a4e6224c95dd1b7d974a1d729e15945 13-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix PR5756 a different, better way: we don't have a "pointer
conversion to void*" according to C++ [over.ics.rank]p4b2 if the type
we're converting from is not a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
335b07ae470045dab25739ded6541744ec8fe40b 13-Dec-2009 Douglas Gregor <dgregor@apple.com> Don't assume that all conversions to a void pointer are converting
from a PointerType. Fixes PR5756.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1f7711d1131f147a2317be0a860041c6e25c69a1 11-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Consider conversion of objective-c pointer to 'bool' a
valid standard conversion to match g++'s behaviour.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9f54ad4381370c6b771424b53d219e661d6d6706 10-Dec-2009 John McCall <rjmccall@apple.com> Implement redeclaration checking and hiding semantics for using declarations. There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not. In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
20093b4bf698f292c664676987541d5103b65b15 10-Dec-2009 Douglas Gregor <dgregor@apple.com> Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
842aef8d942a880eeb9535d40de31a86838264cb 09-Dec-2009 John McCall <rjmccall@apple.com> First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to. This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c8c771ed7e3724d882177fc58933b178de61da8e 09-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Whitespace fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
871b2e7c0f70f87b87b5d5e110391d016a309b63 09-Dec-2009 John McCall <rjmccall@apple.com> Rename Sema::IsOverload to Sema::CheckOverload. Teach it to ignore unresolved
using value decls; we optimistically assume they won't turn into conflicts.
Teach it to tell the caller *why* the function doesn't overload with the returned
decl; this will be useful for using hiding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
43c79c2b07abc7ba6d9f243b84ee6539de4d2652 09-Dec-2009 Douglas Gregor <dgregor@apple.com> Implemented an implicit conversion from "noreturn" function types (and
pointers thereof) to their corresponding non-noreturn function
types. This conversion is considered an exact match for
overload-resolution purposes. Note that we are a little more strict
that GCC is, because we encode noreturn in the type system, but that's
a Good Thing (TM) because it does not allow us to pretend that
potentially-returning function pointers are non-returning function
pointers.

Fxies PR5620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
701c89e02cde6e0fb9673cbe7c97eadc74b50358 03-Dec-2009 John McCall <rjmccall@apple.com> Honor using declarations in overload resolution. Most of the code for
overloaded-operator resolution is wildly untested, but the parallel code for
methods seems to satisfy some trivial tests.

Also change some overload-resolution APIs to take a type instead of an expression,
which lets us avoid creating a spurious CXXThisExpr when resolving implicit
member accesses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
51fa86f738a9768fac4e1cad7bdde53774b5b322 02-Dec-2009 John McCall <rjmccall@apple.com> r90313, in which OverloadedFunctionDecl is removed and never spoken of again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
aa81e1658d87b9011125c632aa902d154ae4b02c 01-Dec-2009 John McCall <rjmccall@apple.com> Rework how we support C++ implicit member accesses. If we can resolve an
implicit member access to a specific declaration, go ahead and create
it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as
appropriate. Otherwise, create an UnresolvedMemberExpr or
DependentScopeMemberExpr with a null base expression.

By representing implicit accesses directly in the AST, we get the ability
to correctly delay the decision about whether it's actually an instance
member access or not until resolution is complete. This permits us
to correctly avoid diagnosing the 'problem' of 'MyType::foo()'
where the relationship to the type isn't really known until instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
129e2df52ed7e0434b3f1cf1867fd6a5cb083ff6 30-Nov-2009 John McCall <rjmccall@apple.com> Eliminate the use of OverloadedFunctionDecl in member expressions.
Create a new UnresolvedMemberExpr for these lookups. Assorted hackery
around qualified member expressions; this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
85b4521e34dcd4a0a4a1f0819e1123128e5a3125 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f7a1a744eba4b29ceb0f20af8f34515d892fdd64 24-Nov-2009 John McCall <rjmccall@apple.com> Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and
DependentScopeDeclRefExpr support storing templateids. Unite the common
code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr.

This gets us to a point where we don't need to store function templates in
the AST using TemplateNames, which is critical to ripping out OverloadedFunction.

Also resolves a few FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7edfb69ae192d9c1f5b1f32af30130f34f98386e 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Do not mark declarations as used when performing overload resolution. Fixes PR5541

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0da76df9218d7c27b471b0a4d83a5b29fe24e5b4 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Centralize and complete the computation of value- and type-dependence for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d5532b6cfff2977e0c59fa6ead7f7973984a620d 23-Nov-2009 John McCall <rjmccall@apple.com> Encapsulate "an array of TemplateArgumentLocs and two angle bracket locations" into
a new class. Use it pervasively throughout Sema.

My fingers hurt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7453ed4cb2cab113de3378df371b1c6f1243d832 22-Nov-2009 John McCall <rjmccall@apple.com> Consider a FunctionTemplate to be an overload all on its lonesome. Track
this information through lookup rather than rederiving it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d2ede7dfbc0d5ba7925a9d2e893af2db6010a855 21-Nov-2009 John McCall <rjmccall@apple.com> Overload resolution doesn't decide whether to do ADL or not anymore; stopping
threading that state.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ba13543329afac4a0d01304ec2ec4924d99306a6 21-Nov-2009 John McCall <rjmccall@apple.com> "Incremental" progress on using expressions, by which I mean totally ripping
into pretty much everything about overload resolution in order to wean
BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace
UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the
idea of a non-member lookup that we haven't totally resolved yet, whether by
overloading, argument-dependent lookup, or (eventually) the presence of
a function template in the lookup results.

Incidentally fixes a problem with argument-dependent lookup where we were
still performing ADL even when the lookup results contained something from
a block scope.

Incidentally improves a diagnostic when using an ObjC ivar from a class method.
This just fell out from rewriting BuildDeclarationNameExpr's interaction with
lookup, and I'm too apathetic to break it out.

The only remaining uses of OverloadedFunctionDecl that I know of are in
TemplateName and MemberExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
699ee52b2f383b62865013c3575510b520055811 20-Nov-2009 Douglas Gregor <dgregor@apple.com> Teach FixOverloadedFunctionReference to build new expression ASTs rather
than tweaking existing ASTs, since we were (*gasp*) stomping on ASTs
within templates. I'm glad we found this little stick of TNT early...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
275c2b47a1dc200d6b55dd867bdfeb7a91b8d876 19-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Do overload resolution for compound assignment even if only the RHS is overloadable. Compound assignment may be overloaded as a non-member, and anyway the overload resolution is necessary because it triggers implicit (used-defined) conversions. Fixes PR5512, but not really the deeper issues lurking. Those are standard defects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6826314938f8510cd1a6b03b5d032592456ae27b 18-Nov-2009 John McCall <rjmccall@apple.com> Overhaul previous-declaration and overload checking to work on lookup results
rather than NamedDecl*. This is a major step towards eliminating
OverloadedFunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
65bdbfa6ca6b9a1170e052cc567d098d0f99cdae 18-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Pretend destructors are const and volatile. This allows calling them with const and/or volatile objects. Fixes PR5548.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a9efadada0430493a4d68b34b2e76580d0fd8f10 18-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Don't generate superfluous and ambiguous built-in candidates for multi-level array subscript and arithmetic. Fixes PR5546.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cc5306ac8a39cdd5e7f83e597cba911e97c4a595 18-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Improve on diagnosing type mismatches because of
lack of viable convesion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7d384dd5ace9ae9a22a69e700d2cacb256bc6c69 18-Nov-2009 John McCall <rjmccall@apple.com> Split LookupResult into its own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4c3b8962291d4255e6f4e27080efefa5ff01dabf 18-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Make CreateOverloadedUnaryOp build the correct node for postinc/dec operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f43fb722f6bf048d548659ad326cfb1cfc14420b 18-Nov-2009 Eli Friedman <eli.friedman@gmail.com> PR5520: Make sure to check whether the base type is complete before looking for
operator->.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0a0d1ac3bd993ea998c3ed8134ddc85b22436943 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve location information when adding conversion candidates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
314be4e7d8ef86202b0ec8e9ff0dcef853db3320 17-Nov-2009 John McCall <rjmccall@apple.com> Store "sugared" decls in LookupResults (i.e. decl aliases like using declarations);
strip the sugar off in getFoundDecl() and getAsSingleDecl(), but leave it on for
clients like overload resolution who want to use the iterators.

Refactor a few pieces of overload resolution to strip off using declarations in
a single place. Don't do anything useful with the extra context knowledge yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a24dc2e38c7fb0f7f138b3d14b5f0f241fd0eccf 17-Nov-2009 John McCall <rjmccall@apple.com> Carry lookup configuration throughout lookup on the LookupResult. Give
LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics
(e.g. access control and deprecation) will be moved to automatically trigger
during lookup as part of this same mechanism.

This abstraction makes it much easier to encapsulate aliasing declarations
(e.g. using declarations) inside the lookup system: eventually, lookup will
just produce the aliases in the LookupResult, and the standard access methods
will naturally strip the aliases off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a4923eb7c4b04d360cb2747641a5e92818edf804 16-Nov-2009 Douglas Gregor <dgregor@apple.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
593564ba94ff854b7a410a4ca17ad34a90c5b761 15-Nov-2009 Douglas Gregor <dgregor@apple.com> When looking for operator() to type-check a call to an object of class
type, use full qualified name lookup rather than the poking the
declaration context directly. This makes sure that we see operator()'s
in superclasses. Also, move the complete-type check before this name
lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a82e4ae149168be47458f298371035911685370c 14-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> - Have TryStaticImplicitCast set the cast kind to NoOp when binding a reference. CheckReferenceInit already inserts implicit casts to the necessary types. This fixes an assertion in CodeGen for some casts and brings a fix for PR5453 close, if I understand that bug correctly.
- Also, perform calculated implicit cast sequences if they're determined to work. This finally diagnoses static_cast to ambiguous or implicit bases and fixes two long-standing fixmes in the test case. For the C-style cast, this requires propagating the access check suppression pretty deep into other functions.
- Pass the expressions for TryStaticCast and TryStaticImplicitCast by reference. This should lead to a better AST being emitted for such casts, and also fixes a memory leak, because CheckReferenceInit and PerformImplicitConversion wrap the node passed to them. These wrappers were previously lost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
66724ea67d7d598b937d86fa66f03f09a1c758f3 14-Nov-2009 Douglas Gregor <dgregor@apple.com> If we attempt to add a constructor template specialization that looks
like a copy constructor to the overload set, just ignore it. This
ensures that we don't try to use such a constructor as a copy
constructor *without* triggering diagnostics at the point of
declaration.

Note that we *do* diagnose such copy constructors when explicitly
written by the user (e.g., as an explicit specialization).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fd47648b5d351ff6d1a3e886e1c3d10712ba4675 14-Nov-2009 Douglas Gregor <dgregor@apple.com> Revert r88718, which does NOT solve the constructor-template-as-copy-constructor issue. Big thanks to John for finding this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cad84b7c12564ff37feb66d6d004bb609bea8788 14-Nov-2009 Douglas Gregor <dgregor@apple.com> A constructor template cannot be instantiated to a copy
constructor. Make sure that such declarations can never be formed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
79b680ea869983d62b84a9175eeb6b6efb376326 13-Nov-2009 Douglas Gregor <dgregor@apple.com> When performing copy initialization (= "implicit conversion", here) to
a class type from itself or a derived class thereof, enumerate
constructors and permit user-defined conversions to the arguments of
those constructors. This fixes the wacky implicit conversion sequence
used in std::auto_ptr's lame emulation of move semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fb898e17cff919bd28b88e9d93301d6e2cc5cbd1 12-Nov-2009 Douglas Gregor <dgregor@apple.com> When comparing template parameter lists, distinguish between three cases:
- Comparing template parameter lists to determine if we have a redeclaration
- Comparing template parameter lists to determine if we have equivalent
template template parameters
- Comparing template parameter lists to determine whether a template
template argument is valid for a given template template parameter.

Previously, we did not distinguish between the last two cases, which
got us into trouble when we were looking for exact type matches
between the types of non-type template parameters that were dependent
types. Now we do, so we properly delay checking of template template
arguments until instantiation time.

Also, fix an accidental fall-through in a case statement that was
causing crashes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
89c49f09b0292dc7c03885f6c765d667a9837597 09-Nov-2009 Douglas Gregor <dgregor@apple.com> Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d411b3f746e612294bd5f0843d83e8c215f7fe58 09-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> For array pointee type, get its cvr qualifier from
its element type. Fixes pr5432.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d47c47d65e339ab1f28e9f9365159cf1047ac1df 09-Nov-2009 Douglas Gregor <dgregor@apple.com> Make sure that we instantiate default function arguments for an
overloaded operator().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3734c21b603ec8546613557a0e8a9f566f424324 07-Nov-2009 Douglas Gregor <dgregor@apple.com> Cope with calls to operator() templates. Fixes PR5419.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
966256afd49a4af0c002046a19bb0041a507909b 06-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements Sema for clause 13.3.3.1p4.
It has to do with vararg constructors used as conversion
functions. Code gen needs work. This is WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a65b55142bd8e8c94f371bb056d8f58f11de220f 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> When collecting types for built-in candidates, make arrays decay to pointers. Otherwise, subscripting an array leads to no candidates at all. Fixes PR5360.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
393896f49d5248435cf203cf1de60a86dc507c44 05-Nov-2009 Douglas Gregor <dgregor@apple.com> Fixed two places where we needed to force completion of a type
(without complaining if it fails) to get proper semantics: reference
binding with a derived-to-base conversion and the enumeration of
constructors for user-defined conversions. There are probably more
cases to fix, but my prior attempt at statically ensuring that
complete-type checking always happens failed. Perhaps I'll try again.

With this change, Clang can parse include/llvm/*.h!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6ca7cfb3fbe4dc92e457fd303814d274176cf359 05-Nov-2009 Douglas Gregor <dgregor@apple.com> When instantiating a UnaryOperator, allow the resulting expression to
still be dependent or invoke an overloaded operator. Previously, we
only supported builtin operators.

BinaryOperator/CompoundAssignOperator didn't have this issue because
we always built a CXXOperatorCallExpr node, even when name lookup
didn't find any functions to save until instantiation time. Now, that
code builds a BinaryOperator or CompoundAssignOperator rather than a
CXXOperatorCallExpr, to save some space.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b1c2ea5dddc9188e2ea30de7f6546f640b85dead 05-Nov-2009 Douglas Gregor <dgregor@apple.com> Make sure to grab CVR qualifiers from the canonical type. ARGH!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2685eab9d36a3568b5d58fba13f0ecef6a611cf9 30-Oct-2009 Douglas Gregor <dgregor@apple.com> We may need to instantiate a class template specialization as part of a derived-to-base pointer case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f322ed6d39a30f509023cf88588c1e6514226127 29-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Properly instantiate usage of overloaded operator []. Fixes PR5345.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
833ca991c1bfc967f0995974ca86f66ba1f666b5 29-Oct-2009 John McCall <rjmccall@apple.com> Track source information for template arguments and template specialization
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9994a34f6cf842721ba7723edc0b9036229fe387 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3eefb1c4bd2c562e43f25e0dba657bb32361dd14 24-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix overload resolution when calling a member template or taking the
address of a member template when explicit template arguments are
provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
097bfb11759be2187732329ecf4c0849609cdf57 24-Oct-2009 Douglas Gregor <dgregor@apple.com> Migrate Sema::ActOnCallExpr to Sema::FixOverloadedFunctionReference,
so that we maintain better source information after template argument
deduction and overloading resolves down to a specific
declaration. Found and dealt with a few more cases that
FixOverloadedFunctionReference didn't cope with.

(Finally) added a test case that puts together this change with the
DeclRefExpr change to (optionally) include nested-name-specifiers and
explicit template argument lists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
644be853b87cae94fcabaf309a5e482a8c291fb9 23-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Apply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent lookup too. This fixes PR5244.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a2813cec2605ce7878d1b13471d685f689b251af 23-Oct-2009 Douglas Gregor <dgregor@apple.com> Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

namespace N { int i; }
int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
423a4e0c853be8f312de9f91a4809eb3a753f824 22-Oct-2009 Douglas Gregor <dgregor@apple.com> When replacing a template-id expression with a declaration reference expression after overloading completes, make sure to keep the qualifier. Still not ready with that test-case...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
573d9c325279b6e156c7fde163ffe3629c62d596 22-Oct-2009 Douglas Gregor <dgregor@apple.com> Don't (directly) call RequireCompleteType with an invalid source location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
652371ad0427b2310ff01ea22fdc37f02d19abe8 22-Oct-2009 Douglas Gregor <dgregor@apple.com> Don't generate pointer types for void or base classes when finding
conversion types for builtin overloaded operator candidates; I misread
this section in the standard the first time around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
96ad5337a4949523ce9df617dad8ca10d3ab9788 21-Oct-2009 Anders Carlsson <andersca@mac.com> Change FixOverloadedFunctionReference to return a (possibly new) expression. Substitute TemplateIdRefExprs with DeclRefExprs. Doug, plz review :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4a27d7061ee2fe0e2b71aa470c323e76afb95917 21-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostics and template instantiation behavior when calling
an overloaded function call operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
705348544cdf9db2b88ebfa60966b62a5be1f3f1 21-Oct-2009 Anders Carlsson <andersca@mac.com> Change ResolveAddressOfOverloadedFunction to support TemplateIdRefExpr. No testcase yet because FixOverloadedFunctionReference needs to be updated too. Doug, plz review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2357da088fdefea1df083a6816f8553c3f53e0d3 20-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Moved comment to its proper place in my last patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8577c98a679d69fe1254e57c67bb3e1d5eaf92be 20-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Patch implements ranking conversions between member pointers [over.ics.rank]



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
73c39abdbb79927605d740c93dd9629e3e4f9bfe 20-Oct-2009 Eli Friedman <eli.friedman@gmail.com> Remove default argument for ImpCastExprToType. Add appropriate argument
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
035c46fee8dd0a4e5a21fc29674297d41da9ec96 20-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Builtin candidate minimization for
<<=, >>= and the rest.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8621d01b253e3f36976d75dd999bdc0f21d9e5d9 19-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Add the built-in candidate set reduction hueristic
to '+=', '-=', '*=' and '/=' builtin operators and
fixes a logic bug exposed by doing this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3759a0361ec00e03584cb6f9ce64fb1f1c947336 19-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Copy conversion of an expression to its base class
is a standard convesion and not a user-defined
conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
07ab20203fb4254f6152c9a7176732fe199adccd 17-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> When resolving the address of an overloaded function or function template, mark the result as referenced.

The most important effect of this is that function templates only referenced by address expressions now get instantiated. This, in turn, means that Hello World compiles with the Apache stdcxx library even when using endl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
759986e85990281ea741820822809ac57fd28c40 17-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Don't add implicit casts of explicit address-taking of overloaded functions.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
866b2744ffe66294c8791cc8407b918f3bb81b2c 17-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to clean up and improve visual display of
builtin function ambiguity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1cad602ee0283947dbf103f13d9a7c098649dfe3 17-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Use VisibleQuals to control setting of Volatile/Restrict qualifiers on
candidate types in BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants
further trimming the overload candidate set.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a9cca896d5f3e871d92d4448e2fe1668c43230a8 15-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Apply heuristics to cut back on number of candidate
sets of builtin operators. Currently, it is applied
to '++' and '->*' operators. I need to apply it to others
as well. Also, heuristics need be applied to
BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants.
This is WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d9842d0e6da0e28b6913b464e37d9a4dc5ec73b9 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement support for overloaded operator uses that result to a call
to a member operator template. We missed updating this call site when
adding support for function templates; bug exposed by a test for
PR5072.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
15ea378083ee4d9e4838076e4a310177da3d46c4 14-Oct-2009 Anders Carlsson <andersca@mac.com> Check the return type of binary operators and the arrow operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
07d68f1f0760110d430c4b849abd49f12777f09c 13-Oct-2009 Anders Carlsson <andersca@mac.com> More return type checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
26a2a07acfacc06406e6a48c6d22e4b26bcd6382 13-Oct-2009 Anders Carlsson <andersca@mac.com> Diagnose invalid return types for unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2ebe7ebb1d6149a1845dd3169009f99b78e91bc9 12-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Handle built-in unary operators when reporting ambiguities.
wip - To prune excessive reporting.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
27687cf7f6fea50e592f653549a33f07bf5c0667 12-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> If built-in operators could not be selected because of ambiguity in
user-defined type conversions, issue list of ambiguites in addition
to the diagnostic. So, clang now issues the following:

b.cpp:19:19: error: left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1'
int i = c1->*pmf;
~~^
b.cpp:19:19: note: because of ambiguity in conversion of 'struct C1' to 'struct E *'
b.cpp:5:5: note: candidate function
operator E*();
^
b.cpp:11:5: note: candidate function
operator E*();
^


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
eed3e699b581ad9e17f8147f26b882d20d65a317 10-Oct-2009 Anders Carlsson <andersca@mac.com> Check that the return type is complete when calling a member function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8c8d91917c307dc3ba4f60661377c745f2a6bef2 10-Oct-2009 Anders Carlsson <andersca@mac.com> Add CheckCallReturnType and start using it for regular call expressions. This will improve error messages. For

struct B;

B f();

void g() {
f();
}

We now get

t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B'
f();
^~~
t.cpp:3:3: note: 'f' declared here
B f();
^
t.cpp:1:8: note: forward declaration of 'struct B'
struct B;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f11e6b24ee5acf95536b94a1d0b20dd04aeca2c4 10-Oct-2009 Douglas Gregor <dgregor@apple.com> Add some FIXMEs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f36e02d4aff98bf2e52e342e0038d4172fbb5e64 09-Oct-2009 John McCall <rjmccall@apple.com> Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines. Call out uses which assume a single
result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ad3607da8ad626c408d8e6d804bf1359977b200a 09-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Produce good looking diagnostics on ambiguous built-in operators.
Now we produce things like:
bug1.cpp:21:11: error: use of overloaded operator '->*' is ambiguous
int i = c->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \
~^ ~~~
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int const struct A::*')
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int restrict struct A::*')
...

Still need to look at an issue (indicated as FIXME in the test case).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5ecd5399421799892a2b3dc5456e816bd6d827ab 09-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Use the new API for applying the qualifiers on built-in '->*'
operator's types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
16a5eac559730f4a7ec5ffdab3f236f51df85b63 09-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Improve on reporting ambiguity involving built-in candidates.
I still don't like it but it is improvement over what we had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6e8f550439c09f3f044d651354e297518b553712 08-Oct-2009 Anders Carlsson <andersca@mac.com> Handle MemberExprs in ResolveAddressOfOverloadedFunction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ca4fb04b5c43f866c095a3bcc14e02a150da2568 07-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> When building candidate set for built-ins; when looking for
convesion functions, look in base classes to.
(Removes a FIXME).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4303697cbcf1b56ea9387185d6625db2025d56ee 07-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Removed couple of unnecessary canonicalization
per Doug's obsevation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4657a992742862639a356352c26b4e88f995b578 07-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement C++ [over.built]p11 of overload resolution.
Doug, please review. There is a FIXME in the test case with a question
which is unrelated to this patch (that is, error is issued
before set of builtins are added to the candidate list).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a8f32e0965ee19ecc53cd796e34268377a20357c 06-Oct-2009 Douglas Gregor <dgregor@apple.com> Refactor the code that walks a C++ inheritance hierarchy, searching
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
56fc0d18caf9c829647a5e3ce35197f0d7e0feee 06-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Refixed pr5086 by letting Expr::isNullPointerConstant
handle checking for a null pointer for a zero-valued
enumerator; moving the test case from CodeGen to Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f8c3ad7653697ae91634bda56cb0e3d6eac2ef45 02-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> enumerator value of 0 is not a null pointer constant for
deciding const of null pointer conversion. Fixes PR5086.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
249ceade4942a2a5d7888541c547abeda5bb85b4 01-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement static casting which requires one
user-defined type conversion. Fixes PR5040.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3307475eb0dd6e5d88be9392ea8247d0b6b812df 30-Sep-2009 Douglas Gregor <dgregor@apple.com> When overload resolution fails for an overloaded operator, show the
overload candidates (but not the built-in ones). We still rely on the
underlying built-in semantic analysis to produce the initial
diagnostic, then print the candidates following that diagnostic.

One side advantage of this approach is that we can perform more validation
of C++'s operator overloading with built-in candidates vs. the
semantic analysis for those built-in operators: when there are no
viable candidates, we know to expect an error from the built-in
operator handling code. Otherwise, we are not modeling the built-in
semantics properly within operator overloading. This is checked as:

assert(Result.isInvalid() &&
"C++ binary operator overloading is missing
candidates!");
if (Result.isInvalid())
PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);

The assert() catches cases where we're wrong in a +Asserts build. The
"if" makes sure that, if this happens in a production clang
(-Asserts), we still build the proper built-in operator and continue
on our merry way. This is effectively what happened before this
change, but we've added the assert() to catch more flies.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7a8233a69103a6eeb6602bd4a17fb5d9b7bacaad 30-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Note location of operators caused the circularity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4a6a2b80c1771a2688a6349f8302263a3ebf4659 29-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a nasty bug which only turned up in 32bit build of clang and
had to do with an initialized field when multiple type conversions
are ambiguous but must be treated as user defined conversion for
overload resolution purposes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b74002395520cff5933e16e06ba3f470b627bfb2 29-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Define and use a helper method to call a type conversion
function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
82ad87b872b4c75b5e47f5b3514cc7ab082150d6 29-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Minor API change. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
99d6c445cc968bdf08c53a6bd4e9044bde43bdd1 28-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Multiple conversions to the same type are ambiguous but for the
purpose of overload resolution is to be treated as a uner-defined
conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d8307b1033ef52a1ae640691bc45052fddb07a69 28-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for AST representation for the implicit conversion to a function
reference/pointer. And a test case for code gen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3f396029a502fdec8c12d02d8c405d6097d8b417 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Don't allow the same function to enter the overload candidate set
multiple times. This requires to be more careful about re-adding
candidates cached from the function template definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
312a20241871b81a672a5f08dfb52a5674246cd0 26-Sep-2009 Douglas Gregor <dgregor@apple.com> Yet another simplifying use of Sema::getMostSpecialized

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ce94049b69f75b44c18584fe79cd238978b6b0d5 25-Sep-2009 Douglas Gregor <dgregor@apple.com> Fix checking for a null pointer constant when the expression itself is
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b9aa6b214c8fbc3e081dde575eef1f0913d48bdc 25-Sep-2009 Douglas Gregor <dgregor@apple.com> WIP implementation of explicit function template specialization. This
first implementation recognizes when a function declaration is an
explicit function template specialization (based on the presence of a
template<> header), performs template argument deduction + ambiguity
resolution to determine which template is being specialized, and hooks

There are many caveats here:
- We completely and totally drop any explicitly-specified template
arguments on the floor
- We don't diagnose any of the extra semantic things that we should
diagnose.
- I haven't looked to see that we're getting the right linkage for
explicit specializations

On a happy note, this silences a bunch of errors that show up in
libstdc++'s <iostream>, although Clang still can't get through the
entire header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
739d8283149d999f598a7514c6ec2b42598f51d3 24-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostic location information when checking the initialization of a reference

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5bd1a1151f5da8236c5b60f4e8a6135627a8130a 23-Sep-2009 Douglas Gregor <dgregor@apple.com> When code-completion after a "," is building an overload set, note
that there is one more argument (the one following the comma) and make
the candidate non-viable if the function cannot accept any argument in
that position.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b1663d050744ab3a4987df2d3a394f3ae0468435 23-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Produce detailed diagnostics when overload
resolution failed to select a candidate due to
ambiguity in type conversion function selection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
17c7a5d7ae8c818696e10a62bbcf19fa6cb90755 22-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Code refactoring and cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
455acd9452f5b2a69d7ab8e53f733e46b500473a 22-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue good ambiguity diagnostic when convesion fails.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9c6a0e92dbf89897eae6106b24bfd017f269bfd0 22-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement code completion within a function call, triggered after the
opening parentheses and after each comma. We gather the set of visible
overloaded functions, perform "partial" overloading based on the set
of arguments that we have thus far, and return the still-viable
results sorted by the likelihood that they will be the best candidate.

Most of the changes in this patch are a refactoring of the overloading
routines for a function call, since we needed to separate out the
notion of building an overload set (common to code-completion and
normal semantic analysis) and then what to do with that overload
set. As part of this change, I've pushed explicit template arguments
into a few more subroutines.

There is still much more work to do in this area. Function templates
won't be handled well (unless we happen to deduce all of the template
arguments before we hit the completion point), nor will overloaded
function-call operators or calls to member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
183700f494ec9b6701b6efe82bcb25f4c79ba561 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1fdd89ba1d14ee11fda5b9e1c171db428b1acb23 15-Sep-2009 Douglas Gregor <dgregor@apple.com> When printing an overload candidate that is a function template specialization,
point at the template and print out its template arguments, e.g.,

ambiguous-ovl-print.cpp:5:8: note: candidate function template specialization
[with T = int]
void f(T*, long);




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
34acd3e62c4ca3a2904f2515ff2a1a94c7d27b01 15-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue good diagnostics when initialization failes due to
ambiguity in type conversion function selection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
78cf9a26d27349a7b9ae83a0b7d5451571b9b41e 15-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue a good diagnostics when attempt to select
a type convesion function results in ambiguity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5d7d37506319d432f8f5e3952b7427e1e4aacd2e 15-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement partial ordering of function templates when calling a
conversion function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d173b207a032b39d35727877fc794aa2f52dc290 15-Sep-2009 Douglas Gregor <dgregor@apple.com> Test function template partial ordering when resolving the address of
an overloaded function (template).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b191e2dda9f4dc033cb21f9625a78fe80d4ac105 14-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Used visible conversion function api to do overload
resolution of type conversion functions in base and
current class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8a51491d936d8c50480f3c3ca6647be12a7ad51f 14-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement partial ordering of function template specializations
(C++ [temp.func.order]).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
61faec1e9cd1ddaaae9e7216c4b751681af271e4 12-Sep-2009 Anders Carlsson <andersca@mac.com> Use the correct CastKind for derived-to-base pointer conversions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8664ad5cbdf01ac9878c8f762cc91f4bb7196098 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Undid my yesterday patch which is not needed with an upcoming patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e30572ae31b4b1875d7a6d4375b5c6b3a1caf9e3 11-Sep-2009 Anders Carlsson <andersca@mac.com> Look for overloaded arrow operators in base classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
417292c8d7370644f2ec60dae0371442444ee893 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to collect conversion methods in base(s) and derived
class into a candidate set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c4bf26fbdff42967d660f505a83f75a4df2cc752 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

x->f<int>()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
faccd72e2448b552f17992eaba6cfe12ec497e58 28-Aug-2009 Anders Carlsson <andersca@mac.com> Fix this for real.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bbf306bd1d3e674edf40c692a5693a475e961a57 28-Aug-2009 Anders Carlsson <andersca@mac.com> When doing overload resolution, expressions that are value dependent but not type dependent and of integral type should not be treated as null pointer constants.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
08972924fadafeadcee25ecf52c5fa6cfc729332 28-Aug-2009 Anders Carlsson <andersca@mac.com> Pass InOverloadResolution all the way down to IsPointerConversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8a5ae2401645788144c0ae769a2fb899866801f5 28-Aug-2009 Douglas Gregor <dgregor@apple.com> When looking for overloaded member operators, make sure to instantiate
class template specializations (when possible) and look into base
classes. Thanks to Eli for the test case!

FIXME -=1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7b361b588031483658c4364e02026ffb06e78c26 27-Aug-2009 Anders Carlsson <andersca@mac.com> Add an InOverloadResolution flag to TryCopyInitialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2de3aced4c4373d8a078604c8e61e267a323853a 27-Aug-2009 Anders Carlsson <andersca@mac.com> Remove more default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
da7a18be8f139e1176e457d81c275c0e7ae0ced7 27-Aug-2009 Anders Carlsson <andersca@mac.com> Remove default arguments from TryImplicitConversion and fix a bug found in the process.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d28b42862bc627f4fc1430b4a1919b304800dc1c 27-Aug-2009 Anders Carlsson <andersca@mac.com> Remove default argument from TryCopyInitialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2974b5cd2669877139e45439084de540d082127a 27-Aug-2009 Anders Carlsson <andersca@mac.com> Revert the flags change for now, I have a better idea for this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
19377389530101d583955537729e8889d487d59e 27-Aug-2009 Anders Carlsson <andersca@mac.com> Add a OverloadResolutionFlags and start converting some of the overload methods over to using it instead of bools arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b790661a15d93941d2c33a0ea328254277b3d7e3 27-Aug-2009 Anders Carlsson <andersca@mac.com> Bye-bye old RequireCompleteType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c3384cba391f9140a46db0caa061649b633f65bc 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix for overloaded binary operators whose operands need implicit
conversions, from Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5842ba9fd482bb2fe5198b32c2ae549cd5474e6d 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Try to complete a type before looking for conversion functions within
that type. Note that we do not produce a diagnostic if the type is
incomplete; rather, we just don't look for conversion functions. Fixes PR4660.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
19b7b158699983e70693c73f3b982fd16c056585 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f42e4a6e089e8413247400fe58ad299193371f9c 24-Aug-2009 Torok Edwin <edwintorok@gmail.com> Fix build of clang with gcc-4.4: #include <cstdio> was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
27a5b9b9babd1e4f8a19c5c9c0736c4b311c79b2 23-Aug-2009 Anders Carlsson <andersca@mac.com> Add CK_NullToMemberPointer and CK_BaseToDerivedMemberPointer cast kinds. Make -ast-dump print out the cast kinds of cast expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
65ec1fda479688d143fe2403242cd9c730c800a1 22-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dec06664a1c4d8984251083db2215875aea1c80d 21-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce support for constructor templates, which can now be declared
and will participate in overload resolution. Unify the instantiation
of CXXMethodDecls and CXXConstructorDecls, which had already gotten
out-of-sync.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
641f7d196069926f55c63fa7d32db08eb2a21559 21-Aug-2009 Daniel Dunbar <daniel@zuster.org> gcc told me to add these.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6b906869527be40b0d38d755e9ef51b331b88162 21-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement support for calling member function templates, which involves:
- Allowing one to name a member function template within a class
template and on the right-hand side of a member access expression.
- Template argument deduction for calls to member function templates.
- Registering specializations of member function templates (and
finding them later).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a95d75769edae299816ec7fd9bbcdf1ef617c5c9 19-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Make integer promotions work correctly on PIC16 and other platforms
where sizeof(short) == sizeof(int). Move UsualArithmeticConversionsType
out of Sema, since it was only there as a historical artifact. Patch by
Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2d46eb21eb2c904831b0e9f75ab3523384c70e66 16-Aug-2009 Anders Carlsson <andersca@mac.com> Call MaybeBindToTemporary for overloaded binary and unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a303f9eab9ceb356a24d84e178d079f0d41ad8d4 16-Aug-2009 Anders Carlsson <andersca@mac.com> Call MaybeBindToTemporary when constructing functino call operator calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6f68027af2b6ce294a2706f23a1d3cb7ca1b8d37 16-Aug-2009 Anders Carlsson <andersca@mac.com> Add MaybeBindToTemporary calls for member call expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d406bf0e8c17012110a8476d03c6f9a97b56ecf7 16-Aug-2009 Anders Carlsson <andersca@mac.com> Move builtin call checking out into a separate function, make CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f1480eee38b59d15438fb7bc50865ac7c7e22403 14-Aug-2009 Anders Carlsson <andersca@mac.com> Make the CXXDefaultArgExpr constructor protected and add a static Create function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
116b7d9cd0a31b34f32f6c5fe5b799367b70f257 07-Aug-2009 Anders Carlsson <andersca@mac.com> Use the correct cast kind as suggested by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
52ab92bee00eb14e38dcbefc091d6b9aa5157506 06-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> After reporting ill-formed copy constructor(12.8.p3)
don't recurs and crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fe85cedd58df7daed29201703cfb8806e12876d0 06-Aug-2009 Douglas Gregor <dgregor@apple.com> Support nested-name-specifiers for C++ member access expressions, e.g.,

this->Base::foo

from James Porter!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
33a3138a0862cafdd9ff1332b834454a79cd2cdc 05-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of "smart" quotes. Per report on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ac5fc7c6bcb494b60fee7ce615ac931c5db6135e 04-Aug-2009 Mike Stump <mrs@apple.com> Canonicalize else.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1f561c14edb9c2f54d5f4d0ad0f4b2f4bb6ece5e 03-Aug-2009 Douglas Gregor <dgregor@apple.com> Produce a warning that partial ordering of function templates is not yet supported

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3503d041ca8a3535a1c1a30005a6b18ae7aed5db 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add CK_DerivedToBase and use it PerformObjectMemberConversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cdef2b75aa60cde1ca00e0aa3f89139ac89c6ae4 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6217b80b7a1379b74cced1c076338262c3c980b3 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9cc11e70031365972424b43f439021d88096b146 25-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ semantics for C-style and functional-style casts. This regresses Clang extension conversions, like vectors, but allows conversions via constructors and conversion operators.
Add custom conversions to static_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4084c306635b70f37029dca938444e6013f08684 23-Jul-2009 Steve Naroff <snaroff@apple.com> Remove a bunch of FIXME's related to ObjC type checking.

- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible().
- Tweak several test cases to accommodate the new/improved type checking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
97fbaa2a38804268a024f1a104b43fcf8b4411b0 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
35366a67baa970c287c714c957cf78a4131cf60d 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5cad1f74469d4d8b4fc51fe53a7837778aeb6107 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
808825cd08704d1cccef605f8cd3ef83c93eac78 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replace Type::getAsReferenceType() with Type::getAs<ReferenceType>().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1a1a6e2bd4c5aefd7fd643cf25915f9623a02e59 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f49545602089be5b1f744e04326b8a566f6d8773 16-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
de2e22d33afec98324a66a358dfe0951b3c7259a 15-Jul-2009 Steve Naroff <snaroff@apple.com> Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).

This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f5c209d23b20ada4a9b6235db50317239cbf6ae1 14-Jul-2009 Alisdair Meredith <public@alisdairm.net> Basic support for C++0x unicode types. Support for literals will follow in an incremental patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
812730911edee505015a1ee3b0bf48be7e838532 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> For C++ overloaded operator calls, set the source location of the DeclRefExpr to the location of the operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
14108da7f7fc059772711e4ffee1322a27b152a7 11-Jul-2009 Steve Naroff <snaroff@apple.com> This patch includes a conceptually simple, but very intrusive/pervasive change.

The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
72e771f12a97700e578b28f953622a6b6916bef1 09-Jul-2009 Douglas Gregor <dgregor@apple.com> Add test for C++ [over.over.]p1, the contexts in which one can take the address of an overloaded function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
00aeb52314ec0b1902bb15aef9c62259296fbc29 09-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement the simple form of overload resolution used when taking the
address of an overloaded function (which may involve both functions
and function templates).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
83314aa1cf61ed2458a8a20c83b2d4708192d5dc 08-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement template argument deduction when taking the address of a
function template. Most of the change here is in factoring out the
common bits used for template argument deduction from a function call
and when taking the address of a function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3e15cc318e9cd577eda56c0294f32535738d8630 08-Jul-2009 Douglas Gregor <dgregor@apple.com> Overload resolution prefers non-templates to templates

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6db8ed4498b83fe9336e3855a4ba1a298b04ee00 01-Jul-2009 Douglas Gregor <dgregor@apple.com> When explicit template arguments are provided for a function call,
substitute those template arguments into the function parameter types
prior to template argument deduction. There's still a bit of work to
do to make this work properly when only some of the template arguments
are specified.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
17945a0f64fe03ff6ec0c2146005a87636e3ac12 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
40b598eea1310ec9ed554d56ce3e25b34c585458 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
364e021e8cbbeebd4d2544053268a008cf9ee5a9 27-Jun-2009 Douglas Gregor <dgregor@apple.com> Improve support for overloaded operator templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e53060fa78ad7e98352049f72787bdb7543e2a48 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

template<typename T> T& deref(T* t) { return *t; }

void test(int *ip) {
int &ir = deref(ip);
}

Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
34d1dc9f0ca8f5b0528a8cd29f1addfe096361b8 24-Jun-2009 Douglas Gregor <dgregor@apple.com> Implement matching of function templates, so that one can declare overloaded function templates. C++ [temp.over.link] paragraphs 4-8.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e0762c92110dfdcdd207db461a4ea17afd168f1e 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
68584ed35ad819a1668e3f527ba7f5dd4ae6a333 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8593c7810fba6548679e7c89d8eaccebf4d5ec20 21-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Avoid using the built-in type checker for assignment in C++ when classes are involved. Patch by Vyacheslav Kononenko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3384c9c1882bab002971f59a31b1da47b13c818c 19-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for array subscript expressions. This was far
easier than expected because of the limitation that subscript
operators must be member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
390b4cc8b45a05612349269ef08faab3e4688f06 16-May-2009 Mike Stump <mrs@apple.com> Reflow some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6e8ed16ffef02b82995a90bdcf10ffff7d63839a 10-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++0x nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
33bbbc5ec8269bc2cde5b84f970fa49319a30267 02-May-2009 Douglas Gregor <dgregor@apple.com> When determining whether an expression refers to a bit-field, look
into the left-hand side of an assignment expression. This completes
most of PR3500; the only remaining part is to deal with the
GCC-specific implementation-defined behavior for "unsigned long" (and
other) bit-fields.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a552f7c125d9f70eeb9e9793a2fabe99b806c983 01-May-2009 Anders Carlsson <andersca@mac.com> Get rid of the implicit deref call when calling member functions where the base is a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0c74e8a4e8865ec9ebb8efc0af247a3c077236c4 30-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement semantic analysis for transparent unions. This is largely
based on a patch from Anders Johnsen. CodeGen support is incomplete,
in that we do not properly coerce to the first field's type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
78eb874222b7653edf7182d0d899d717d5c592c1 19-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Conditional operator C++ checking complete. What issues remain are in more general code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3201f6beec688ab9fe8750527e28f52d5420e22d 16-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a crash bug when comparing overload quality of conversion operators with conversion constructors.
Remove an atrocious amount of trailing whitespace in the overloaded operator mangler. Sorry, couldn't help myself.
Change the DeclType parameter of Sema::CheckReferenceInit to be passed by value instead of reference. It wasn't changed anywhere.
Let the parser handle C++'s irregular grammar around assignment-expression and conditional-expression.
And finally, the reason for all this stuff: implement C++ semantics for the conditional operator. The implementation is complete except for determining lvalueness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e2b6833d445c7a4ce64f1816c05f176ba1740aca 12-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Parse deleted member functions. Parsing member declarations goes through a different code path that I forgot previously.
Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now.
The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
312531a8cd69c562d5687bd69fd334be99d87320 12-Apr-2009 Chris Lattner <sabre@nondot.org> implement rdar://6780761, making sema reject some code that otherwise
crashes codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6ab3524f72a6e64aa04973fa9433b5559abb3525 09-Apr-2009 Douglas Gregor <dgregor@apple.com> Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
85002394ca152cc794d2aecd31ed0ec9586838d6 30-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Hopefully fix the rval regressions. Thanks to Chris for pointing out that valgrind complains.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a98458054d9004ad414a8518057f8ce08f23ae70 29-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce r67870 (rval ref overloading), since I can't reproduce any test failures on i386 or x86_64. If this fails for someone, please contact me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e37b94c718169ca429acfb1ffe50f7e9b987512b 29-Mar-2009 Chris Lattner <sabre@nondot.org> QualType can go in SmallPtrSet now, simplify code that used to have
to work around this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b28317a8e5e0e2953d1e5406d753d6c3c7f1e7d2 28-Mar-2009 Chris Lattner <sabre@nondot.org> Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer. Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the
entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy. I will rectify
this with a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
14734f7d2a69f9076e8a06954f06d3313063e7f9 28-Mar-2009 Anders Carlsson <andersca@mac.com> Revert Sebastian's rvalue patch (r67870) since it caused test failures in

SemaCXX//overload-member-call.cpp
SemaCXX//overloaded-operator.cpp
SemaTemplate//instantiate-method.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f8738782e3322923501c8c185b152f0553a37463 27-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Better overload resolution for rvalue references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bad0e656c3732e3539a9cd6525de721d7e47408b 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Type::isObjectType now implements the (more sensible) C++ definition
of "object type" rather than the C definition of "object type". The
difference is that C's "object type" excludes incomplete types such as

struct X;

However, C's definition also makes it far too easy to use isObjectType
as a means to detect incomplete types when in fact we should use other
means (e.g., Sema::RequireCompleteType) that cope with C++ semantics,
including template instantiation.

I've already audited every use of isObjectType and isIncompleteType to
ensure that they are doing the right thing for both C and C++, so this
is patch does not change any functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f2e21e5ad5e816d88e048c89dc775a9d4547c089 23-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Disallow catching exceptions by rvalue reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7c80bd64032e610c0dbd74fc0ef6ea334447f2fd 17-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Almost complete implementation of rvalue references. One bug, and a few unclear areas. Maybe Doug can shed some light on some of the fixmes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bc736fceca6f0bca31d16003a7587857190408fb 14-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for the prefix unary operators. As
always, refactored the existing logic to tease apart the parser action
and the semantic analysis shared by the parser and template
instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
063daf6e196c51f162e0485478355d8e280eef5c 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Refactor the way we handle operator overloading and template
instantiation for binary operators. This change moves most of the
operator-overloading code from the parser action ActOnBinOp to a new,
parser-independent semantic checking routine CreateOverloadedBinOp.

Of particular importance is the fact that CreateOverloadedBinOp does
*not* perform any name lookup based on the current parsing context (it
doesn't take a Scope*), since it has to be usable during template
instantiation, when there is no scope information. Rather, it takes a
pre-computed set of functions that are visible from the context or via
argument-dependent lookup, and adds to that set any member operators
and built-in operator candidates. The set of functions is computed in
the parser action ActOnBinOp based on the current context (both
operator name lookup and argument-dependent lookup). Within a
template, the set computed by ActOnBinOp is saved within the
type-dependent AST node and is augmented with the results of
argument-dependent name lookup at instantiation time (see
TemplateExprInstantiator::VisitCXXOperatorCallExpr).

Sadly, we can't fully test this yet. I'll follow up with template
instantiation for sizeof so that the real fun can begin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3fd95ce225393fe4a3623e429766a8c3f487ff9d 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve the representation of operator expressions like "x + y" within
C++ templates. In particular, keep track of the overloaded operators
that are visible from the template definition, so that they can be
merged with those operators visible via argument-dependent lookup at
instantiation time.

Refactored the lookup routines for argument-dependent lookup and for
operator name lookup, so they can be called without immediately adding
the results to an overload set.

Instantiation of these expressions is completely wrong. I'll work on
that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c1efaecf0373f1a55c5ef4c234357cf726fc0600 28-Feb-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXRecordType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
72564e73277e29f6db3305d1f27ba408abb7ed88 27-Feb-2009 Douglas Gregor <dgregor@apple.com> Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.

Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.

As part of this, some types have been renamed:

TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bb71001d287fda144c4bcf096124d8e3667d6930 26-Feb-2009 Daniel Dunbar <daniel@zuster.org> Drop uses of getAsPointerLikeType.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
611a8c49c6a5848aed17eced8f2f3f7b1b7577a1 19-Feb-2009 Douglas Gregor <dgregor@apple.com> Provide a proper source location when building an implicit dereference. Fixes PR3600

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
48f3bb9f780f6e64ab71ba0202ca04b07473805a 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Downgrade complaints about calling unavailable functions to a warning
(as GCC does), except when we've performed overload resolution and
found an unavailable function: in this case, we actually error.

Merge the checking of unavailable functions with the checking for
deprecated functions. This unifies a bit of code, and makes sure that
we're checking for unavailable functions in the right places. Also,
this check can cause an error. We may, eventually, want an option to
make "unavailable" warnings into errors.

Implement much of the logic needed for C++0x deleted functions, which
are effectively the same as "unavailable" functions (but always cause
an error when referenced). However, we don't have the syntax to
specify deleted functions yet :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4330d65797e10618e39817ca59e8772671c3de59 17-Feb-2009 Chris Lattner <sabre@nondot.org> remove "; candidates are/is:" from various ambiguity diagnostics.
2 out of 2 people on irc prefer them gone :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
389bf46ae41241a656ed71b00ac2177d7f385651 12-Feb-2009 Steve Naroff <snaroff@apple.com> Several cleanups:
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b7b5d13de34272b31681e7eafa9851e39bde2ef9 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Expand the definition of a complex promotion to include complex ->
complex conversions where the conversion between the real types is an
integral promotion. This is how G++ handles complex promotions for its
complex integer extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5cdf82164dd7c2b2320d6735c63ace4331e0716d 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Introduce _Complex conversions into the function overloading
system. Since C99 doesn't have overloading and C++ doesn't have
_Complex, there is no specification for this. Here's what I think
makes sense.

Complex conversions come in several flavors:

- Complex promotions: a complex -> complex conversion where the
underlying real-type conversion is a floating-point promotion. GCC
seems to call this a promotion, EDG does something else. This is
given "promotion" rank for determining the best viable function.
- Complex conversions: a complex -> complex conversion that is
not a complex promotion. This is given "conversion" rank for
determining the best viable function.
- Complex-real conversions: a real -> complex or complex -> real
conversion. This is given "conversion" rank for determining the
best viable function.

These rules are the same for C99 (when using the "overloadable"
attribute) and C++. However, there is one difference in the handling
of floating-point promotions: in C99, float -> long double and double
-> long double are considered promotions (so we give them "promotion"
rank), while C++ considers these conversions ("conversion" rank).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f9201e0ff1779567150b70856753d9f2c6a91467 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of function overloading in C.

This commit adds a new attribute, "overloadable", that enables C++
function overloading in C. The attribute can only be added to function
declarations, e.g.,

int *f(int) __attribute__((overloadable));

If the "overloadable" attribute exists on a function with a given
name, *all* functions with that name (and in that scope) must have the
"overloadable" attribute. Sets of overloaded functions with the
"overloadable" attribute then follow the normal C++ rules for
overloaded functions, e.g., overloads must have different
parameter-type-lists from each other.

When calling an overloaded function in C, we follow the same
overloading rules as C++, with three extensions to the set of standard
conversions:

- A value of a given struct or union type T can be converted to the
type T. This is just the identity conversion. (In C++, this would
go through a copy constructor).
- A value of pointer type T* can be converted to a value of type U*
if T and U are compatible types. This conversion has Conversion
rank (it's considered a pointer conversion in C).
- A value of type T can be converted to a value of type U if T and U
are compatible (and are not both pointer types). This conversion
has Conversion rank (it's considered to be a new kind of
conversion unique to C, a "compatible" conversion).

Known defects (and, therefore, next steps):
1) The standard-conversion handling does not understand conversions
involving _Complex or vector extensions, so it is likely to get
these wrong. We need to add these conversions.
2) All overloadable functions with the same name will have the same
linkage name, which means we'll get a collision in the linker (if
not sooner). We'll need to mangle the names of these functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
b86b0579c5805c8ecaedd2d676e06bf8c2bf7f79 11-Feb-2009 Douglas Gregor <dgregor@apple.com> Add semantic checking for template arguments that correspond to
non-type template parameters that are references to functions or
pointers to member functions. Did a little bit of refactoring so that
these two cases, along with the handling of non-type template
parameters that are pointers to functions, are handled by the same
path.

Also, tweaked FixOverloadedFunctionReference to cope with member
function pointers. This is a necessary step for getting all of the fun
member pointer conversions working outside of template arguments, too.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a35284bba5db7a6179d70fcce8fbe66481058698 11-Feb-2009 Douglas Gregor <dgregor@apple.com> Add partial semantic checking of template arguments that are meant for
non-type template parameters of pointer-to-object and
pointer-to-function type. The most fun part of this is the use of
overload resolution to pick a function from the set of overloaded
functions that comes in as a template argument.

Also, fixed two minor bugs in this area:
- We were allowing non-type template parameters of type pointer to
void.
- We weren't patching up an expression that refers to an overloaded
function set via "&f" properly.

We're still not performing complete checking of the expression to be
sure that it is referring to an object or function with external
linkage (C++ [temp.arg.nontype]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
668bf91d31265b6ea8c3eb854ba450857701f269 09-Feb-2009 Ted Kremenek <kremenek@apple.com> CallExpr now uses ASTContext's allocate to allocate/delete its array of subexpressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8189cde56b4f6f938cd65f53c932fe1860d0204c 07-Feb-2009 Ted Kremenek <kremenek@apple.com> Overhaul of Stmt allocation:
- Made allocation of Stmt objects using vanilla new/delete a *compiler
error* by making this new/delete "protected" within class Stmt.
- Now the only way to allocate Stmt objects is by using the new
operator that takes ASTContext& as an argument. This ensures that
all Stmt nodes are allocated from the same (pool) allocator.
- Naturally, these two changes required that *all* creation sites for
AST nodes use new (ASTContext&). This is a large patch, but the
majority of the changes are just this mechanical adjustment.
- The above changes also mean that AST nodes can no longer be
deallocated using 'delete'. Instead, one most do
StmtObject->Destroy(ASTContext&) or do
ASTContextObject.Deallocate(StmtObject) (the latter not running the
'Destroy' method).

Along the way I also...
- Made CompoundStmt allocate its array of Stmt* using the allocator in
ASTContext (previously it used std::vector). There are a whole
bunch of other Stmt classes that need to be similarly changed to
ensure that all memory allocated for ASTs comes from the allocator
in ASTContext.
- Added a new smart pointer ExprOwningPtr to Sema.h. This replaces
the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
'delete' to free memory instead of a Stmt's 'Destroy' method.

Big thanks to Doug Gregor for helping with the acrobatics of making
'new/delete' private and the new smart pointer ExprOwningPtr!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0defd76d0b73c4866f1d5f71a274bf125fafd446 05-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Remove some non-ASCII in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
33b399a8fdd0910ed86b60e61c6a02ba8258bbe3 04-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement taking address of member functions, including overloaded ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f680a0fe2dcab32b59fe6fdf71145b5313c40950 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Bring operator name lookup (as required for C++ operator overloading)
into the general name-lookup fold. This cleans up some ugly,
not-quite-working code in the handling of operator overloading.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
17330019f05966762bc952840ef1926b9becb145 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Fix our semantic analysis of

unqualified-id '('

in C++. The unqualified-id might not refer to any declaration in our
current scope, but declarations by that name might be found via
argument-dependent lookup. We now do so properly.

As part of this change, CXXDependentNameExpr, which was previously
designed to express the unqualified-id in the above constructor within
templates, has become UnresolvedFunctionNameExpr, which does
effectively the same thing but will work for both templates and
non-templates.

Additionally, we cope with all unqualified-ids, since ADL also applies
in cases like

operator+(x, y)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fa047648b2a5502d7eef117adb4777eb9a63baa6 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of argument dependent lookup (a.k.a. ADL,
a.k.a. Koenig lookup) in C++. Most of the pieces are in place, but for
two:

- In an unqualified call g(x), even if the name does not refer to
anything in the current scope, we can still find functions named
"g" based on ADL. We don't yet have this ability.
- ADL will need updating for friend functions and templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2b1e0039a1937e3df59b5c99bcf4746360db3441 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Steve set me straight on this one. GCC was right, EDG was wrong: the
direct-initialization following a user-defined conversion can select
any constructor; it just can't employ any user-defined
conversions. So we ban those conversions and classify the constructor
call based on the relationship between the "from" and "to" types in
the conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
734d9869efb5d126df53ba70a6060789887e0d68 31-Jan-2009 Douglas Gregor <dgregor@apple.com> Improve our handling of the second step in a user-defined conversion
sequence. Previously, we weren't permitting the second step to call
copy constructors, which left user-defined conversion sequences
surprisingly broken.

Now, we perform overload resolution among all of the constructors, but
only accept the result if it makes the conversion a standard
conversion. Note that this behavior is different from both GCC and EDG
(which don't agree with each other, either); I've submitted a core
issue on the matter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4c921ae760cbdd9270c16d48417d7d527eb0ceb8 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Eliminated LookupCriteria, whose creation was causing a bottleneck for
LookupName et al. Instead, use an enum and a bool to describe its
contents.

Optimized the C/Objective-C path through LookupName, eliminating any
unnecessarily C++isms. Simplify IdentifierResolver::iterator, removing
some code and arguments that are no longer used.

Eliminated LookupDeclInScope/LookupDeclInContext, moving all callers
over to LookupName, LookupQualifiedName, or LookupParsedName, as
appropriate.

All together, I'm seeing a 0.2% speedup on Cocoa.h with PTH and
-disable-free. Plus, we're down to three name-lookup routines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
21593acb933324b439bc68b68e7cc7d1c3e3484d 28-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4433aafbc2591b82e4ea2fc39c723b21d2497f4d 25-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement implicit conversions for pointers-to-member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
4afa39deaa245592977136d367251ee2c173dd8d 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0eb23307222bda7ad95d968eac4e1ab30864b213 19-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert more expression actions to smart pointers.
Fix type of logical negation for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dce5e2cabf07ff25eb4d9e1859c0a21c69f588d2 16-Jan-2009 Anders Carlsson <andersca@mac.com> Use a single function for doing vararg argument promotion. Also, make sure to do the promotion before checking the type - fixes PR3340.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
09f41cf63f4df0bf4e98ee473e44e9a95b68f0ff 14-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce support for C++0x explicit conversion operators (N2437)

Small cleanup in the handling of user-defined conversions.

Also, implement an optimization when constructing a call. We avoid
recomputing implicit conversion sequences and instead use those
conversion sequences that we computed as part of overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
906fed0fb54a338961aba3aa54802b7d68de94c7 13-Jan-2009 Anders Carlsson <andersca@mac.com> Warn when someone tries to pass a variable with a non-POD type to a varargs function/method/block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
518fda1d121dcba3ad7276f5e9a94f733f6e5ecd 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix argument-passing bugs in a call to object

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
88b4bf202a6bb67ed241281b8dea973f38df2782 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Add the proper restrictions on the left-hand argument of a built-in
assignment operator candidate (C++ [over.match.oper]p4).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e63ef48b76b84e7ffb0a38fbf475ddea5c48adb4 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure we don't name a constructor or destructor with a qualified
type. It leads to very weird errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0701bbb228dfd87e1fe82a0a4b7b9facfecb43da 08-Jan-2009 Steve Naroff <snaroff@apple.com> This is a large/messy diff that unifies the ObjC AST's with DeclContext.

- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.

This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bcbffc46f1ad3796c4582fa1e3a9113b5aa26061 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of anonymous unions (and, as a GNU extension,
structures and classes) in C++. Covers name lookup and the synthesis
and member access for the unnamed objects/fields associated with
anonymous unions.

Some C++ semantic checks are still missing (anonymous unions can't
have function members, static data members, etc.), and there is no
support for anonymous structs or unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
6ed40e351a7c1fb3084434f1db19216b79623cf0 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't push OverloadedFunctionDecls onto the chain of declarations
attached to an identifier. Instead, all overloaded functions will be
pushed into scope, and we'll synthesize an OverloadedFunctionDecl on
the fly when we need it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2a7e58dc24b17b1cb900a1ee30ea328d665b1a64 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Add some block-pointer conversions in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
3fc749d899dfc194162128c1a88933148a39b68d 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't explicitly represent OverloadedFunctionDecls within
DeclContext. Instead, just keep the list of currently-active
declarations and only build the OverloadedFunctionDecl when we
absolutely need it.

This is a half-step toward eliminating the need to explicitly build
OverloadedFunctionDecls that store sets of overloaded
functions. This was suggested by Argiris a while back, and it's a good
thing for several reasons: first, it eliminates the messy logic that
currently tries to keep the OverloadedFunctionDecl in sync with the
declarations that are being added. Second, it will (eventually)
eliminate the need to allocate memory for overload sets, which could
help performance. Finally, it helps set us up for when name lookup can
return multiple (possibly ambiguous) results, as can happen with
lookup of class members in C++.

Next steps: make the IdentifierResolver store overloads as separate
entries in its list rather than replacing them with an
OverloadedFunctionDecl now, then see how far we can go toward
eliminating OverloadedFunctionDecl entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
27b09ac9f7a4b2555bb9adda3568f3ba6264a63e 22-Dec-2008 Douglas Gregor <dgregor@apple.com> Support conversion from a null pointer constant o any Objective-C object pointer type. Fixes rdar://problem/6463298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
88a3514f36de96b19cdf50141c640df1a5f13f6c 22-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for calls to overloaded member functions. Things to note:
- Overloading has to cope with having both static and non-static
member functions in the overload set.
- The call may or may not have an implicit object argument,
depending on the syntax (x.f() vs. f()) and the context (static
vs. non-static member function).
- We now generate MemberExprs for implicit member access expression.
- We now cope with mutable whenever we're building MemberExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
86f194083504938df72135b5b66bf0c5cafd9498 21-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c78875112311d86112690ac859976d91d87cc3b8 19-Dec-2008 Douglas Gregor <dgregor@apple.com> Support more implicit conversions for Objective-C types. Addresses <rdar://problem/6458293>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
45920e82bd87454545642ee2612e656a4140889d 19-Dec-2008 Douglas Gregor <dgregor@apple.com> Allow downcasts of pointers to Objective-C interfaces, with a
warning. This matches GCC's behavior and addresses
<rdar://problem/6458293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
dda78893c8d1f6f5cdcb19db58da11b756694e2c 19-Dec-2008 Douglas Gregor <dgregor@apple.com> Add some more implicit conversions for Objective-C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9e7d9de3ef538c1473248238b76a6d7b16f5f684 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Place constructors and destructors into the DeclContext of the class,
just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.

Diagnose the redeclaration of member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c9467cf4cff1bb09f38667b871268c47ed823f97 12-Dec-2008 Douglas Gregor <dgregor@apple.com> In C++, set the type of each of the enumerators in an enumeration to
the type of the enumeration once the enumeration has been defined.

Fix the overloading test-case to properly create enums that promote
the way we want them to.

Implement C++0x promotions from enumeration types to long
long/unsigned long long. We're using these promotions in Carbon.h
(since long long is a common extension).

Fixes PR clang/2954: http://llvm.org/bugs/show_bug.cgi?id=2954


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e267ff35b2f4e9d2b0d8bf24109d41cc7398b61b 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Address some comments on the name lookup/DeclContext patch from Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
44b4321feab46299d3f5cfd404680884752a0fcf 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).

* Implement C++ qualified name lookup in terms of lookup into
DeclContext.

* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)

* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.

* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).

* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
5c37de788529cd9180f22069970737a7208bd625 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for calls to dependent names within templates, e.g.,

template<typename T> void f(T x) {
g(x); // g is a dependent name, so don't even bother to look it up
g(); // error: g is not a dependent name
}

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
7ca09760ee77ad03eac8212e580338bacd46f4d4 27-Nov-2008 Douglas Gregor <dgregor@apple.com> Add implicit conversions for Objective-C qualified ids, e.g.,

id<P0>

The intended overloading behavior of these entities isn't entirely
clear, and GCC seems to have some strange limitations (e.g., the
inability to overload on id<P0> vs. id<P1>). We'll want to revisit
these semantics and determine just how Objective-C++ overloading
should really work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bf40818928d2a7f76a4ba9abee469a7d02225ab2 27-Nov-2008 Douglas Gregor <dgregor@apple.com> Cleanup formatting

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
071f2aec57467027540ea849b7889c4c263dbb7d 27-Nov-2008 Douglas Gregor <dgregor@apple.com> Support block pointer conversions in C++. I'm storing the test case locally until we can enable blocks in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
cb7de523cc2ad5635f235e15b12867e6b349441f 27-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement implicit conversions for Objective-C specific types, e.g.,
converting a pointer to one Objective-C interface into a pointer to another
Objective-C interface, and conversions with 'id'. The semantics seems
to match GCC, although they seem somewhat ad hoc.

Fixed a few cases where we assumed the C++ definition of isObjectType,
but were getting the C definition, causing failures in trouble with
conversions to void pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0a39668d6adf1d709985eef149136a80372f5032 26-Nov-2008 Douglas Gregor <dgregor@apple.com> Tweak the new ResolveOverloadedCallFn to just return a FunctionDecl. It makes ActOnCallExpr simpler

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f6b89691d2fdb88b97edabbe5f390fb2919c8f0a 26-Nov-2008 Douglas Gregor <dgregor@apple.com> Move the overloading logic of Sema::ActOnCallExpr to a separate function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d162584991885ab004a02573a73ce06422b921fc 24-Nov-2008 Chris Lattner <sabre@nondot.org> Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
d9d22dd9c94618490dbffb0e2caf222530ca39d3 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
e4c452c4c7b9124fe94a96f559ff077d59cdf996 22-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
1ca50c3f541dd637063b9d186a7ea193e3440a48 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Fix overloading of non-static member functions that differ in their cv-qualifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fc195efd688f134fb58a540447f4ce67f9d6563e 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Cleanup memory management in overloading of operator->, slightly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
621b3933e570792810386b891264c78e3bd7b169 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't print canonical types in overloading-related diagnostics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8ba10745f525467e91bbaec21044bf4d9017a988 20-Nov-2008 Douglas Gregor <dgregor@apple.com> Add support for overloaded operator-> when used in a member access
expression (smart_ptr->mem).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
a967a6f6af170fcfdcd4ea24ba2ba5e072f6cded 20-Nov-2008 Douglas Gregor <dgregor@apple.com> Fix strange quote characters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
106c6eb3f1380bfe243a62d8f0f8bce6a7c8d5c6 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement the rest of C++ [over.call.object], which permits the object
being called to be converted to a reference-to-function,
pointer-to-function, or reference-to-pointer-to-function. This is done
through "surrogate" candidate functions that model the conversions
from the object to the function (reference/pointer) and the
conversions in the arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f9eb905197e44ed5634205512074993f6f40470d 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Support for calling overloaded function call operators (operator())
with function call syntax, e.g.,

Functor f;
f(x, y);

This is the easy part of handling calls to objects of class type
(C++ [over.call.object]). The hard part (coping with conversions from
f to function pointer or reference types) will come later. Nobody uses
that stuff anyway, right? :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
74253736184c0717a0649922551bf9d8b6815651 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Added operator overloading for unary operators, post-increment, and
post-decrement, including support for generating all of the built-in
operator candidates for these operators.

C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.

In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
fa25bbb351f4fdd977f51254119cdfc2b525ce90 19-Nov-2008 Chris Lattner <sabre@nondot.org> Switch several more Sema Diag methods over. This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
447b69e55e1098d8df46dd99f171bfaace9ff8a0 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Built-in equality and relational operators have return type "bool" in C++,
not "int".

Fix a typo in the promotion of enumeration types that was causing some
integral promotions to look like integral conversions (leading to
extra ambiguities in overload resolution).

Check for "acceptable" overloaded operators based on the types of the
arguments. This is a somewhat odd check that is specified by the
standard, but I can't see why it actually matters: the overload
candidates it suppresses don't seem like they would ever be picked as
the best candidates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
96176b3575823ea996c6140380dd17d9240c9766 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Partial expansion of C++ operator overloading (for binary operators)
to support operators defined as member functions, e.g.,

struct X {
bool operator==(X&);
};

Overloading with non-member operators is supported, and the special
rules for the implicit object parameter (e.g., the ability for a
non-const *this to bind to an rvalue) are implemented.

This change also refactors and generalizes the code for adding
overload candidates for overloaded operator calls (C++ [over.match.expr]),
both to match the rules more exactly (name lookup of non-member
operators actually ignores member operators) and to make this routine
more reusable for the other overloaded operators.

Testing for the initialization of the implicit object parameter is
very light. More tests will come when we get support for calling
member functions directly (e.g., o.m(a1, a2)).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
c9c7c4e06bba5dce053162ea1ead5743d7bba35b 18-Nov-2008 Chris Lattner <sabre@nondot.org> start converting Sema over to using its canonical Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
2e1cd4264d363ca869bf37ef160902f211d21b8c 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bf3af056289893f58d37b05a2c80970708781d61 13-Nov-2008 Douglas Gregor <dgregor@apple.com> Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
eb8f3063257a392f15aea48d42fb73ec51afc548 12-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

struct X {
operator int const*();
} x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
904eed3f6148758d39a2d3c88f3133274460d645 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Basic support for taking the address of an overloaded function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
25e70871412a48466673d695fd7ed591231e23f0 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Remove an out-of-date FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f1991eab1e777634fb38758eafbbe0d303271d2f 07-Nov-2008 Douglas Gregor <dgregor@apple.com> Initial, partially-baked support for implicit user-defined conversions by conversion functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f7be9448af88e0ebb204bdcebfc13f4cb2b9d8e1 04-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Some cleanup of the cast checkers. Don't canonicalize types when not needed. Use distinct diagnostics for distinct errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
18fe56863be253a27b940022d27a3101778adaf6 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Implicit support for direct initialization of objects of class type, e.g.,

X x(5, 7);




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
225c41eb3e960fd2e1d1b547f0f19a278d608bc5 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Standard conversion sequences now have a CopyConstructor field, to
cope with the case where a user-defined conversion is actually a copy
construction, and therefore can be compared against other standard
conversion sequences. While I called this a hack before, now I'm
convinced that it's the right way to go.

Compare overloads based on derived-to-base conversions that invoke
copy constructors.

Suppress user-defined conversions when attempting to call a
user-defined conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
396b7cd9f6b35d87d17ae03e9448b5c1f2184598 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Add implicitly-declared default and copy constructors to C++ classes,
when appropriate.

Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
60d62c29d260596454aaf4cb50cbc756ac08875e 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement basic support for converting constructors in user-defined
conversions.

Notes:
- Overload resolution for converting constructors need to prohibit
user-defined conversions (hence, the test isn't -verify safe yet).
- We still use hacks for conversions from a class type to itself.
This will be the case until we start implicitly declaring the appropriate
special member functions. (That's next on my list)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0777972d38a3125efed962b045704c30ae6965cf 31-Oct-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement semantic checking of static_cast and dynamic_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f70bdb9463a6e3ea2c6307b2c7a5f3e2c6b7e489 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement overloading rules for reference binding

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
15da57e66cade0c2cab752f925e838b22daadafc 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Tweak Sema::CheckReferenceInit so that it (optionally) computes an
ImplicitConversionSequence and, when doing so, following the specific
rules of [over.best.ics].

The computation of the implicit conversion sequences implements C++
[over.ics.ref], but we do not (yet) have ranking for implicit
conversion sequences that use reference binding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
27c8dc06f65d7abcf6a7e7f64a7960c9a150ca01 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
0575d4ab561b4b2905c6ef614a7f7a87be26e64f 24-Oct-2008 Douglas Gregor <dgregor@apple.com> Some cleanups for the ambiguous derived-to-base conversion checks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
94b1dd2368dc9eeedf2794db654deae225fac763 24-Oct-2008 Douglas Gregor <dgregor@apple.com> First non-embarrassing cut at checking for ambiguous derived-to-base
conversions.

Added PerformImplicitConversion, which follows an implicit conversion sequence
computed by TryCopyInitialization and actually performs the implicit
conversions, including the extra check for ambiguity mentioned above.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
bc0805a6ca84e3c38a08c9f47441e138945244d4 23-Oct-2008 Douglas Gregor <dgregor@apple.com> Add support for conversions from a pointer-to-derived to a
pointer-to-base. Also, add overload ranking for pointer conversions
(for both pointer-to-void and derived-to-base pointer conversions).

Note that we do not yet diagnose derived-to-base pointer conversion
errors that stem from ambiguous or inacessible base classes. These
aren't handled during overload resolution; rather, when the conversion
is actually used we go ahead and diagnose the error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
f8268ae3196002bbab6adb830302e79b0f368f13 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Add representation of base classes in the AST, and verify that we
don't have duplicated direct base classes.

Seriliazation of base class specifiers is not yet implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
ba7e210a999275695f58be03ef402758cfec3635 22-Oct-2008 Douglas Gregor <dgregor@apple.com> QualType::isMoreQualifiedThan and isAtLeastAsQualifiedAs assert that we
aren't trying to compare with address-space qualifiers (for now).

Clean up handing of DeclRefExprs in Expr::isLvalue and refactor part
of the check into a static DeclCanBeLvalue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
57373266011f73418381b736015d8d2bb0381176 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement ranking of standard conversion sequences by their qualification
conversions (e.g., comparing int* -> const int* against
int* -> const volatile int*); see C++ 13.3.3.2p3 bullet 3.

Add Sema::UnwrapSimilarPointerTypes to simplify the control flow of
IsQualificationConversion and CompareQualificationConversion (and fix
the handling of the int* -> volatile int* conversion in the former).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
9b6e2d209cc2931a9bb2ae51e744a8698b54db73 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Fix a thinko in the qualification-conversion check when the qualificaitons are disjoint, and add some overloading-based tests of qualification conversions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
98cd599ee8a9b259ed7388ee2921a20d97658864 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Initial step toward supporting qualification conversions (C++ 4.4).

Changes:
- Sema::IsQualificationConversion determines whether we have a qualification
conversion.
- Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
performing an implicit conversion from the right-hand side to the type of
the left-hand side rather than checking based on the C notion of
"compatibility". We now rely on the implicit-conversion code to
determine whether the conversion can happen or
not. Sema::TryCopyInitialization has an ugly reference-related
hack to cope with the initialization of references, for now.
- When building DeclRefExprs, strip away the reference type, since
there are no expressions whose type is a reference. We'll need to
do this throughout Sema.
- Expr::isLvalue now permits functions to be lvalues in C++ (but not
in C).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp
8e9bebdea69c590dedfbf27374114cb76fe12fbd 21-Oct-2008 Douglas Gregor <dgregor@apple.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaOverload.cpp