History log of /external/clang/lib/Sema/SemaExprCXX.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a4de17562d13d7a8188108243c4cfbd52f33229a 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

(cherry picked from commit 87d948ecccffea9e9e37d0d053b246e2d6d6c47b)

Change-Id: I10ca401a280e905253aafabad9118693a2f24ffb
/external/clang/lib/Sema/SemaExprCXX.cpp
b6d6993e6e6d3daf4d9876794254d20a134e37c2 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r239765

Change-Id: I0393bcc952590a7226af8c4b58534a8ee5fd2d99
/external/clang/lib/Sema/SemaExprCXX.cpp
58878f85ab89b13e9eea4af3ccf055e42c557bc8 06-May-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r235153

Change-Id: Ia94bbcb6da7c75b6e7c2afedd1001094d62a7324
/external/clang/lib/Sema/SemaExprCXX.cpp
3ea9e33ea25e0c2b12db56418ba3f994eb662c04 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r233350

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
/external/clang/lib/Sema/SemaExprCXX.cpp
0e2c34f92f00628d48968dfea096d36381f494cb 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master clang for rebase to r230699.

Change-Id: I6a546ab3d4ae37119eebb735e102cca4f80ab520
/external/clang/lib/Sema/SemaExprCXX.cpp
176edba5311f6eff0cad2631449885ddf4fbc9ea 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master Clang for rebase to r222490.

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
/external/clang/lib/Sema/SemaExprCXX.cpp
c568f1e98938584c0ef0b12ae5018ff7d90a4072 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
/external/clang/lib/Sema/SemaExprCXX.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Sema/SemaExprCXX.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Sema/SemaExprCXX.cpp
c12b43ab249ade0bab324560bc2f70cefc6f3ec1 08-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196488:
------------------------------------------------------------------------
r196488 | rsmith | 2013-12-05 00:30:59 -0800 (Thu, 05 Dec 2013) | 4 lines

PR17983: Fix crasher bug in C++1y mode when performing a non-global array
delete on a class which has no array cookie and has no class-specific operator
new.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2434dcfb022778b06cfd257d830d0249680b87cf 05-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196454:
------------------------------------------------------------------------
r196454 | faisalv | 2013-12-04 17:40:41 -0800 (Wed, 04 Dec 2013) | 43 lines

Fix init-captures for generic lambdas.

For an init capture, process the initialization expression
right away. For lambda init-captures such as the following:
const int x = 10;
auto L = [i = x+1](int a) {
return [j = x+2,
&k = x](char b) { };
};
keep in mind that each lambda init-capture has to have:
- its initialization expression executed in the context
of the enclosing/parent decl-context.
- but the variable itself has to be 'injected' into the
decl-context of its lambda's call-operator (which has
not yet been created).
Each init-expression is a full-expression that has to get
Sema-analyzed (for capturing etc.) before its lambda's
call-operator's decl-context, scope & scopeinfo are pushed on their
respective stacks. Thus if any variable is odr-used in the init-capture
it will correctly get captured in the enclosing lambda, if one exists.
The init-variables above are created later once the lambdascope and
call-operators decl-context is pushed onto its respective stack.

Since the lambda init-capture's initializer expression occurs in the
context of the enclosing function or lambda, therefore we can not wait
till a lambda scope has been pushed on before deciding whether the
variable needs to be captured. We also need to process all
lvalue-to-rvalue conversions and discarded-value conversions,
so that we can avoid capturing certain constant variables.
For e.g.,
void test() {
const int x = 10;
auto L = [&z = x](char a) { <-- don't capture by the current lambda
return [y = x](int i) { <-- don't capture by enclosing lambda
return y;
}
};
If x was not const, the second use would require 'L' to capture, and
that would be an error.
Make sure TranformLambdaExpr is also aware of this.

Patch approved by Richard (Thanks!!)
http://llvm-reviews.chandlerc.com/D2092
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9015bfcaf2f369d0f232f27b2655eb9f5464a280 12-Nov-2013 Faisal Vali <faisalv@yahoo.com> COSMETIC: Fix 80 column overflow in some comments introduced in r194188

no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
394558e6a1329b791de69d0fc7c618eac0dbc982 12-Nov-2013 Faisal Vali <faisalv@yahoo.com> A quick fix to PR17877 that was introduced by r194188 (generic-lambda-capturing) that broke libc++.

See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033369.html for discussion on cfe-dev.

This fix explicitly checks whether we are within the declcontext of a lambda's call operator - which is what I had intended to be true (and assumed would be true if getCurLambda returns a valid pointer) before checking whether a lambda can capture the potential-captures of the innermost lambda.

A deeper fix (that addresses why getCurLambda() returns a valid pointer when perhaps it shouldn't?) - as proposed by Richard Smith in http://llvm.org/bugs/show_bug.cgi?id=17877 - has been suggested as a FIXME.

Patch was LGTM'd by Richard (just barely :)

http://llvm-reviews.chandlerc.com/D2144

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
94358a855074605d7716604a92b88befd25fc58c 07-Nov-2013 David Blaikie <dblaikie@gmail.com> Unbreak the Clang -Werror build by removing some unused variables

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c00e4194296e994efab0e4bf64ca66737850bdf0 07-Nov-2013 Faisal Vali <faisalv@yahoo.com> This patch implements capturing of variables within generic lambdas.

Both Richard and I felt that the current wording in the working paper needed some tweaking - Please see http://llvm-reviews.chandlerc.com/D2035 for additional context and references to core-reflector messages that discuss wording tweaks.

What is implemented is what we had intended to specify in Bristol; but, recently felt that the specification might benefit from some tweaking and fleshing.

As a rough attempt to explain the semantics: If a nested lambda with a default-capture names a variable within its body, and if the enclosing full expression that contains the name of that variable is instantiation-dependent - then an enclosing lambda that is capture-ready (i.e. within a non-dependent context) must capture that variable, if all intervening nested lambdas can potentially capture that variable if they need to, and all intervening parent lambdas of the capture-ready lambda can and do capture the variable.

Of note, 'this' capturing is also currently underspecified in the working paper for generic lambdas. What is implemented here is if the set of candidate functions in a nested generic lambda includes both static and non-static member functions (regardless of viability checking - i.e. num and type of parameters/arguments) - and if all intervening nested-inner lambdas between the capture-ready lambda and the function-call containing nested lambda can capture 'this' and if all enclosing lambdas of the capture-ready lambda can capture 'this', then 'this' is speculatively captured by that capture-ready lambda.

Hopefully a paper for the C++ committee (that Richard and I had started some preliminary work on) is forthcoming.

This essentially makes generic lambdas feature complete, except for known bugs. The more prominent ones (and the ones I am currently aware of) being:
- generic lambdas and init-captures are broken - but a patch that fixes this is already in the works ...
- nested variadic expansions such as:
auto K = [](auto ... OuterArgs) {
vp([=](auto ... Is) {
decltype(OuterArgs) OA = OuterArgs;
return 0;
}(5)...);
return 0;
};
auto M = K('a', ' ', 1, " -- ", 3.14);
currently cause crashes. I think I know how to fix this (since I had done so in my initial implementation) - but it will probably take some work and back & forth with Doug and Richard.

A warm thanks to all who provided feedback - and especially to Doug Gregor and Richard Smith for their pivotal guidance: their insight and prestidigitation in such matters is boundless!

Now let's hope this commit doesn't upset the buildbot gods ;)

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
298028994ea4dae826422c15139682b82197a35e 06-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix diagnostic goof in r194161.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
195dd7c8448893e13a0cd8e776520f14cba65b08 06-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add a limit to the length of a sequence of 'operator->' functions we will
follow when building a class member access expression. Based on a patch by
Rahul Jain!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
743cbb91499e138a63a398c6515667905f1b3be8 04-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement final resolution of DR1402: implicitly-declared move operators that
would be deleted are still declared, but are ignored by overload resolution.

Also, don't delete such members if a subobject has no corresponding move
operation and a non-trivial copy. This causes us to implicitly declare move
operations in more cases, but risks move-assigning virtual bases multiple
times in some circumstances (a warning for that is to follow).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7121bdb91b86f6053765bda18dd0a8a118929ace 18-Oct-2013 David Majnemer <david.majnemer@gmail.com> [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for 'final'

Summary: Some MS headers use these features.

Reviewers: rnk, rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1948

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f0d5861d2db5e3075bd722ff7874e88c4bfedaae 08-Oct-2013 Ted Kremenek <kremenek@apple.com> Convert anachronistic use of 'void *' to 'DeclContext *' in Scope that was a holdover from the long-dead Action interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4cb295d3b32cb04215f87948fbf944ee4c31de1b 29-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;
instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out
the backward-compatibility issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
25b24eb889d633c4666001af107d8eb5c45dd065 23-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16529: Don't forget to add the CXXFunctionalCastExpr type sugar to an
InitListExpr for a C++11-style T{...} construction, if initialization
registered a destructor for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3225b9c9b35056f15b967bda1f1d8a3ca1680a42 14-Sep-2013 Serge Pavlov <sepavloff@gmail.com> Avoid getting an argument of allocation function if it does not exist.
This is a fix to PR12778: in erroneous code an allocation function
can be declared with no arguments, quering the first argument in this case
causes assertion violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ba081617a9f116ca2d511d0bf96e45c53ecc2523 11-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Fix is_trivially_constructible preconditions.

Fixes a crash in cases where the first argument was an incomplete type
or an uninstantiated template type.

<rdar://problem/14938471>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
29b37a06fc58bb2993d1c35cf7411b6b94b1116a 07-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: __uuidof should leak through templated types

Summary:
__uuidof on templated types should exmaine if any of its template
parameters have a uuid declspec. If exactly one does, then take it.
Otherwise, issue an appropriate error.

Reviewers: rsmith, thakis, rnk

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1419

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cdd4b78583120222b82148626119b3e80ae1d291 16-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Properly track l-paren of a CXXFucntionalCastExpr.

In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.

Fixes PR16903.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c14e6dda1e1287d3e0aeaa0e8f7bb2c9126f312c 31-Jul-2013 Kaelyn Uhrain <rikka@google.com> A few small cleanups to r187504. Thanks to dblaikie for the assist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
baaeb85f07640794f6a4fabb871e33deeab07df2 31-Jul-2013 Kaelyn Uhrain <rikka@google.com> Improve the diagnostic experience, including adding recovery, for
changing '->' to '.' when there is no operator-> defined for a class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b316dc517d9721ac9047819e4eeaa0eb59c4020a 31-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC arc: Move check for type conversions in arc
out of ImpCastExprToType and to the caller site
as appropriate. This is in prep. to do more work for
// rdar://14569171


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cfc57085a6eb8036d29164d4294cd95853ee1182 20-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add missing check for creating an instance of an abstract class through an
implicit conversion sequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ace21ba7ba8a834a711154d8d1f29c12568dbc54 14-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> If an unimported submodule of an imported module contains a declaration of a
global allocation or deallocation function, that should not cause that global
allocation or deallocation function to become unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
904df3e61a8043c60dc733933219a1e1466de5a6 18-Jun-2013 Larisse Voufo <lvoufo@google.com> contextual conversion fix: C++98 compatibility warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0bb5199941d6058b866afe01956cca36e64cc247 18-Jun-2013 Larisse Voufo <lvoufo@google.com> r184100 Fix -- Updated test cases for contextual conversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b67313d9136559ec0f8cda43550f73399fe2b76a 17-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "Updated test cases for contextual conversion"

This reverts commit r184100.

It was faling on some bots:
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/1973/steps/test_clang/logs/Clang%20%3A%3A%20SemaCXX__cxx1y-contextual-conversion-tweaks.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
37aba4797703ebadbd480b757ce40b81036539bc 17-Jun-2013 Larisse Voufo <lvoufo@google.com> Updated test cases for contextual conversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
539470e7d38f71b7a0700e1f1b371e76480cf0a6 15-Jun-2013 Larisse Voufo <lvoufo@google.com> Updated the support for contextual conversion tweaks (n3323) with a previously overlooked part: implicitly converting array sizes to size_t, rather than contextually converting them to some unique type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c063cb1e1a2e4b76f27762fcf56b4ba2ede8f0a9 02-Jun-2013 David Majnemer <david.majnemer@gmail.com> Allow paren casted throw statements inside of ternary expressions

clang would incorrectly not allow the following:

int x = true ? (throw 1) : 2;

The problem exists because we don't see beyond the parens.
This, in turn, causes us to believe that we are choosing between void
and int which we diagnose as an error.

Instead, allow clang to see the 'throw' inside the parens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5537e0a4df10d3445e9714736534e4d33a44fa5d 30-May-2013 Aaron Ballman <aaron@aaronballman.com> Add support to fallback on operator new when a placement operator new[] is called for which there is no valid declaration. This fallback only happens in Microsoft compatibility mode. This patch addresses PR13164, and improves support for the WDK.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5705f211472f19fc38e58d81365f9261024b3ba3 23-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14772: Support constant expression evaluation for _Atomic types.
* Treat _Atomic(T) as a literal type if T is a literal type.
* Evaluate expressions of this type properly.
* Fix a lurking bug where we built completely bogus ASTs for converting to
_Atomic types in C++ in some cases, caught by the tests for this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
097e0a2cb08c8244a6923489acc8f890e6a99b59 21-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor places which perform contextual implicit conversions to go through a
common function. The C++1y contextual implicit conversion rules themselves are
not yet implemented, however.

This also fixes a subtle bug where template instantiation context notes were
dropped for diagnostics coming from conversions for integral constant
expressions -- we were implicitly slicing a SemaDiagnosticBuilder into a
DiagnosticBuilder when producing these diagnostics, and losing their context
notes in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
daaa468cdd8be3bc4f5861c34d0686d3d7a373fa 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize Sema::FindAllocationFunctions

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a7b7d0e4bb13a7ca5da4869197f43e923dadbb38 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize Sema::FindAllocationOverload

Now tests should pass. The previous error was caused by a misplaced backing
array for MutableArrayRef that I introduced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ed09bfcf04b7470b1c6fca54477f6d3bfcfb3b64 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Revert my r181563, breaks tests on buildbots


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8e6b7093c840ddd4054523333b5a0d3262c3c2c2 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize Sema::FindAllocationOverload


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9e00f12a2558bc4af77bc2e4171572052ea7d9a2 09-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize some SemaOverload methods

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
62ed889272d7e9da8e367d8682fdcdeeec0d83b5 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace 'MultiExprArg()' with 'None'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
958ba64dabe674660130d914abfd13ffeca4151d 05-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> ArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
82f145d4ed86d19cb2a1680cda53fdc39bb38eb6 04-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't build a call expression referring to a function which we're not allowed
to use. This makes very little difference right now (other than suppressing
follow-on errors in some cases), but will matter more once we support deduced
return types (we don't want expressions with undeduced return types in the
AST).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1f78a50f8aee58f8e07f6307f4b8d0b1742e9a2b 03-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose()

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
aeeacf725c9e0ddd64ea9764bd008e5b6873ce51 03-May-2013 John McCall <rjmccall@apple.com> Move parsing of identifiers in MS-style inline assembly into
the actual parser and support arbitrary id-expressions.

We're actually basically set up to do arbitrary expressions here
if we wanted to.

Assembly operands permit things like A::x to be written regardless
of language mode, which forces us to embellish the evaluation
context logic somewhat. The logic here under template instantiation
is incorrect; we need to preserve the fact that an expression was
unevaluated. Of course, template instantiation in general is fishy
here because we have no way of delaying semantic analysis in the
MC parser. It's all just fishy.

I've also fixed the serialization of MS asm statements.

This commit depends on an LLVM commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9b1317531d376738fd6631291b0a04109c76a63b 30-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> When deducing an 'auto' type, don't modify the type-as-written.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
dc7a4f5d7a7e3b60d4dc4a80338d7a2728540998 30-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3a2f91280a49f4747063f983dc6a3296bd9359d2 29-Apr-2013 Ben Langmuir <ben.langmuir@intel.com> Small CapturedStmt improvements

Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get
to the CapturedRegionKind enum. This also allows codegen to access this enum
without including Sema/ScopeInfo.h.

Also removes some duplicated code for capturing 'this' between CapturedStmt and
Lambda.

Differential Revision: http://llvm-reviews.chandlerc.com/D712



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a2c3646c35dd09d21b74826240aa916545b1873f 26-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y decltype(auto).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a10b97898ee6339c3110e6ca33f178ff52f05238 22-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y constexpr extensions, round 1: Allow most forms of declaration and
statement in constexpr functions. Everything which doesn't require variable
mutation is also allowed as an extension in C++11. 'void' becomes a literal
type to support constexpr functions which return 'void'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6afcf8875d4e447645cd7bf3733dd8e2eb8455dc 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Sema for Captured Statements

Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic
analysis. Currently captures all variables by reference.

TODO: templates

Author: Ben Langmuir <ben.langmuir@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D433


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
76da55d3a49e1805f51b1ced7c5da5bcd7f759d8 16-Apr-2013 John McCall <rjmccall@apple.com> Basic support for Microsoft property declarations and
references thereto.

Patch by Tong Shen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d2615cc53b916e8aae45783ca7113b93de515ce3 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 178663 back.

http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green
before it processed the reverted 178663, so it could not have been the culprit.

Revert "Revert 178663."

This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert 178663.

Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb

Revert "Don't compute a patched/semantic storage class."

This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8f187f62cb0487d31bc4afdfcd47e11fe9a51d05 03-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't compute a patched/semantic storage class.

For variables and functions clang used to store two storage classes. The one
"as written" in the code and a patched one, which, for example, propagates
static to the following decls.

This apparently is from the days clang lacked linkage computation. It is now
redundant and this patch removes it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9ef9875bbe19dc9f73c6c95b803d9a4945168690 27-Mar-2013 Joao Matos <ripzonetriton@gmail.com> Implement compiler intrinsics needed for compatibility with MSVC 2012 <type_traits>.

Patch by me and Ryan Molden.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2db075b1d3b16f0100fe06408dfb4ab7d50700a4 26-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement special-case name lookup for inheriting constructors: member
using-declarations with names which look constructor-like are interpreted as
constructor names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
36771d910b049cc534841c48ced90772784af446 20-Mar-2013 David Blaikie <dblaikie@gmail.com> PR7256: Provide a fixit for incorrect destructor declarations

Fix by Ismail Pazarbasi (ismail.pazarbasi@gmail.com), review by Dmitri Gribenko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bea522ff43a3f11c7a2bc7949119dbb9fce19e39 08-Mar-2013 Jordan Rose <jordan_rose@apple.com> ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1344e94cdf51cabb09d7b598323e54bbf333fcd5 07-Mar-2013 Douglas Gregor <dgregor@apple.com> Improve LLDB's implicit cast-to-id to work with C++11 auto and any Objective-C object type <rdar://problem/13338107>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3c86a5c2f60d4f68afde96e2138b6933b30d6aa8 12-Feb-2013 Nick Lewycky <nicholas@mxc.ca> The meat of this patch is in BuildCXXMemberCalLExpr where we make it use
MarkMemberReferenced instead of marking functions referenced directly. An audit
of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few
other changes:
* don't mark functions odr-used when considering them for an initialization
sequence. Do mark them referenced though.
* the function nominated by the cleanup attribute should be diagnosed.
* operator new/delete should be diagnosed when building a 'new' expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6959acd4bb0979361365e675968173ede7183489 07-Feb-2013 Guy Benyei <guy.benyei@intel.com> Enable overloading of OpenCL events - this is needed for the overloaded OpenCL builtin functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ad48a500596d7d678b99c7f94326cfa856c3b49f 24-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to check for integer overflow. It has been
commented on and approved by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6c3af3d0e3e65bcbca57bfd458d684941f6d0531 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn on
expressions which have undefined behavior due to multiple unsequenced
modifications or an unsequenced modification and use of a variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
419563768ef4929a622d7c2b066856e82901bb91 14-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor to call ActOnFinishFullExpr on every full expression. Teach
ActOnFinishFullExpr that some of its checks only apply to discarded-value
expressions. This adds missing checks for unexpanded variadic template
parameter packs to a handful of constructs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d36aa359e2f45cd22c7366a015ad94de08044dbb 29-Dec-2012 Nico Weber <nicolasweber@gmx.de> ArrayRefize a CompoundStmt constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c83c2300e1946fea78ecd3c2e93d9c2dd2638a2b 19-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3bc93e3124ad5e7191c4a12dc981c8ee53578193 19-Dec-2012 David Blaikie <dblaikie@gmail.com> Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
206491dcbe1ed01ee8ce86a0ffe272d5d25491d3 13-Dec-2012 Eli Friedman <eli.friedman@gmail.com> Add missing check for error return from DefaultLvalueConversion. Fixes <rdar://problem/12857416>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ac71351acdefc9de0c770c1d717e621ac9e684bf 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.

This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.

This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9d29543284e75648ac89c6e9586fc7cf786cf66f 28-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,
expose only the iterators instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
73ed67cc36b06a380ddc3658beb7a84328c19ff6 26-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14428: When instantiating a 'new' expression, if we had a non-dependent
initialization, don't rebuild it. Remove a couple of hacks which were trying to
work around this. Fix the special case for one-argument CXXConstructExprs to
not apply if the one argument is a default argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1b48633d308460049e1132960f3c33c850de5bd2 15-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> Do not cache a pointer to ExprEvalContexts.back().

It may become a dangling pointer if the underlying SmallVector reallocates.
Sadly the testcase is really large and doesn't reduce well because of
SmallVector's reallocation patterns.

Fixes PR14336.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
accaf19bc1129c0273ec50dba52318e60bc29103 14-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> s/tranform/transform/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
530564196fe7e2e30fbc2b0edae45975447583e0 07-Nov-2012 David Blaikie <dblaikie@gmail.com> PR13552: Fix the end location of a CXXNewExpr.

Spent longer than reasonable looking for a nice way to test this & decided to
give up for now. Open to suggestions/requests. Richard Smith suggested adding
something to ASTMatchers but it wasn't readily apparent how to test this with
that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c5f804636e367ef744fd24cf88f7c956a5af0434 11-Oct-2012 Nico Weber <nicolasweber@gmx.de> Add codegen support for __uuidof().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
be9af1288881110e406b87914162eaa59f1e5918 02-Oct-2012 Lang Hames <lhames@gmail.com> Add FP_CONTRACT support for clang.

Clang will now honor the FP_CONTRACT pragma and emit LLVM
fmuladd intrinsics for expressions of the form A * B + C (when they occur in a
single statement).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ea30e2f8667668173cf7433c3c80cf603bd922a4 25-Sep-2012 John McCall <rjmccall@apple.com> Add the Microsoft __is_interface_class type trait.
Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
93e4599196654907dad3bd476013ad05d36ce604 19-Sep-2012 Craig Topper <craig.topper@gmail.com> Remove Context argument from TemplateDeductionInfo constructor. It was no longer needed after the unused Context member was removed in r164104.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6f5a2ec123ffebfb27f74a024ec3dccd65be5e83 14-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C arc: remove -Warc-abi in its entirety.
// rdar://10554025


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e7ff9191f39fa5a0f48168f51f55f1f7556d5993 13-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [conv.prom]p4: an enumeration with a fixed underlying type has
integral promotions to both its underlying type and to its underlying type's
promoted type. This matters now that boolean conversions aren't permitted in
converted constant expressions (a la DR1407): an enumerator with a fixed
underlying type of bool still can be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
654f1d508cbc9553f4931b340dfa19b453f72ebd 11-Sep-2012 David Blaikie <dblaikie@gmail.com> Fix PR13784: instantiation of an abstract class in a conditional operator.

A couple of missing "RequireNonAbstractType" calls in conditional operator
handling. I looked for opportunities to tie this check in to all relevant
callers of PerformCopyInitialization (couldn't be all callers since this is
called for base subobject copying too, where it's acceptable to copy abstract
types) but the callers varied too much & in many cases had substantial code
or conditionals on the RequireNonAbstractType call, the
PerformCopyInitialization call, or the code between the two calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1ad23d62007162df82b58bca31b4aa277a5f6586 10-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove redundant semicolons which are null statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0cb8939851364eb37a0f8bf8bb47874b7d966915 10-Sep-2012 Douglas Gregor <dgregor@apple.com> Allow vector types in pseudo-destructor expressions. Fixes PR13798.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6666ed4ed2e2bc13da5ac5d0a4947019137d45be 31-Aug-2012 Joao Matos <ripzonetriton@gmail.com> Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3b6bef9a213249c6ab6d67c07b1ac6380961be3e 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Push ArrayRef through the Expr hierarchy.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5354e77e60e82828c7c2361f5c688c2667ab59cc 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Now that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.

This required changing all get() calls to data() and using the simpler constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4e28d9e2ba9ce237549b45cfd4136ec6536d1325 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3fe198bf0d6118c7b080c17c3bb28d7c84e458b9 23-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Rip out remnants of move semantic emulation and smart pointers in Sema.

These were nops for quite a while and only lead to confusion. ASTMultiPtr
now behaves like a proper dumb array reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2217f853e1909b80f87ce0dcec5543e894d11bc9 14-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Make __is_convertible_to handle abstract types correctly. PR13591.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0d729105ecb50a7e3cbe6e57c29149edfa5cf05a 13-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Factor out computation of whether a typeid's expression is potentially
evaluated into a CXXTypeid member function. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
50d61c8ccfc633b13cdf594ea3cd3a217076debe 08-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement final piece of DR963 and also DR587:

A conditional operator between glvalues of types cv1 T and cv2 T produces a
glvalue if the expressions are of the same value kind and one of cv1 and cv2
is a subset of the other.

A conditional operator between two null pointer constants is permitted if one
of them is of type std::nullptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
604fb38cd943649bee579103d17ca6cda4aad144 08-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> When building a conditional operator where one operand is a throw-expression
and the other is a glvalue of class type, don't forget to copy-initialize a
temporary when performing the lvalue-to-rvalue conversion on the glvalue.
Strangely, DefaultLvalueConversions misses this part of the lvalue-to-rvalue
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d22f0847a95938203fe12ab50bfc33d79c664a77 28-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13433: In Microsoft mode, don't require function calls within decltype
expressions to have complete return types (or accessible destructors). If the
return type is required to be complete for some other reason (for instance, if
it is needed by overload resolution), then it will still be required to be
complete. This is apparently required in order to parse a MSVC11 header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b9d0b76e42fd2d4cdfd135220302458d03ad09fe 27-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Final piece of core issue 1330: delay computing the exception specification of
a defaulted special member function until the exception specification is needed
(using the same criteria used for the delayed instantiation of exception
specifications for function temploids).

EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like
EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to
resolve the exception specification.

This is enabled for all C++ modes: it's a little faster in the case where the
exception specification isn't used, allows our C++11-in-C++98 extensions to
work, and is still correct for C++98, since in that mode the computation of the
exception specification can't fail.

The diagnostics here aren't great (in particular, we should include implicit
evaluation of exception specifications for defaulted special members in the
template instantiation backtraces), but they're not much worse than before.

Our approach to the problem of cycles between in-class initializers and the
exception specification for a defaulted default constructor is modified a
little by this change -- we now reject any odr-use of a defaulted default
constructor if that constructor uses an in-class initializer and the use is in
an in-class initialzer which is declared lexically earlier. This is a closer
approximation to the current draft solution in core issue 1351, but isn't an
exact match (but the current draft wording isn't reasonable, so that's to be
expected).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
34f60a4a7fb87e9f4dfd08f8751ce76db9981215 09-Jul-2012 Abramo Bagnara <abramo.bagnara@gmail.com> The delete argument should not be converted to void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8ad6c8696a23f410398fc126929b107404c59a95 08-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13293: Defer deduction of an auto type with a dependent declarator, such as "auto (*f)(T t)".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
14b23277db34fd33292dd9ec23abb13e7cb72613 29-Jun-2012 Douglas Gregor <dgregor@apple.com> Teach the __is_trivially_assignable and __is_trivially_constructible
type traits that assignment to/construction of a lifetime-qualified
object under ARC is *not* trivial. Fixes <rdar://problem/11738725>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
306f1791d002e84c0a58de5868d8bca0f48e37e4 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: turn "//" into "///" for a Doxygen comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ed36b2a80878c29603bdc89a7969253fb6446174 20-Jun-2012 Nico Weber <nicolasweber@gmx.de> Do a second lookup for type_info in the global namespace in microsoft mode. PR13153.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ef2b5b327b524f9ea3243c07e04fb24706e63120 16-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Escaped "::" and "<" as needed in Doxygen comments;
* Marked up code examples with \code...\endcode;
* Documented a \param that is current, instead of a few that aren't;
* Fixed up some \file and \brief comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ca5233044ef679840d1ad1c46a36b16e2ee8a6e1 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13064: Store whether an in-class initializer uses direct or copy
initialization, and use that information to produce the right kind of
initialization during template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0218068cbbb2e98164431653d76587e5b8bb9c38 25-May-2012 Eli Friedman <eli.friedman@gmail.com> Get rid of some non-ASCII en-dashes that crept in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e26073c85259be1c2f397797cc59286ac85fb3b8 25-May-2012 Eli Friedman <eli.friedman@gmail.com> Implement the C++11 discarded value expression rules for volatile lvalues. <rdar://problem/10790820>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
11d1a697dcf677c42394dfa9506ace4935f3b00d 20-May-2012 Nico Weber <nicolasweber@gmx.de> Error when using typeid() with -fno-rtti. PR 12888.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
def07624ecc535431e0c814b4b5b842de8a06997 16-May-2012 David Blaikie <dblaikie@gmail.com> Include the correct conversion context locations for condition expressions.

This improves the conversion diagnostics (by correctly pointing to the loop
construct for conversions that may've been caused by the contextual conversion
to bool caused by a condition expression) and also causes the NULL conversion
warnings to be correctly suppressed when crossing a macro boundary in such a
context. (previously, since the conversion context location was incorrect, the
suppression could not be performed)

Reported by Nico Weber as feedback to r156826.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2f68ca09ca8b5944fcab14578a161511afde406f 12-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> When diagnosing inaccessible temporary destructors in decltype expressions, use
the correct type and the correct source location in the diagnostic. Spotted by
Johannes Schaub!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ab41fe914f63bb470dfa7e400876ada72f57a931 05-May-2012 Douglas Gregor <dgregor@apple.com> Move Sema::VerifyIntegerConstantExpression() and
Sema::ConvertToIntegralOrEnumerationType() from PartialDiagnostics to
abstract "diagnoser" classes. Not much of a win here, but we're
-several PartialDiagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6a26e2e54aa2a8cc6c977081befd8e80e7573ca4 04-May-2012 Douglas Gregor <dgregor@apple.com> Move Sema::RequireNonAbstractType() off of PartialDiagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d10099e5c8238fa0327f03921cf2e3c8975c881e 04-May-2012 Douglas Gregor <dgregor@apple.com> Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()
off PartialDiagnostic. PartialDiagnostic is rather heavyweight for
something that is in the critical path and is rarely used. So, switch
over to an abstract-class-based callback mechanism that delays most of
the work until a diagnostic is actually produced. Good for ~11k code
size reduction in the compiler and 1% speedup in -fsyntax-only on the
code in <rdar://problem/11004361>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
aa5498649c7ad1b61e5da2497e8c60c924ac5e55 01-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'
being used in an exception specification in a way which isn't otherwise
ill-formed in C++98: this warning also incorrectly triggered on uses of 'this'
inside thread-safety attributes, and the mechanism required to tell these cases
apart is more complex than can be justified by the (minimal) value of this part
of -Wc++98-compat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
470360d8035ce4213a963d281c3b542edfea9fda 28-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Revert "Use the C++11 definition of PODness for __is_pod in C++11 mode."

This is just papering over a major bug in isPODType, real fix coming up soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
046e8691ff467541ef7c32c9fc6bf41b1dcbd03a 28-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Use the C++11 definition of PODness for __is_pod in C++11 mode.

Keep the old definition for C++98 so we don't break tr1::is_pod.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
86e6fdcf1a04edc4c24f53f9dbacf7e1b52f306d 26-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Two missing -Wc++98-compat warnings, for null pointers as non-type template
arguments, and 'this' in exception-specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
eb382ec1507cf2c8c12d7443d0b67c076223aec6 19-Apr-2012 Patrick Beard <pcbeard@mac.com> Implements boxed expressions for Objective-C. <rdar://problem/10194391>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e6975e9b0985ad7f7ff9187e38d95bfe9ac4181b 17-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.

We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cefc3afac14d29de5aba7810cc8fe6c858949e9d 16-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
47bfcca2d6972d98a1b25239cd1aa658b60680e2 12-Apr-2012 Douglas Gregor <dgregor@apple.com> Fix some i1/i8 confusion within _Atomic(bool) in IR generation, both
in general (such an atomic has boolean representation) and
specifically for IR generation of __c11_atomic_init. The latter also
means actually using initialization semantics for this initialization,
rather than just creating a store.

On a related note, make sure we actually put in non-atomic-to-atomic
conversions when performing an implicit conversion sequence. IR
generation is far too kind here, but we still want the ASTs to make
sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b9abd87283ac6e929b7e12a577663bc99e61d020 07-Apr-2012 John McCall <rjmccall@apple.com> Fix several problems with protected access control:
- The [class.protected] restriction is non-trivial for any instance
member, even if the access lacks an object (for example, if it's
a pointer-to-member constant). In this case, it is equivalent to
requiring the naming class to equal the context class.
- The [class.protected] restriction applies to accesses to constructors
and destructors. A protected constructor or destructor can only be
used to create or destroy a base subobject, as a direct result.
- Several places were dropping or misapplying object information.

The standard could really be much clearer about what the object type is
supposed to be in some of these accesses. Usually it's easy enough to
find a reasonable answer, but still, the standard makes a very confident
statement about accesses to instance members only being possible in
either pointer-to-member literals or member access expressions, which
just completely ignores concepts like constructor and destructor
calls, using declarations, unevaluated field references, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6c4c36c4ed1007143f5b8655eb68b313a7e12e76 30-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR10217: Provide diagnostics explaining why an implicitly-deleted special
member function is deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
426d6ca163e20187761aa55a67797dac51508d0d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Fix crash & accepts-invalid for array of arrays of user defined type.

Test case/other help by Richard Smith.
Code review by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f4b88a45902af1802a1cb42ba48b1c474474f228 10-Mar-2012 John McCall <rjmccall@apple.com> Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e7d6ca079a68ed9ea7fa6e5d6bfc9f625a37df76 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [Sema] Fix a diag change to include a range that appeared intended, but never
actually happened.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
780249b1a3107302f053f3ddc047ab3c14b87b30 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [Sema] Remove dead getSourceRange() call, caught by Clang after marking
LLVM_READONLY.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
96a0014f9b963d8a987f1cccd48808a47f9c6331 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size().

I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5aba3eb1be234336767f86c7252ed307255f4d4d 09-Mar-2012 John McCall <rjmccall@apple.com> Perform l2r conversions on delete operands before doing
type-analysis; otherwise, we just completely do the
wrong thing for placeholders.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ebcb57a8d298862c65043e88b2429591ab3c58d3 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals. This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch. It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2835745a451002798fed9800aeb19277f6a8fcb3 05-Mar-2012 Sebastian Redl <sebastian.redl@getdesigned.at> If the element type of an initializer list has a destructor, make sure we check it. Fixes PR12178.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
23f0267e2d56c0407f12e62df3561ecf75d74e6e 01-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Implement "optimization" for lambda-to-block conversion which inlines the generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap.

Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3f01c8a58b7b2d78303675182a8de6b7fbe45ae1 01-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Tighten type-checking a bit to make it clearer how BuildCXXMemberCallExpr is used.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c60ccf5b4fb657ca40da3019c2bbe15dd8ab9732 29-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make sure list-initialization of arrays works correctly in explicit type conversions. PR12121.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9a561d539158a30b68fc258b81a994f3fac10212 26-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure that we delete destructors in the right cases. Specifically:
- variant members with nontrivial destructors make the containing class's
destructor deleted
- check for a virtual destructor after checking for overridden methods in the
base class(es)
- check for an inaccessible operator delete for a class with a virtual
destructor.

Do not try to call an anonymous union field's destructor from the destructor of
the containing class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
13a140caba448a66ffcc5ff0d32a87d6e4f4ad3f 25-Feb-2012 Ahmed Charles <ace2001ac@gmail.com> ArrayRef'ize various functions in the AST/Parser/Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7a9f49296a6454b7a6f0edce89dc99d413a7e14e 25-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
62348f041adccdf9376f5c355ed64ecbce0b4f0f 24-Feb-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix comment: correct predicate name, reformat comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4ca8ac2e61c37ddadf37024af86f3e1019af8532 24-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement a new type trait __is_trivially_constructible(T, Args...)
that provides the behavior of the C++11 library trait
std::is_trivially_constructible<T, Args...>, which can't be
implemented purely as a library.

Since __is_trivially_constructible can have zero or more arguments, I
needed to add Yet Another Type Trait Expression Class, this one
handling arbitrary arguments. The next step will be to migrate
UnaryTypeTrait and BinaryTypeTrait over to this new, more general
TypeTrait class.

Fixes the Clang side of <rdar://problem/10895483> / PR12038.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
25d0a0f67d9e949ffbfc57bf487012f5cbfd886e 23-Feb-2012 Douglas Gregor <dgregor@apple.com> Provide the __is_trivially_assignable type trait, which provides
compiler support for the std::is_trivially_assignable library type
trait.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
428c620478d513081399798db5550bf0c779f244 22-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Throw away stray CXXDefaultArgExprs. Fixes PR12061.

I think there's a deeper problem here in the way TransformCXXConstructExpr works, but I won't tackle it now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
76f3f69db1416425070177243e9f390122c553e0 22-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [expr.call]p11: If the operand to a decltype-specifier is a
function call (or a comma expression with a function call on its right-hand
side), possibly parenthesized, then the return type is not required to be
complete and a temporary is not bound. Other subexpressions inside a decltype
expression do not get this treatment.

This is implemented by deferring the relevant checks for all calls immediately
within a decltype expression, then, when the expression is fully-parsed,
checking the relevant constraints and stripping off any top-level temporary
binding.

Deferring the completion of the return type exposed a bug in overload
resolution where completion of the argument types was not attempted, which
is also fixed by this change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
772291a67d483c1c2abf324eec5d8d6ca476bfdc 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Emit a warning when list-initializing a std::initializer_list member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
999713eea940f4e087cc3ac878689c5c5c7a7225 18-Feb-2012 Douglas Gregor <dgregor@apple.com> Rewrite variable capture within lambda expressions and blocks,
eliminating a bunch of redundant code and properly modeling how the
captures of outside blocks/lambdas affect the types seen by inner
captures.

This new scheme makes two passes over the capturing scope stack. The
first pass goes up the stack (from innermost to outermost), assessing
whether the capture looks feasible and stopping when it either hits
the scope where the variable is declared or when it finds an existing
capture. The second pass then walks down the stack (from outermost to
innermost), capturing the variable at each step and updating the
captured type and the type that an expression referring to that
captured variable would see. It also checks type-specific
restrictions, such as the inability to capture an array within a
block. Note that only the first odr-use of each
variable needs to do the full walk; subsequent uses will find the
capture immediately, so multiple walks need not occur.

The same routine that builds the captures can also compute the type of
the captures without signaling errors and without actually performing
the capture. This functionality is used to determine the type of
declaration references as well as implementing the weird decltype((x))
rule within lambda expressions.

The capture code now explicitly takes sides in the debate over C++
core issue 1249, which concerns the type of captures within nested
lambdas. We opt to use the more permissive, more useful definition
implemented by GCC rather than the one implemented by EDG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e61eb0443a77dd178934d070f458e1a08b84eb96 18-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Add a bunch of missing calls to DiagnoseSentinelCalls. <rdar://problem/10885993>.

This should probably be refactored... but it isn't completely obvious what refactoring is best.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
213d70b58b4f48050c3e545ce1bd4b0ec3af74be 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Diagnose uses of deleted destructors and inaccessible defaulted destructors.

We had two separate issues here: firstly, varions functions were assuming that
they did not need to perform semantic checks on trivial destructors (this is
not true in C++11, where a trivial destructor can nonetheless be private or
deleted), and a bunch of DiagnoseUseOfDecl calls were missing for uses of
destructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1f27805fe4f5463fd5b4d5396affe1ef23320688 17-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Don't allow non-empty ParenListExprs as array-new initializers.

Don't know what I was thinking there. Fixes PR12023.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bd45d257a404ed1f87090c8a32b5dd75576b7d11 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Proper checking of list-initializers for array new expressions.

This finishes generalized initializer support in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2aed8b88613863f3c439cdfb205bdf8b608fb205 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Revert "Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.""

This reintroduces commit r150682 with a fix for the Bullet benchmark crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1548d14f4092a817f7d90ad3e7a65266dc85fbc5 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Revert "Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself."
It leads to a compiler crash in the Bullet benchmark.

This reverts commit r12014.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5f688f4b15d02aa7ad159c46b1f78fe59d412f12 16-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.

Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities.

This breaks the static analysis of new expressions. I've filed PR12014 to track this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
20ff0e2d74c188cb3fd4ec3dead41a80a37c0202 13-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Don't route explicit construction via list-initialization through the functional cast code path. It sometimes does the wrong thing, produces horrible error messages, and is just unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6dc00f6e98a00bd1c332927c3e04918d7e8b0d4f 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Proper initializer list support for new expressions and type construct expressions. Array new still missing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
668165ab1e604b063c0aa0df8ff91c80879670bf 11-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make sure Sema creates a field for 'this' captures. (Doug, please double-check that this is correct.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3ac109cd17151bb8ad3a40b0cbb0e1923cd6c4a0 10-Feb-2012 Douglas Gregor <dgregor@apple.com> Allow implicit capture of 'this' in a lambda even when the capture
default is '=', and reword the warning about explicitly capturing
'this' in such lambdas to indicate that only explicit capture is
banned.

Introduce Fix-Its for this and other "save the programmer from
themself" rules regarding what can be explicitly captured and what
must be implicitly captured.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e2a7ad001fe1dc4a0d5fef312e7f7189e1f29369 08-Feb-2012 Douglas Gregor <dgregor@apple.com> Factor C++11 lambda expressions implementation into a separate
file. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
76e3da57b0e8cf72d221f44d54566ef206341668 08-Feb-2012 Douglas Gregor <dgregor@apple.com> When completing a lambda expression, make sure to check and attach the
body of the lambda to the function call operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
01d08018b7cf5ce1601707cfd7a84d22015fc04e 07-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce basic ASTs for lambda expressions. This covers:
- Capturing variables by-reference and by-copy within a lambda
- The representation of lambda captures
- The creation of the non-static data members in the lambda class
that store the captured variables
- The initialization of the non-static data members from the
captured variables
- Pretty-printing lambda expressions

There are a number of FIXMEs, both explicit and implied, including:
- Creating a field for a capture of 'this'
- Improved diagnostics for initialization failures when capturing
variables by copy
- Dealing with temporaries created during said initialization
- Template instantiation
- AST (de-)serialization
- Binding and returning the lambda expression; turning it into a
proper temporary
- Lots and lots of semantic constraints
- Parameter pack captures


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
55d23c925b058be29b792008ddb7d68f6c4fa9a0 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added location for template keyword in TemplateSpecializationTypeLoc. In the process removed some naming ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
282e7e66748cc6dd14d6f7f2cb52e5373c531e61 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> In C++11 mode, when an integral constant expression is desired and we have a
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.

Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.

In passing, fix static_assert to perform a contextual conversion to bool on its
argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f39aec17b89f8f0dd78e78c50ad2fa08f12272e3 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't allow a value of a scoped enumeration to be used as the first bound for an
array new expression. This lays some groundwork for the implicit conversion to
integral or unscoped enumeration which C++11 ICEs undergo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0b458fd8b6321c11e8b22727e0e9b9960e93ff4d 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a rejects-valid in C++11: array new of a negative size, or overflowing array
new, is well-formed with defined semantics of throwing (a type which can be
caught by a handler for) std::bad_array_new_length, unlike in C++98 where it is
somewhere nebulous between undefined behavior and ill-formed.

If the array size is an integral constant expression and satisfies one of these
criteria, we would previous the array new expression, but now in C++11 mode, we
merely issue a warning (the code is still rejected in C++98 mode, naturally).

We don't yet implement new C++11 semantics correctly (see PR11644), but we do
implement the overflow checking, and (for the default operator new) convert such
expressions to an exception, so accepting such code now does not seem especially
unsafe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
507a8a3fbb2c43247474daa7ccb8dd0a46c32ec5 04-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Don't warn on use of default allocator with an over-aligned type when the
allocator is given the pointer to allocate into.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
50a9a12d4f7387bcff3213d4b56e74bab9f4f5d2 04-Feb-2012 Sean Callanan <scallanan@apple.com> Clang has existing support for debuggers that
want to provide "po"-like functionality which
treats the result of an expression implicitly as
"id" (if it is not otherwise known) and prints
it as an Objective-C object.

This has in the past been gated by the
"DebuggerSupport" language option, but that is
too general. Debuggers also provide other commands
like "print" that do not make any assumptions
about whether the object is an Objective-C object.

This patch makes the assumption conditional on a
new language option: DebuggerCastResultToId. I
have also made corresponding modifications to the
testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cefc7b20fdb97b989163199e0849b4325e9b7804 04-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make explicit captures which cause implicit captures work correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b942cb24a060435b18fef5b43eb33d77afc0d03a 03-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Implement implicit capture for lambda expressions.

Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d67d0cc40f31956b40b44b6ee3619d17a0f73294 03-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Note whether a lambda is mutable in the LambdaScopeInfo; this information will be necessary to handle references to captured variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d2cce136878badcee6694b216479d7f1b72a1e68 03-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Add some code to accurately perform odr-used marking for variables per the C++11 rules.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5f2987c11491edb186401d4e8eced275f0ea7c5e 02-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Split Sema::MarkDeclarationReferenced into multiple functions; the additional entry points are needed to implement C++11 odr-use marking correctly. No functional change in this patch; I'll actually make the change which fixes the odr-use marking in a followup patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b710dfe5231b0cd44dd987b9bd33c7f6ac165807 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Diagnose the restriction on default arguments in C++11 [expr.prim.lambda]p5.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a1f2114d9e81923c750f6b439302ac03552c37db 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
- We get rid of the ugly dance of computing all of the captures in
data structures that clone those of CapturingScopeInfo, centralizing
the logic for accessing/updating these data structures
- We re-use the existing capture logic for 'this', which actually
works now.

Cleaned up some diagnostic wording in minor ways as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
93962e5360a43200faa70939571afc4fb9326cf7 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Improve checking of explicit captures in a C++11 lambda expression:
- Actually building the var -> capture mapping properly (there was an off-by-one error)
- Keeping track of the source location of each capture
- Minor QoI improvements, e.g, highlighing the prior capture if
there are multiple captures, pointing at the variable declaration we
found if we reject it.

As part of this, add standard citations for the various semantic
checks we perform, and note where we're not performing those checks as
we should.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
fe9b559f81535ade84d24c42569378f80df47847 01-Feb-2012 Douglas Gregor <dgregor@apple.com> Diagnose attempts to explicitly capture a __block variable in a lambda.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e4b92761b43ced611c417ae478568610f1ad7b1e 27-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added source location for the template keyword in AST template-id expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b4ab8431b414ca399edc890f12f758cb19c090b8 26-Jan-2012 Peter Collingbourne <peter@pcc.me.uk> Improve efficiency of Sema::MaybeBindToTemporary by working with the
canonical type directly and adding a fast path for the common case
that the type is directly a RecordType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ceccab908bd7824751b1def127272ec04dd4732b 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Slight refactoring; catch yet another case where we were missing an lvalue-to-rvalue conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8c9fe200890663e1026be25d66f0929caa87a0ca 25-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Fix r148920 to what I actually meant to commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e0dbedfdd1f4f57cc9e8fd594385cff961593014 25-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add missing check for placeholders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3add9f0ac80b0a4d78611dcdb4fd89c37f1c13d8 25-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we correctly treat __is_convertible_to as an unevaluated context. PR11833.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d814eaf0dfb30f1cb6f90b056f8126f7e31e7ef4 24-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Switch PerformImplicitConversion over to use DefaultLvalueConversion for lvalue-to-rvalue conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
fca84b232dd74c91b2e0f963a3f8c3bd351a9037 24-Jan-2012 Nick Lewycky <nicholas@mxc.ca> Add a new warning, -Wover-aligned, which detects attempts to use the default
allocator to construct an object which declares more alignment than the default
allocator actually provides. Fixes PR9527!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b832f6dea893f25b40500a04781286236281cb20 23-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Minor fixups for auto deduction of initializer lists.

Fix some review comments.
Add a test for deduction when std::initializer_list isn't available yet.
Fix redundant error messages. This fixes and outstanding FIXME too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2d757ec0e6cbd9aab4bcea7a0a83d71f5080c736 23-Jan-2012 Nico Weber <nicolasweber@gmx.de> Add a source range to the ms path. Spotted by David Blaikie.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
df1be86ef5f5d55fc23b2339ee76e076424d9ba0 23-Jan-2012 Nico Weber <nicolasweber@gmx.de> In microsoft mode, downgrade pseudo-destructors on void from error to warning.

This matches cl.exe's behavior and fixes PR11791.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8c382060c9e6668a94f1485dd16f012cda526c5f 23-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make sure the AST correctly represents lvalue-to-rvalue conversions where appropriate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ef331b783bb96a0f0e34afdb7ef46677dc4764cb 20-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Remove PotentiallyPotentiallyEvaluated, and replace it with a much simpler and less error-prone way of handling the relevant cases. Towards marking of whether a declaration is used more accurately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4798f8dfdb15fc03fa6b4104efed8762d52ebb18 18-Jan-2012 Kaelyn Uhrain <rikka@google.com> Convert DiagnoseEmptyLookup to use correction callbacks.

No new unit tests yet as there is no behavioral change
(except for slightly more specific filtering in
Sema::ActOnStartOfLambdaDefinition). Tests will be added
as the code paths are traced in greater depth to determine
how to improve the results--there are at least one or two
known bugs that require those improvements. This commit
lays the groundwork for those changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7530c034c0c71a64c5a9173206d9742ae847af8b 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cf7c14c3451658311aeaed84c6395082fa91e60d 16-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add some calls to MarkDeclarationReferenced, towards a point where every declaration which is used is marked as used.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1d7049a6eddcc1a4bd33c6a595d4ad2ae8c1cece 12-Jan-2012 Douglas Gregor <dgregor@apple.com> In Objective-C++, actually compute the base type of a member access
expression for an Objective-C object or pointer type, so that we don't
attempt to treat the member name as a template. Fixes
<rdar://problem/10672501>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b69b42c55d56815bab62991bf839cdb41634d3af 11-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Start refactoring code for capturing variables and 'this' so that it is shared between lambda expressions and block literals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
806054db6653d29cb0d9692df3612cbcd03d0530 11-Jan-2012 John McCall <rjmccall@apple.com> Do placeholder conversions on array bounds in both declarators and
new-expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
72899c34e3d1abfffa241ad0ce5c4bf175e5ea51 07-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work: semantic analysis of capturing 'this'. It's a bit complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e81d7e9810eed0d805263791d761ec545d2cf779 07-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Lambdas: semantic analysis of explicit captures.

This patch (and some of my other commits related to lambdas) is heavily based off of John Freeman's work-in-progress patches.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
906a7e1c0f272f7e539c82dda01f4644031ce637 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work. Fixes a minor bug Richard pointed out, makes lookup for lambda parameters work correctly, recording more information into the AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ec9ea7200718478e8a976529defbe21942a11c9c 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work. Tweak the Sema interface slightly. Start adding the pieces to build the lambda class and its call operator. Create an actual scope for the lambda body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f88c400085eac7068399d0a01dbad89f8c579f07 04-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add an explicit LambdaExprContext to Declarator, to parallel BlockLiteralContext. Use it to ensure semantic analysis of types isn't confused by the lack of a type specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
dc3b723d35067e5d13474247b94a10c869cc7e58 04-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Stub out the Sema interface for lambda expressions, and change the parser to use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
91ec7894ec186dd36f509682f00486c98d8228ed 16-Dec-2011 David Blaikie <dblaikie@gmail.com> Support decltype in pseudo destructors and dependent destructor calls.

Reviewed by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5e3a8bea1cb3a8508a99982278934df32ccc7387 15-Dec-2011 Douglas Gregor <dgregor@apple.com> In debugger support mode, if we have a top-level message send
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4db8c4483ea7b271bcce3a0312a0ac434313c09b 12-Dec-2011 David Blaikie <dblaikie@gmail.com> Fix/test decltype dtor calls with invalid base expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
53a75c07dbe79b3dd5dd88a0378aefa18f793083 08-Dec-2011 David Blaikie <dblaikie@gmail.com> Decltype in non-pseudo (& non-dependent) dtor calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5e9392ba18f5925e26cc5714d1412eda0d219826 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Implement support for the __is_final type trait, to determine whether
a class is marked 'final', from Alberto Ganesh Barbati! Fixes
PR11462.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c8d7f586180995ba33d03c0f6115b6a7bdefe326 29-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Revert r145244. It causes us to create broken ASTs with missing type information
for some cast expressions.

Original commit message:

Removed useless ImplicitCast nodes in explicit cstyle and static casts


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
56f5d36fd13c5e271ebd05192c25c88d28e77f8d 28-Nov-2011 Nicola Gigante <nicola.gigante@gmail.com> Removed useless ImplicitCast nodes in explicit cstyle and static casts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bceb75528a4a9757f85df002ab45c6002dc10f94 27-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for an
array of objects with non-trivial destructors. PR11365.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
960809e7e9f4a6e949797d20bc081da80495c0e1 16-Nov-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added missing ImplicitCastExpr around conversion operator call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
30bb420cfe1801742a2ecb242c3b0167d81752d0 16-Nov-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed missing cast and wrong cast kind in delete expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
567c5862be3e278bfc14778612f2d66eafdc4724 14-Nov-2011 John McCall <rjmccall@apple.com> In ARC, don't reclaim objects of Class type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
80ee6e878a169e6255d4686a91bb696151ff229f 10-Nov-2011 John McCall <rjmccall@apple.com> There's no good reason to track temporaries in ExprWithCleanups,
but it is sometimes useful to track blocks. Do so. Also
optimize the storage of these expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7864435ef2bce200224120bd1df3aed98ea5b99a 07-Nov-2011 John McCall <rjmccall@apple.com> Rip out CK_GetObjCProperty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cc7a6484d8afd6f8bede2757666c42248228e408 01-Nov-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Enable function call and some overload resolution with parameters of aggregate class type and initializer list arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3c3b7f90a863af43fa63043d396553ecf205351c 25-Oct-2011 John McCall <rjmccall@apple.com> Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
327a50f46449c946c42d50d97689bcb30e2af7d9 25-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r142914 and r142915, due to possibly missing file.

r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a1b852f8e1bee5ed3604ee483803cef39ce57a20 25-Oct-2011 John McCall <rjmccall@apple.com> Introduce a placeholder type for "pseudo object"
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.

Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
65019acfc46ffb191fac4e781ac0c4b8d0c8434e 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ba0513de93d2fab6db5ab30b6927209fcc883078 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3896fc5d4daaf003e451e797e37de57dd8cf9cd5 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Rework Microsoft __if_exists/__if_not_exists parsing and semantic
analysis to separate dependent names from non-dependent names. For
dependent names, we'll behave differently from Visual C++:

- For __if_exists/__if_not_exists at class scope, we'll just warn
and then ignore them.
- For __if_exists/__if_not_exists in statements, we'll treat the
inner statement as a compound statement, which we only instantiate
in templates where the dependent name (after instantiation)
exists. This behavior is different from VC++, but it's as close as
we can get without encroaching ridiculousness.

The latter part (dependent statements) is not yet implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ebaf0e6ab743394dda086a01b457838cb6e589a8 18-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> -Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
341350ee62abd1ad818e1e3d926cd718960e439b 18-Oct-2011 Douglas Gregor <dgregor@apple.com> Make it possible to compute the type of 'this' without capturing
it. Refactoring to be used in a moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
d41679d6881d2b424d8b3600fc774308087735a7 12-Oct-2011 Douglas Gregor <dgregor@apple.com> Teach __has_nothrow_assign not to complain about access (GCC and EDG
ignore access entirely for it) and not to crash on assignment operator
templates. Fixes PR11110.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
13e1bca90dc227e1e9c30900841f8bf976c0c83e 11-Oct-2011 Douglas Gregor <dgregor@apple.com> When performing a user-defined conversion via a constructor, be sure
to check whether the constructor is accessible. Fixes
<rdar://problem/10202900>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
b45ae256cfd5ef3ab22b4d715159f978d8120d45 05-Oct-2011 John McCall <rjmccall@apple.com> Refactor the analysis of C++ cast expressions so that even
C-style and functional casts are built in SemaCXXCast.cpp.
Introduce a helper class to encapsulate most of the random
state being passed around, at least one level down.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c1c0dfb376b829b94d4c61e9f358ce23e6aa3169 27-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Get rid of useless helper Sema::CastCategory.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f1f8b1a404d9ce6f0eb78e97b598a220d8ca9090 23-Sep-2011 Richard Trieu <rtrieu@google.com> Add a new warning to -Wliteral-conversion to catch cases where a string literal
is cast to a boolean. An exception has been made for string literals in
logical expressions to allow the common case of use in assert statements.

bool x;
x = "hi"; // Warn here
void foo(bool x);
foo("hi"); // Warn here
assert(0 && "error");
assert("error); // Warn here



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
4278c654b645402554eb52a48e9c7097c9f1233a 21-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying Function/BlockDecl's setParams


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
dd22509c82eb7681a0f46b41d61cb2e25a4d8fa1 15-Sep-2011 Richard Trieu <rtrieu@google.com> Finish the lex->LHS and rex->RHS cleanup in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
33e56f3273457bfa22c7c50bc46cf5a18216863d 10-Sep-2011 John McCall <rjmccall@apple.com> Rename the ARC cast kinds to start with "ARC".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
dc05b11c67331016473fbc7909827b1b89c9616b 10-Sep-2011 John McCall <rjmccall@apple.com> When converting a block pointer to an Objective-C pointer type, extend
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.

There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7f3a6d37ba113910e2cbf7490d0f4bb162cd994e 09-Sep-2011 John McCall <rjmccall@apple.com> Code formatting; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d6c8865e6f306556b7eef972ceec2cc8ba026a0d 06-Aug-2011 Kaelyn Uhrain <rikka@google.com> Perform array bounds checking in more situations and properly handle special
case situations with the unary operators & and *. Also extend the array bounds
checking to work with pointer arithmetic; the pointer arithemtic checking can
be turned on using -Warray-bounds-pointer-arithmetic.

The changes to where CheckArrayAccess gets called is based on some trial &
error and a bunch of digging through source code and gdb backtraces in order
to have the check performed under as many situations as possible (such as for
variable initializers, arguments to function calls, and within conditional in
addition to the simpler cases of the operands to binary and unary operator)
while not being called--and triggering warnings--more than once for a given
ArraySubscriptExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
fc4b191b07df309d95aefae39f4cf7c456c91afa 03-Aug-2011 John McCall <rjmccall@apple.com> In ARC, don't try to reclaim the result of a call to performSelector
unless done in a context where the value is used retained.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6722155dfe056e2c3dfbacbcaffae04dea0c2be0 28-Jul-2011 Anna Zaks <ganna@apple.com> Add */& mismatch fixit generation to the Sema::DiagnoseAssignmentResult().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ef8c79c52200e4f7c32f8ef2744c1557b7f3f3ea 27-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Re-fix r136172 so it isn't an error; apparently, some people are fond of their undefined behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e33f643230738400f0bf5503a87d886e9bc635de 27-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Diagnose trying to delete a pointer to an abstract class with a non-virtual destructor. PR10504.

I'm not completely sure the standard allows us to reject this, but if it doesn't, it should. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e52c91478a144f913019591ee1839e1846345f71 27-Jul-2011 Eli Friedman <eli.friedman@gmail.com> A couple minor issues with Sema for delete:

1. Attempting to delete an expression of incomplete class type should be an error, not a warning.

2. If someone tries to delete a pointer to an incomplete class type, make sure we actually emit
the delete expression after we warn.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
84ff0fccb180098b70504c03c3072a19e6d573af 13-Jul-2011 John McCall <rjmccall@apple.com> Enforce access control for the destructor in a new[] expression and mark
it as used. Otherwise, we can fail to instantiate or validate the destructor,
which can lead to crashes in IR gen like PR10351.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
82007c3a3f60ce2299c74333a881e4fdfc2135ce 08-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc++-arc: more diagnosis of converting a weak-unavailable
object to a __weak object type. // rdar://9732636


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7e5e5f4cc36fe50f46ad76dca7a266434c94f475 07-Jul-2011 John McCall <rjmccall@apple.com> In ARC, reclaim all return values of retainable type, not just those
where we have an immediate need of a retained value.

As an exception, don't do this when the call is made as the immediate
operand of a __bridge retain. This is more in the way of a workaround
than an actual guarantee, so it's acceptable to be brittle here.

rdar://problem/9504800



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bca01b46850f867b2f4137f25c882022b58f8471 07-Jul-2011 Douglas Gregor <dgregor@apple.com> Properly implement the scope restriction on the NRVO for
throw-expressions, such that we don't consider the NRVO when the
non-volatile automatic object comes from outside the innermost try
scope (C++0x [class.copymove]p13). In C++98/03, our ASTs were
incorrect but it didn't matter because IR generation doesn't actually
apply the NRVO here. In C++0x, however, we were moving from an object
when in fact we should have copied from it. Fixes PR10142 /
<rdar://problem/9714312>.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ea4aba0e97ca71369a0f6e287443b670cf5c353f 30-Jun-2011 John McCall <rjmccall@apple.com> Perform lvalue-to-rvalue conversions on both operands of ->*
and the RHS of .*. Noticed by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0b8c98f3ddf83adcb9e9d98b68ce38e970cdee73 28-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Declarator::CXXNewContext and remove 'AutoAllowedInTypeName' parameter
from Sema::GetTypeForDeclarator. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d3880f8458bb6a03818ee01f758c32f945de3eaa 28-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Centralize all checks for a C++ tag definition inside a typename in
Sema::GetTypeForDeclarator and remove its 'OwnedDecl' out parameter.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e6d134b244cd666c47a3d2dd78f82ff0824188bd 27-Jun-2011 John McCall <rjmccall@apple.com> Fix PR10204 in a better way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
b9b4b789ebd28d6fde1c42de820b036ffaf95162 23-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Fix Sema::CheckVectorOperands so that it doesn't try to insert a cast expression into the LHS of a compound assignment. Fixes compound assignment of various "compatible" vector types, including NEON-vector and gcc-vector types.

<rdar://problem/9640356>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
7a614d8380297fcd2bc23986241905d97222948c 11-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++11 in-class initialization of non-static data members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8cf0d22420eab58b8b434fa5d3a6e83c63ddefdd 11-Jun-2011 Douglas Gregor <dgregor@apple.com> Fix order of operands for the warning about incompatible Objective-C
pointer assignment in C++. This was a longstanding problem spotted by
Jordy Rose.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
926df6cfabf3eaa4afc990c097fa4619b76a9b57 11-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement Objective-C Related Result Type semantics.

Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
361d380eef53bd2ac3d5efbfea1636e1f8fbdd8d 08-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a bunch more notes that were emitted even when the diagnostic they
were intended for was suppressed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
383616cd2e61131a534afd9364ef53f643e1f834 05-Jun-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Remove all references to InitializationSequence::FailedSequence from outside SemaInit.cpp. Replace them with the boolean conversion or the new Failed() function. This is a first step towards removing InitializationSequence::SequenceKind. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6f0074ae2f466bae9f415da268d61a2dc1fabe26 24-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add new warning that warns when invoking 'delete' on a polymorphic, non-final, class without a virtual destructor.

Patch by Matthieu Monrocq!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7d16627081caede9691a6f46b796da4073ac14ad 15-May-2011 John McCall <rjmccall@apple.com> The array-size operand to a new-expression is not necessarily a size_t.
It can be larger, it can be smaller, it can be signed, whatever. Handle
all the crazy cases with grace and spirit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
feb375d31b7e9108b04a9f55b721d5e0c793a558 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement the __is_trivially_copyable type trait

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2be7e90b81509204b99b7bbf9753ad17b894a12a 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement defaulting of destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cb45a0f42964ab5fa1474b25abcc1ae3a8bd0ab8 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Hrm

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
023df37c27ee8035664fb62f206ca58f4e2a169d 09-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" and
modify the semantics slightly to accomodate default constructors (I
hope).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8db75a2b9c963a3bc0bf928e711353552f4fef79 08-May-2011 Francois Pichet <pichet2000@gmail.com> Look at all the record redeclaration when looking for a uuid attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1e862693c63067ae467b0b3884c44f753cd6e821 06-May-2011 Francois Pichet <pichet2000@gmail.com> Add support for Microsoft __if_exists and __if_not_exists construct inside function definition.
Allow to include or exclude code depending on if a symbol exists or not. Just like a #ifdef but for C/C++ symbols.

More doc: http://msdn.microsoft.com/en-us/library/x7wy9xh3(v=VS.100).aspx

Support at class and namespace scopes will be added later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d6efe9b66fce943ada47100e90237e710c4716fe 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove a stale comment, it no longer applied after my cleanups.

Also fix several misspellings in my comments. I cannot spell, and cannot
even be trusted to ask my editor how to spell apparently.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
aaf147be3cc7403d8f7889d363421bb291ef23f2 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Move several more type traits' implementations into the AST. A few were
already present in the AST, and I added the ones that weren't.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cec0ced5bd3de14d7cebbc1a240618282c91f656 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Switch __is_scalar to use the isScalarType predicate rather than
duplicating its logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
af5a3c6af37a16b0ca686e6af994010b0b3785dd 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Have the array type traits build an expression with type 'size_t'
instead of 'int'.

The Embarcadero spec says 'unsigned int', not 'int'. That's what
'size_t' is on Windows, but for Clang using a 'size_t' that can be
larger than int seems more appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f7ef00048d0a3f6079d82e00a9a8dba92179b9a8 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove an inapplicable and completely out of place comment. The type is in fact 'bool'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d064c70bc63ad742d11625e485c1dc1631f6e303 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove more dead code for emitting diagnostics. The callers of these
functions already precluded dependent types from reaching them.

Also change one of the callers to not error when a trait is applied to
a dependent type. This is a perfectly reasonable pattern, and both Unary
and Binary type traits already support dependent types (by populating
the AST with a nonce value).

Remove the actual diagnostic, since these aren't errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
06207f6f5f248f678498d61d6dbb36774b7fe5ae 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Simplify the flow of some of the array type trait code.

Completely remove a switch which selected between the same two types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4aa0af346b7bb37548078dfab728d28d7776aff3 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Convert the expression trait evaluation to a static function and
a switch with any default case. This both warns when an enumerator is
missing and asserts if a value sneaks through despite the warning.

While in there fix a bunch of coding style issues with this code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
83f563cc10d6265be395b608323ec52e3370915c 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove the default case from the unary type trait evaluation function,
adding an unreachable annotation. Remarkably this one was already
enumarting every trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
73e0a91c9130a048dfb0928643b9cde1f838b87d 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Mark that this function ends in a covering switch statement with every
case returning a value.

Silences a GCC warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
98fa94d2564057555c4a12e8737b8371700cf6e4 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove the type traits UTT_IsLvalueExpr and UTT_IsRvalueExpr.

As might be surmised from their names, these aren't type traits, they're
expression traits. Amazingly enough, they're expression traits that we
have, and fully implement. These "type" traits are even parsed from the
same tokens as the expression traits. Luckily, the parser only tried the
expression trait parsing for these tokens, so this was all just a pile
of dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ccb4ecf9b11d7b652515780253253db976d0447f 01-May-2011 Chandler Carruth <chandlerc@gmail.com> More cleanup of the type traits implementation.
1) Moved the completeness checking routine above the evaluation routine
so the reader sees that we do in fact check for complete types when
necessary.
2) Remove the FIXME comment about not doing this.
3) Make the arguments to the evaluate function agree in order with those
to the completeness checking function.
4) Completely specify the enumerators for the completeness checking
function rather than relying on a default.
5) Remove a check for the Borland language to only require complete
types in a few places. Borland's own documentation doesn't agree with
this: some of the previously unspecified traits *do* require
a complete type, some don't.
6) Correctly split the traits which do not require complete types from
those that do, clarifying comments and citations to the standard or
other documentation where relevant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c41d6b57f3a42fbe29e33b73e670b398fade4718 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Order the type traits according to the standard's listing of unary type
traits where possible. For the rest, group them and add some
documentation regarding their origins.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
28eeb384d6910b897f3cef846f2232b9235fca59 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Begin cleaning up type trait expression implementations and settling on
a single pattern for implementing each.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
eb65a108bd1eb613ed2a9ebfdbd73a9c872f0309 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Extract a function to impose the completeness requirement on unary type
trait arguments. Reflow the logic to use early exit instead of a complex
condition expression. Switch to a switch for acting on different type
traits and add a bunch of the recently implemented type traits here.
This fixes one of the regressions with the new __is_standard_layout
trait to again require a complete type. It also fixes some latent bugs
in other traits that never did impose this despite the standard
requiring it. However, all these bugs were hidden for non-borland
systems where the default is to require a complete type.

It's unclear to me what the best approach here is: providing an explicit
lists for the ones requiring complete types only w/ Borland and using
a default for the rest, or forcing this switch to enumerate the traits
and make it clear which way each one goes.

I'm still working on cleaning up the tests so that they actually catch
this, a much more comprehensive update to the tests will come once I've
worked through the bugs I'm finding via inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
636a617cc6021a4366380b3ce673f4472f3d99db 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Hoist all of the type-specific trait logic for __is_standard_layout into
a Type method isStandardLayoutType, to keep our user API matching the
type trait builtins as closely as possible. Also, implement it in terms
of other Type APIs rather than in terms of other type traits. This
models the implementation on that of isLiteralType and isTrivialType.
There remain some common problems with these traits still, so this is
a bit of a WIP. However, we can now fix all of these traits at the same
time and in a consistent manner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a8225449421e8c1e996a7c48300521028946482a 30-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Completely re-implement the core logic behind the __is_standard_layout
type trait. The previous implementation suffered from several problems:

1) It implemented all of the logic in RecordType by walking over every
base and field in a CXXRecordDecl and validating the constraints of
the standard. This made for very straightforward code, but is
extremely inefficient. It also is conceptually wrong, the logic tied
to the C++ definition of standard-layout classes should be in
CXXRecordDecl, not RecordType.
2) To address the performance problems with #1, a cache bit was added to
CXXRecordDecl, and at the completion of every C++ class, the
RecordType was queried to determine if it was a standard layout
class, and that state was cached. Two things went very very wrong
with this. First, the caching version of the query *was never
called*. Even within the recursive steps of the walk over all fields
and bases the caching variant was not called, making each query
a full *recursive* walk. Second, despite the cache not being used, it
was computed for every class declared, even when the trait was never
used in the program. This probably significantly regressed compile
time performance for edge-case files.
3) An ASTContext was required merely to query the type trait because
querying it performed the actual computations.
4) The caching bit wasn't managed correctly (uninitialized).

The new implementation follows the system for all the other traits on
C++ classes by encoding all the state needed in the definition data and
building up the trait incrementally as each base and member are added to
the definition of the class.

The idiosyncracies of the specification of standard-layout classes
requires more state than I would like; currently 5 bits. I could
eliminate one of the bits easily at the expense of both clarity and
resilience of the code. I might be able to eliminate one of the other
bits by computing its state in terms of other state bits in the
definition. I've already done that in one place where there was a fairly
simple way to achieve it.

It's possible some of the bits could be moved out of the definition data
and into some other structure which isn't serialized if the serialized
bloat is a problem. That would preclude serialization of a partial class
declaration, but that's likely already precluded.

Comments on any of these issues welcome.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cf5664114eb75c6a5fef2bed1c0f0d0fb19debc9 28-Apr-2011 John Wiegley <johnw@boostpro.com> A few corrections to type traits that missed the last checkin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
21ff2e516b0e0bc8c1dbf965cb3d44bac3c64330 28-Apr-2011 John Wiegley <johnw@boostpro.com> Implementation of Embarcadero array type traits

Patch authored by John Wiegley.

These are array type traits used for parsing code that employs certain
features of the Embarcadero C++ compiler: __array_rank(T) and
__array_extent(T, Dim).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
20c0da7787c9a7d2529e42a4a91d777778595d74 28-Apr-2011 John Wiegley <johnw@boostpro.com> t/clang/type-traits

Patch authored by John Wiegley.

These type traits are used for parsing code that employs certain features of
the Embarcadero C++ compiler. Several of these constructs are also desired by
libc++, according to its project pages (such as __is_standard_layout).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
552622067dc45013d240f73952fece703f5e63bd 25-Apr-2011 John Wiegley <johnw@boostpro.com> t/clang/expr-traits

Patch authored by David Abrahams.

These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for
parsing code that employs certain features of the Embarcadero C++ compiler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b7e9589bce9852b4db9575f55ac9137572147eb5 23-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Implement basic __is_trivial type-trait support, enough to close PR9472.
This introduces a few APIs on the AST to bundle up the standard-based
logic so that programmatic clients have access to exactly the same
behavior.

There is only one serious FIXME here: checking for non-trivial move
constructors and move assignment operators. Those bits need to be added
to the declaration and accessors provided.

This implementation should be enough for the uses of __is_trivial in
libstdc++ 4.6's C++98 library implementation.

Ideas for more thorough test cases or any edge cases missing would be
appreciated. =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5666d36cce566b59be271670364794de9803af04 15-Apr-2011 Douglas Gregor <dgregor@apple.com> Forbid the use of C++ new/delete to allocate/free objects within an
address space. I could see that this functionality would be useful,
but not in its current form (where the address space is ignored):
rather, we'd want to encode the address space into the parameter list
passed to operator new/operator delete somehow, which would require a
bunch more semantic analysis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
fb8721ce4c6fef3739b1cbd1e38e3f1949462033 10-Apr-2011 John McCall <rjmccall@apple.com> Simplify calling CheckPlaceholderExpr, converge on it in a few places,
and move a vector-splat check to follow l-value conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
737d5447b5d20633992ee5388eca5270c28c8ae7 07-Apr-2011 Abramo Bagnara <abramo.bagnara@gmail.com> In C++ the argument of logical not should always be bool. Added missing implicit cast for scalars.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ce0682ff4647b885d41847b0f97918504282c2e8 31-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Make ChainedIncludesSource an ExternalSemaSource, otherwise initialization of the ASTReader is incomplete, leading to errors like not realizing std::type_info is already defined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
84950c7fec2b056a424125997cb90451a3c83194 21-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Fix an objc++ diagnostic initializing objc pointers.
// rdar:// 9139947


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a085da86242c9b8e3466f8cf6f4397e9f248fd20 17-Mar-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR9488: 'auto' type substitution can fail (for instance, if it creates a reference-to-void type). Don't crash if it does.
Also fix an issue where type source information for the resulting type was being lost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
8999fe1bc367b3ecc878d135c7b31e3479da56f4 14-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Make deallocation functions implicitly noexcept in C++0x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
069a6da34a86c97ffe78c379da246fc8116daaff 14-Mar-2011 Douglas Gregor <dgregor@apple.com> -fwritable-strings should silence warnings about the deprecated string
-literal to char* conversion. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8026f6d82f7fa544bc0453714fe94bca62a1196e 13-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
60618fa7f88d5162bb5b40988b6b38d4d75d6fc6 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate the new exception information to FunctionProtoType.
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ba877adeb49ed6dc17f27fa3a3bcd0cca713fd68 09-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed InnerLocStart.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ff676cb48fe8bf7be2feaa251dc7c5fb15af4730 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for all DeclaratorDecl's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
36784e78bcce1dbaf35f94a655394e348b4d9ac7 08-Mar-2011 John Wiegley <johnw@boostpro.com> Removed trailing whitespace as a test commit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
353ee246e754e38db9b738240d18f1ecf2bb389b 07-Mar-2011 Douglas Gregor <dgregor@apple.com> Produce a diagnostic for unused overloaded expressions, from Faisal Vali!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8b5b4099c61a136e9a1714c4d8a593febe942268 06-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo.", this time with the missing header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
708a86690469474f0a8149abca71aa4c62bf9710 06-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r127112, "Propagate new-style exception spec information to ExtProtoInfo."

It seems missing "clang/Basic/ExceptionSpecificationType.h".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
06bfa84588658d721094f383d6950e75100c4c4c 05-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate new-style exception spec information to ExtProtoInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7ec1873d694cf870264694d2b61219a03492bc30 04-Mar-2011 Douglas Gregor <dgregor@apple.com> When clearing a LookupResult structure, clear out the naming class,
too. Fixes PR7900.

While I'm in this area, improve the diagnostic when the type being
destroyed doesn't match either of the types we found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
059101f922de6eb765601459925f4c8914420b23 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source-location information into dependent
template specialization types. This also required some parser tweaks,
since we were losing track of the nested-name-specifier's source
location information in several places in the parser. Other notable
changes this required:

- Sema::ActOnTagTemplateIdType now type-checks and forms the
appropriate type nodes (+ source-location information) for an
elaborated-type-specifier ending in a template-id. Previously, we
used a combination of ActOnTemplateIdType and
ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped
around a DependentTemplateSpecializationType, which duplicated the
keyword ("class", "struct", etc.) and nested-name-specifier
storage.

- Sema::ActOnTemplateIdType now gets a nested-name-specifier, which
it places into the returned type-source location information.

- Sema::ActOnDependentTag now creates types with source-location
information.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3aea4dac830cb03d883a13ab30c28a3a53beca58 01-Mar-2011 Ted Kremenek <kremenek@apple.com> For C++, enhance -Warray-bounds to recursively analyze array subscript accesses in ?: expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e29425bd22fbb9200bbec7b743197b9c6dad3e40 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Teach Sema::CheckTypenameType to use nested-name-specifiers with
source-location information. We don't actually preserve this
information in any of the resulting TypeLocs (yet), so it doesn't
matter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
15348aeb81285c75b2e92b5bf8d2db3445d147c2 28-Feb-2011 Anders Carlsson <andersca@mac.com> Add a -fcxx-exceptions flag to the frontend, which can be used to enable
C++ exceptions, even when exceptions have been turned off using -fno-exceptions.
Make the -fobjc-exceptions flag do the same thing, but for Objective-C exceptions.

C++ and Objective-C exceptions can also be disabled using -fno-cxx-excptions and
-fno-objc-exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
f3db29fff6a583ecda823cf909ab7737d8d30129 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source-location information into
pseudo-destructor expressions. Also, clean up some
template-instantiation and type-checking issues with
pseudo-destructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7e384943ac136f6c2ea55c309108b83939cd4c21 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Switch a few CXXScopeSpec::MakeTrivial() calls over to appropriate
NestedNameSpecifierLoc handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2d9f5fa1bcbde31b83c79027c3f1da2d64e3b1fe 25-Feb-2011 John McCall <rjmccall@apple.com> Formatting, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
729b853f4bfa83e53c638a06a9dccf83b4e1f720 23-Feb-2011 Anders Carlsson <andersca@mac.com> Don't give an error for 'try' and 'throw' if they occur in system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
34b41d939a1328f484511c6002ba2456db879a29 20-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement the C++0x deduced 'auto' feature.

This fixes PR 8738, 9060 and 9132.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b1fba3145392dc0cf54691576a4e6141e5081869 19-Feb-2011 Anders Carlsson <andersca@mac.com> There's no need to return early if we encounter a try/throw and exceptions are disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7f11d9cf5df1f8ce82af46eabc4ec5cec7d580b0 19-Feb-2011 Anders Carlsson <andersca@mac.com> Disallow try/catch/throw when exceptions are disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7ef932429ed0edcc5e4bf44e516f5f4be6a8a03f 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Fix a missed case in the NULL operand to conditional operator
diagnostics.

Patch by Stephen Hines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
82214a80c0163e01e4d8dec1426023c89277dbb4 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Initial steps to improve diagnostics when there is a NULL and
a non-pointer on the two sides of a conditional expression.

Patch by Stephen Hines and Mihai Rusu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
35001ca261f895817916b468379b696d6d45959d 17-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the array bounds checking to work for several other constructs,
especially C++ code, and generally expand the test coverage.

Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
56ca35d396d8692c384c785f9aeebcf22563fe1e 17-Feb-2011 John McCall <rjmccall@apple.com> Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
1e52dfc648ce0b25ef57ae29ef1b4337d80011ef 08-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Support for objextive-c++ use of property-dot syntax as receiver
in liu of a class method getter.
// rdar://8962253


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5e6fcd4ba9cc4cab5a6be0a76bca9d51480ea346 08-Feb-2011 Douglas Gregor <dgregor@apple.com> Sema::MaybeBindToTemporary() shouldn't treat any expression returning
a glvalue as a temporary. Previously, we were enumerating all of the
cases that coul return glvalues and might be called with
Sema::MaybeBindToTemporary(), but that was gross and we missed the
Objective-C property reference case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5808ce43f8d7e71f5acacc9ca320268c4f37565a 03-Feb-2011 John McCall <rjmccall@apple.com> More capturing of 'this': implicit member expressions. Getting that
right for anonymous struct/union members led to me discovering some
seemingly broken code in that area of Sema, which I fixed, partly by
changing the representation of member pointer constants so that
IndirectFieldDecls aren't expanded. This led to assorted cleanups with
member pointers in CodeGen, and while I was doing that I saw some random
other things to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
469a1eb996e1cb0be54f9b210f836afbddcbb2cc 02-Feb-2011 John McCall <rjmccall@apple.com> An insomniac stab at making block declarations list the variables they close
on, as well as more reliably limiting invalid references to locals from
nested scopes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d880f52be3e4a8ccad92ac31932eeae5e0870a93 01-Feb-2011 Douglas Gregor <dgregor@apple.com> Implement access checking for the "delete" operator. Fixes PR9050,
from Alex Miller!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d89d30fdd9e3061fb100fb8f976aab5c6cf2c901 28-Jan-2011 John McCall <rjmccall@apple.com> Fix some corner cases in the __is_base_of logic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b608b987718c6d841115464f79ab2d1820a63e17 28-Jan-2011 Douglas Gregor <dgregor@apple.com> Give OpaqueValueExpr a source location, because its source location
might be queried in places where we absolutely require a valid
location (e.g., for template instantiation). Fixes some major
brokenness in the use of __is_convertible_to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1eee5dc0465c0ab4810e21d365e881152d7f53c0 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach the evaluation of the __is_convertible_to trait to translate
access control errors into SFINAE errors, so that the trait provides
enough support to implement the C++0x std::is_convertible type trait.

To get there, the SFINAETrap now knows how to set up a SFINAE context
independent of any template instantiations or template argument
deduction steps, and (separately) can set a Sema flag to translate
access control errors into SFINAE errors. The latter can also be
useful if we decide that access control errors during template argument
deduction should cause substitution failure (rather than a hard error)
as has been proposed for C++0x.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a0506183a4c1340d7b91125fb41280b3b6619cfa 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Document some serious badness in our evaluation of the type traits: we need to be sure we have complete types in many cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9f3611365d0f2297a910cf246e056708726ed10a 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the Microsoft __is_convertible_to type trait, modeling the
semantics after the C++0x is_convertible type trait. This
implementation is not 100% complete, because it allows access errors
to be hard errors (rather than just evaluating false).

Original patch by Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b7ee2e5cc999a45ec4fd7b879477816714aabb7e 27-Jan-2011 Jeffrey Yasskin <jyasskin@google.com> Revert r124217 because it didn't catch the actual error case it was trying to
catch:

lock_guard(my_mutex);

declares a variable instead of creating a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6ec278d1a354517e20f13a877481453ee7940c78 27-Jan-2011 John McCall <rjmccall@apple.com> Do a proper recursive lookup when deciding whether a class's usual
deallocation function has a two-argument form. Store the result of this
check in new[] and delete[] nodes.

Fixes rdar://problem/8913519



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
6b4df91dc4ed4a3fc78587c49a3ed3df96b65d9c 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Reference qualifiers for *this: implement C++0x [expr.mptr.oper]p6,
the restrictions on .* and ->* for ref-qualified pointer-to-member
functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c60e13aeff96515d27638129154b1308c15ded3d 25-Jan-2011 Jeffrey Yasskin <jyasskin@google.com> Add an attribute to forbid temporary instances of a type. This allows class
authors to write

class __attribute__((forbid_temporaries)) Name { ... };

when they want to force users to name all variables of the type. This protects
people from doing things like creating a scoped_lock that only lives for a
single statement instead of an entire scope.

The warning produced by this attribute can be disabled by
-Wno-forbid-temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
72dfa27b415b15157a9d1fc33b6ed21f0085bed2 21-Jan-2011 Douglas Gregor <dgregor@apple.com> When throwing an elidable object, first try to treat the subexpression
as an rvalue per C++0x [class.copy]p33. If that fails, try again with
the original subexpression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f5d8f466c3eebaffc51468812bdcbe7f0fe4891a 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Promote the static getNRVOCandidate() function, which computed the
NRVO candidate for a return statement, to
Sema::getCopyElisionCandidate(), and teach it enough to also determine
the NRVO candidate for a throw expression. We still don't use the
latter information, however.

Along the way, implement core issue 1148, which eliminates copy
elision from catch parameters and clarifies that copy elision cannot
occur from function parameters (which we already implemented).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
dec0984fce504a39a7f085774fb67cfd9957be58 18-Jan-2011 Jeffrey Yasskin <jyasskin@google.com> Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
-Wint-to-pointer-cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6915c529dbb43073dad148c2e83a1c56bfcc05c8 27-Dec-2010 Francois Pichet <pichet2000@gmail.com> More __uuidof validation:
1. Do not validate for uuid attribute if the type is template dependent.
2. Search every class declaration and definition for the uuid attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d8039129f3da19819696209e4005cc73907f5c3b 20-Dec-2010 Francois Pichet <pichet2000@gmail.com> XFAIL vtable-debug-info.cpp on WIN32 and fix curly brace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
913b7bf8c40454641588611b7bbad981dc53c882 20-Dec-2010 Francois Pichet <pichet2000@gmail.com> Emit an error if operator __uuidof() is called on a type with no associated GUID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e6a365d772a6b455f1e23ac9ae5f40d65a55a18c 19-Dec-2010 John McCall <rjmccall@apple.com> Motions towards simplifying how we deal with attribute-qualified function types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
e23cf437fe76b1ed02d63c3f61b456fd48a915f5 14-Dec-2010 John McCall <rjmccall@apple.com> Restore r121752 without modification.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5bfe232d1f07a6fd160fcf82c277c055a412a1c0 14-Dec-2010 John McCall <rjmccall@apple.com> Pull out r121752 in case it's causing the selfhost breakage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0e88aa7100da32acc63bc8a4dcb946ed517868f1 14-Dec-2010 John McCall <rjmccall@apple.com> Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around. The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d0937224f383c7cc72c947119380f9713a070c73 13-Dec-2010 Douglas Gregor <dgregor@apple.com> Variadic templates: extend Type, NestedNameSpecifier, TemplateName,
and TemplateArgument with an operation that determines whether there
are any unexpanded parameter packs within that construct. Use this
information to diagnose the appearance of the names of parameter packs
that have not been expanded (C++ [temp.variadic]p5). Since this
property is checked often (every declaration, ever expression
statement, etc.), we extend Type and Expr with a bit storing the
result of this computation, rather than walking the AST each time to
determine whether any unexpanded parameter packs occur.

This commit is deficient in several ways, which will be remedied with
future commits:
- Expr has a bit to store the presence of an unexpanded parameter
pack, but it is never set.
- The error messages don't point out where the unexpanded parameter
packs were named in the type/expression, but they should.
- We don't check for unexpanded parameter packs in all of the places
where we should.
- Testing is sparse, pending the resolution of the above three
issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f187237d916afa97c491ac32fe98be7d335c5b63 08-Dec-2010 Francois Pichet <pichet2000@gmail.com> Remove the TypesCompatibleExprClass AST node. Merge its functionality into BinaryTypeTraitExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
241d5580d2f3969d2cd2a94b4a92c762b5dc1e04 07-Dec-2010 John McCall <rjmccall@apple.com> Bump up property conversion earlier in the initialization process. Fixes
the failed compile in PR8751.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6f18fca241bf060bccbea52e5e436e17562bc9b3 07-Dec-2010 John McCall <rjmccall@apple.com> Kill FullExpr, as it was not, in fact, used anywhere in the code base.
I'm not opposed to the idea in concept, but there's no point in preserving
abortive experiments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6ad6f2848d7652ab2991286eb48be440d3493b28 07-Dec-2010 Francois Pichet <pichet2000@gmail.com> Type traits intrinsic implementation: __is_base_of(T, U)
New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4765fa05b5652fcc4356371c2f481d0ea9a1b007 06-Dec-2010 John McCall <rjmccall@apple.com> Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
85515d64c15838eadb3ffe82b635f8217b04be8a 04-Dec-2010 John McCall <rjmccall@apple.com> First pass at implementing the intent of ANSI C DR106.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9ec9445402f4365fb0ac6e28e8be78cda3e9d8af 04-Dec-2010 John McCall <rjmccall@apple.com> dyn_cast else unreachable -> cast



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f6a1648197562e0b133440d612d9af297d0a86cc 04-Dec-2010 John McCall <rjmccall@apple.com> Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a3998bd364f8c6b4a520f479083da1d6e30482a1 02-Dec-2010 Douglas Gregor <dgregor@apple.com> When we're performing an explicit cast of some sort, don't complain
about deprecated Objective-C pointer conversions. Plus, make sure to
actually set an appropriate AssignmentAction when performing an
implicit conversion from an InitializationSequence. Fixes regressions
in the GCC DejaGNU testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a878cda355074d7d50211be49e7871840a55a5d9 02-Dec-2010 John McCall <rjmccall@apple.com> Perform lvalue-to-rvalue at the end of an expression statement in C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
0943168ac126b8047f30f6bd215fbe7db14d61ba 18-Nov-2010 John McCall <rjmccall@apple.com> Add an assertion, fix a whole bunch of bugs, comment the assertion
out because there are still bugs left.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
404cd1669c3ba138a9ae0a619bd689cce5aae271 13-Nov-2010 John McCall <rjmccall@apple.com> Introduce a null-to-pointer implicit cast kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bf8cafadb9d4e0d7a90fe78fc175efb80ae34d42 02-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Properly handle temporaries that are created in a AsmStmt.

Previously the temporaries would get destroyed before the asm call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
19cc1c715e97885f10b3496f91d0a8ae24642faa 01-Nov-2010 Douglas Gregor <dgregor@apple.com> Harden Sema::MaybeBindTotemporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
428edafa9eb80e01dd40aab31d4166a787a741e1 25-Oct-2010 Chandler Carruth <chandlerc@gmail.com> Improve the tracking of source locations for parentheses in constructor calls.
This adds them where missing, and traces them through PCH. We fix at least one
bug in the extents found by the Index library, and make a lot of refactoring
tools which care about the exact formulation of a constructor call easier to
write. Also some minor cleanups to more consistently follow the friend pattern
instead of the setter pattern when rebuilding a serialized AST.

Patch originally by Samuel Benzaquen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7d520baec9b762633a09d31ee0db12e41fe2758a 13-Oct-2010 Douglas Gregor <dgregor@apple.com> There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even
though the standard requires it. GCC/EDG do not require a complete
type here, so we're calling this a problem with the standard. Fixes
PR8328.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
98efb9f6df133f5508d260c4510c6c3bd70f34ad 12-Oct-2010 Eli Friedman <eli.friedman@gmail.com> PR8325: don't do destructor checking when a pointer is thrown.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
b4eb64d8426c0eaa58d398961e0e74ff85063d7c 08-Oct-2010 John McCall <rjmccall@apple.com> Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers. rdar://problem/8232669



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a0750768718bb5d05150641b5bba74847a21bc09 06-Oct-2010 Douglas Gregor <dgregor@apple.com> Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3911a1a0ab0bbbf2304db8e965f5b8365eb6887b 25-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a NYI in IRGen which was due to incorrect AST
for property reference expression (of c++ object type)
in the conditional expression. Fixes // rdar://8291337



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
1fb019bf42f5757c027edb56e5bb70233787a39c 18-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Problem with gnu conditional extension with missing
LHS and when conditional expression is an array. Since
it will be decayed, saved expression must be saved with
decayed expression. This is necessary to preserve semantics
of this extension (and prevent an IRGen crash which expects
an array to always be decayed). I am sure there will be other
cases in c++ (aggregate conditionals for example) when saving of the
expression must happen after some transformation on conditional
expression has happened.
Doug, please review. Fixes // rdar://8446940


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f8aca8664512c80a018eb4a4a93c61ad6793abcd 15-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix destructor and assignment operator lookup in the has_nothrow traits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
edeb6c9b47e802da1a9a149ea1ea4f1ddd7f6182 14-Sep-2010 John McCall <rjmccall@apple.com> The paired 'operator delete' for a placement 'operator new' is always a
placement 'operator delete', even if there are no placement args (i.e.
overload resolution selected an operator new with default arguments).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
08295a592d7e54e6bea00daeb2abe7ac79a3aaba 14-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Don't crash when using type traits on a class with a constructor template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
751025d5d174ab75dc3788211581d9fbe6224841 14-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5f4e8999aa30e2986e99fbfa4c43e61e99a18687 13-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Have __has_nothrow_copy use Sema's lookup routines. This fixes the problem with not finding implicitly declared copy constructors, part of PR8107.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0dfd848fa4c9664852ba8c929a8bd3fce93ddca2 13-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Eagerly evaluate type traits in Sema instead of lazily in AST. They actually need Sema access to be correct, fixes coming up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4076dacf1497fb95cb298b9d964fbdbdaf9bde6c 13-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bd7c849de9a1647b235597681c3983ba1e8c6c8b 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Eli helped me understand how evaluation contexts work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2e156225a29407a50dd19041aa5750171ad44ea3 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Define and implement CXXNoexceptExpr. Create it in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
02bc21a88ecbdf49b2e674c210a4cbf8c48c6e58 10-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Parse the noexcept operator and stub out sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
3d37c0ada0e46b87be0a10e8d52d990a97d3907a 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4eb4f0f96289cbece50c1270e02af3caf8779705 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Fix a few minor issues with parsing and semantic analysis of C++
typeid expressions:
- make sure we have a proper source location for the closing ')'
- cache the declaration of std::type_info once we've found it



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
19311e70edaa2d7bb0d709344aebea4fbbae2da4 08-Sep-2010 Douglas Gregor <dgregor@apple.com> Use the new-initialization code for initializing scalars with a
function-style cast. Previously, we had a (redundant, incorrect)
semantic-checking path for non-class types, which allowed
value-initialization of a reference type and then crashed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
01b7c3028da5bbcb9f8e52ba67e4613070de0e60 08-Sep-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator implementation part 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
607a1788d9529c8e8494ac528764aa2c678a1a97 08-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow (cv) void and incomplete arrays to be passed to the type traits.

Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ab6677ec401cfd2c82b34e4cdfebd55a9dc25778 08-Sep-2010 Douglas Gregor <dgregor@apple.com> Provide proper type-source location information for
CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and
CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the
process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1bb2a93ab7b1499dda6f6b58865bd0dce1864228 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information for CXXNewExpr, by hanging on to
the TypeSourceInfo for the allocated type. Fixes PR7501.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6cf750298d3621d8a10a6dd07fcee8e274b9d94d 30-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0016d519b831859526b79405cdae4c64c73731c8 29-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement C++0x user-defined string literals.

The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
d931b086984257de68868a64a235c2b4b34003fb 26-Aug-2010 John McCall <rjmccall@apple.com> De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d2932986a16244b7f9a3f9a7a6b0daf543c91540 26-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix miscompilation. The custom new[]/delete[] methods were not getting called for arrays with more than 1 dimension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
5f1e0942a32657b625702aa52f82430d0120f424 24-Aug-2010 John McCall <rjmccall@apple.com> More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7a1fad38256eb4c5129359be85ba1ea1678eb5c9 24-Aug-2010 John McCall <rjmccall@apple.com> Remove a header dependency from Sema.h at the cost of some type safety.
If someone wants to fix this some other way....



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
b3d8748e797c6c2f1dc01186c8eeb3b1b5fe970c 24-Aug-2010 John McCall <rjmccall@apple.com> Abstract out passing around types and kill off ActionBase.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
2b5289b6fd7e3d9899868410a498c081c9595662 23-Aug-2010 John McCall <rjmccall@apple.com> Push DeclGroupRefs and TemplateNames in an opaque but type-safe way
through the parser.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
19510856727e0e14a3696b2a72c35163bff2a71f 20-Aug-2010 John McCall <rjmccall@apple.com> Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cf807c4dfdb23e8fa3f400e0b24ef5b79db7a530 19-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Generate Attr subclasses with TableGen.

Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td

- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7b86862ff555a9d848ac7abf6042d192b6d5a04d 18-Aug-2010 Douglas Gregor <dgregor@apple.com> Make sure to add MallocAttr to explicitly-declared operator new/new[]
when -fassume-sane-operator-new. Patch by Tom Jablin!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2767ce2e21d8bc17869b8436220bce719b3369e4 18-Aug-2010 Douglas Gregor <dgregor@apple.com> Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
507384f0074498b658cc1455dbb912dd95455512 12-Aug-2010 John McCall <rjmccall@apple.com> Bail out of MaybeBindToTemporary if the record type is invalid. Test case
is 8.5MB, sorry.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
09556fd1fb576144e2beda023bf3386f2292243b 08-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Fix a crash on template delete operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
046a7466f23107bd752d9a8106aada85061699bc 04-Aug-2010 John McCall <rjmccall@apple.com> Look through using declarations when deciding whether to use an operator
delete for a virtual destructor. Diagnose ambiguities.

Fixes PR7803.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
76c38d385447b7acdff2d7e6b13fa8580e7174a7 02-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
26faaac4b636eafc2d686516f068170652c83fd9 02-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
254a9427ff84d694724fdecd0642dad8ceaa0645 29-Jul-2010 Douglas Gregor <dgregor@apple.com> When deleting a value of class type, make sure that type is complete
before looking for conversions to pointer type. Fixes <rdar://problem/8248780>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
0ea4dfd0eb56b065460c1696933748e765120fe0 16-Jul-2010 Anders Carlsson <andersca@mac.com> When checking whether to bind an expression to a temporary, don't bind Obj-C message send expressions who call methods that return references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
4bd40318cbea15310a37343db46de96c4fcc15e6 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like

new (int [size])

to a warning, add a Fix-It to remove the parentheses, and make this
diagnostic work properly when it occurs in a template
instantiation. <rdar://problem/8018245>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
ed8abf18329df67b0abcbb3a10458bd8c1d2a595 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
84745677f64863e025a6733cb29d0b94bc3a6ae2 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c0fee50ce432a63b7c4ee73e73a464af1bf388a0 08-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rip out the C++0x-specific handling of destructor names. The specification is still in flux and unclear, and our interim workaround was broken. Fixes PR7467.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
016a4a90c8e75d59de731fa3aa98f0a55656e66c 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
63ef464c3fad1e8b9f9360baa6c81f974b712e90 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
db89f289a22897f1031c92f3e49f7a9ba7bae61e 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Add a new routine Sema::LookupDestructor and make all destructor-lookup calls use that routine

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1d110e05e0ff48c1c7a483d6b7fd094cdf28316a 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameter from
CXXRecordDecl::getDestructor(); no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
6699220f73f11e471b5e5aa42eaf064afeaa079e 29-Jun-2010 Douglas Gregor <dgregor@apple.com> Allow a using directive to refer to the implicitly-defined namespace
"std", with a warning, to improve GCC compatibility. Fixes PR7517.

As a drive-by, add typo correction for using directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2389324eb73a1c99d5dfc1dc9eed047ddc96a7b4 28-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Suppress diagnosing access violations while looking up deallocation functions
much as we already do for allocation function lookup. Explicitly check access
for the function we actually select in one case that was previously missing,
but being caught behind the blanket diagnostics for all overload candidates.
This fixs PR7436.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f9d5bac60bce072a754ca629d3899e8c6c0b5018 26-Jun-2010 Ted Kremenek <kremenek@apple.com> Use TypeSourceInfo to help determine the SourceRange of a CXXNewExpr. This fixes several
cases where we generated an invalid SourceRange for this expression. Thanks to John McCall
for helping me figure this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1984eb9a1522ad56e1310643a85f66b2b3424c91 23-Jun-2010 Douglas Gregor <dgregor@apple.com> String literals enclosed in parentheses are still string
literals. Fixes PR7488.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
170e5080011acc60e33ec9b53f96c569a1078aa9 17-Jun-2010 Gabor Greif <ggreif@gmail.com> fix some more gcc3.4 constness warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d4266629ed62e3a0de5e2cb2dfb8e806f9bdc5f6 16-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Make sure result type of objc++ message expression is
complete before attempting to bind it to a temporary.
Fixes PR7386.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
81e317a444dd756a1cafe94031e4b3f3c138dac6 11-Jun-2010 John McCall <rjmccall@apple.com> Allow pseudo-destructors to be called on qualified pointers. Patch by
Troy Straszheim!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bf1a028246d884a540aeafa38e89be59a269b072 05-Jun-2010 John McCall <rjmccall@apple.com> Alter the interface of GetTypeForDeclarator to return a TypeSourceInfo*.
This is never null, but the associated type might be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5ed9b93c596c3926b6680b47de28c8ff6a8ff4b7 03-Jun-2010 Eli Friedman <eli.friedman@gmail.com> Make sure to check the accessibility of and mark the destructor for the
operand of a throw expression. Fixes PR7281.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d1c1d7bd14dce533e8755164ff59988f2ea5da94 02-Jun-2010 Douglas Gregor <dgregor@apple.com> typeid() produces type information for the cv-unqualified version of
the type. Thanks to Anders for the bug report!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
94a615718d06704816c6e31a811f823c05e39f52 24-May-2010 Douglas Gregor <dgregor@apple.com> Downgrade deletion of a void* from an error (which is should be) to an
extension warning (which other compilers seem to use). Works around a
known bug in Xalan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bd054dba8a3023821f2a0951b0fae05e3522a7c9 20-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Renamed misleading getSourceRange -> getLocalSourceRange and getFullSourceRange -> getSourceRange for TypeLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ea1471e0e967548c596a71469702f8846dbaf3c0 20-May-2010 John McCall <rjmccall@apple.com> Support implicitly closing on 'this' in a block. Fixed PR7165.

(the codegen works here, too, but that's annoying to test without execution)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b65a45835afcc93fa99e22b14b4c9734c261d831 20-May-2010 Douglas Gregor <dgregor@apple.com> When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.

Daniel did all the hard work of tracking down the issue, I get to type
up the trivial fix for this horrible miscompile.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e4da7a034a2fcf4b14d0bcc28d05de0878159061 19-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
55cbd6e51fdca832c31bf8c179c40978a5d1f892 16-May-2010 Anders Carlsson <andersca@mac.com> Correctly diagnose array 'new' with initialization arguments when the new type is a typedef to an array type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3caf04ea0c01ff6822209c4621c3fa64a48029a4 16-May-2010 Douglas Gregor <dgregor@apple.com> When the type-id or new-type-id of a C++ "new" expression is a typedef
of an array type, use the outermost array bound as the number of
elements to allocate. Fixes PR7147.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3c9034cb7ff1d6c1e4ecd1b44c98f553df013c7c 15-May-2010 Douglas Gregor <dgregor@apple.com> Recognize when the named return value optimization applies in a
"return" statement and mark the corresponding CXXConstructExpr as
elidable. Teach CodeGen that eliding a temporary is different from
eliding an object construction.

This is just a baby step toward NRVO.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6fb745bdf1ff1e32caf07e42093a7920726892c1 13-May-2010 Douglas Gregor <dgregor@apple.com> Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
- For every use of a vtable, Sema calls MarkVTableUsed() to indicate
the use. For example, this occurs when calling a virtual member
function of the class, defining a constructor of that class type,
dynamic_cast'ing from that type to a derived class, casting
to/through a virtual base class, etc.
- For every definition of a vtable, Sema calls MarkVTableUsed() to
indicate the definition. This happens at the end of the translation
unit for classes whose key function has been defined (so we can
delay computation of the key function; see PR6564), and will also
occur with explicit template instantiation definitions.
- For every vtable defined/used, we mark all of the virtual member
functions of that vtable as defined/used, unless we know that the key
function is in another translation unit. This instantiates virtual
member functions when needed.
- At the end of the translation unit, Sema tells CodeGen (via the
ASTConsumer) which vtables must be defined (CodeGen will define
them) and which may be used (for which CodeGen will define the
vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
(1) There's a ton of churn in the tests, because the order in which
vtables get emitted to IR has changed. I've tried to isolate some of
the larger tests from these issues.
(2) Some diagnostics related to
implicitly-instantiated/implicitly-defined virtual member functions
have moved to the point of first use/definition. It's better this
way.
(3) I could use a review of the places where we MarkVTableUsed, to
see if I missed any place where the language effectively requires a
vtable.

Fixes PR7114 and PR6564.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
465d41b92b2c862f3062c412a0538db65c6a2661 11-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Merged Elaborated and QualifiedName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
380c2139959d8608782292984b457640a143a70d 11-May-2010 Daniel Dunbar <daniel@zuster.org> Speculatively revert r103497, "Do not mark the virtual members of an
implicitly-instantiated class as ...", which seems to have broken bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bbbe074566a8defed299ff676bc65b3631861768 11-May-2010 Douglas Gregor <dgregor@apple.com> Do not mark the virtual members of an implicitly-instantiated class as
referenced unless we see one of them defined (or the key function
defined, if it as one) or if we need the vtable for something. Fixes
PR7114.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
eecf38f821fe8e113722096b77da7d68b26d28d1 06-May-2010 Douglas Gregor <dgregor@apple.com> Fixed DISABLE_SMART_POINTERS breakage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
586596fd7f7a336a2847b300c80614dcf39ab6d5 06-May-2010 Douglas Gregor <dgregor@apple.com> Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

(1) Forgetting to destroy temporaries created in the condition (!),
(2) Destroying the temporaries created in the condition *before*
converting the condition to a boolean value (or, in the case of a
switch statement, to an integral or enumeral value), or
(3) In a for statement, destroying the condition's temporaries at
the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
323ed74658bc8375278eabf074b4777458376540 06-May-2010 John McCall <rjmccall@apple.com> Rearchitect -Wconversion and -Wsign-compare. Instead of computing them
"bottom-up" when implicit casts and comparisons are inserted, compute them
"top-down" when the full expression is finished. Makes it easier to
coordinate warnings and thus implement -Wconversion for signedness
conversions without double-warning with -Wsign-compare. Also makes it possible
to realize that a signedness conversion is okay because the context is
performing the inverse conversion. Also simplifies some logic that was
trying to calculate the ultimate comparison/result type and getting it wrong.
Also fixes a problem with the C++ explicit casts which are often "implemented"
in the AST with a series of implicit cast expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
48c950137e4318abb1080f438208fda8c14ca8b9 03-May-2010 Anders Carlsson <andersca@mac.com> The array form of 'new' can never have initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
28e9483a1994cb3615a123379b3b299fd5248e22 03-May-2010 Anders Carlsson <andersca@mac.com> Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
57fdc8a4382164955c7b30d09f4ce46fc7e67659 27-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information in a C++ typeid (type) expression
by using TypeSourceInfo, cleaning up the representation
somewhat. Teach getTypeOperand() to strip references and
cv-qualifiers, providing the semantic view of the type without
requiring any extra storage (the unmodified type remains within the
TypeSourceInfo). This fixes a bug found by Boost's call_traits test.

Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid
routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId
functions, which perform the semantic analysis for typeid(type) and
typeid(expression), respectively. We now perform less work at template
instantiation time (we don't look for std::type_info again) and can
give better diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b0fd483ad64865cc0233981cfddc36a7c9795e5e 25-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve the diagnostic when we find something we did not expect in a
member expression (p-> or x.), by showing the type we looked into and
what we did actually find.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
41b2dcd465f1e438502c420effc9d0c747f9db8f 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add BasePath arguments to all cast expr constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
107de90451b7f7a7749380a9d017ff1bafb6b407 24-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep track of when DependentNameTypes have no associated keyword
(e.g., no typename, enum, class, etc.), e.g., because the context is
one that is known to refer to a type. Patch from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
17e1d35848247cbc5ff31df58f0b67e85b64837c 23-Apr-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Require a complete type for the lhs of member pointer dereference operations if the type isn't exactly the same as the container class. Fixes PR6783.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ac418162692a951ca3796d6830496a85a2d12493 22-Apr-2010 John McCall <rjmccall@apple.com> Call PerformCopyInitialization to properly initialize the exception temporary
in a throw expression. Use EmitAnyExprToMem to emit the throw expression,
which magically elides the final copy-constructor call (which raises a new
strict-compliance bug, but baby steps). Give __cxa_throw a destructor pointer
if the exception type has a non-trivial destructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9c82afc7d1f57b427053e6679d87539b0dc63b1a 20-Apr-2010 John McCall <rjmccall@apple.com> Restore r101841 without modification. Also mark 'operator delete' as used for
actual delete expressions, not just new expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3609432178ae63977d575065509238ca2fedf455 20-Apr-2010 John McCall <rjmccall@apple.com> Revert r101841 and follow-up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
af5ece5017d59bd43ccd6dbe172a1f5b57132ff9 20-Apr-2010 John McCall <rjmccall@apple.com> Don't bother looking for (or diagnosing problems with) the 'operator delete'
associated with a new expression if -fno-exceptions is set.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
16573fa9705b546b7597c273b25b85d6321e2b33 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8f00dcf1414dd0aefa18c12eb105428c83fba4f5 17-Apr-2010 Douglas Gregor <dgregor@apple.com> Switch Sema::FindCompositePointerType() over to InitializationSequence.

This is the last of the uses of TryImplicitConversion outside of
overload resolution and InitializationSequence itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
ba70ab6e92ab3055acc898738e5f86739b91685e 17-Apr-2010 Douglas Gregor <dgregor@apple.com> Make Sema::BuildCXXCastArgument static, since it now only has one caller. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d6e44a3c4193bd422bfa78c8086fb16bb2168e34 17-Apr-2010 Douglas Gregor <dgregor@apple.com> Collapse the three separate initialization paths in
TryStaticImplicitCast (for references, class types, and everything
else, respectively) into a single invocation of
InitializationSequence.

One of the paths (for class types) was the only client of
Sema::TryInitializationByConstructor, which I have eliminated. This
also simplified the interface for much of the cast-checking logic,
eliminating yet more code.

I've kept the representation of C++ functional casts with <> 1
arguments the same, despite the fact that I hate it. That fix will
come soon. To satisfy my paranoia, I've bootstrapped + tested Clang
with these changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
871f439643b297dbb49396f6a3617875390978df 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Eliminate the Elidable parameter to PerformImplicitConversion; we
don't need it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bf422f9d7e2e3454b2296b02202f4d5ae12644f6 15-Apr-2010 Douglas Gregor <dgregor@apple.com> Diagnose attempts to throw an abstract class type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
59fc2690e622e9db7f7a8f5036562b19d3bfb2b5 10-Apr-2010 Sebastian Redl <sebastian.redl@getdesigned.at> When a member pointer is dereferenced, the class it points into must be complete. Enforce this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9ab14541716928894821cf5d53d6b4c95ffdf3a3 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Make CXXScopeSpec invalid when incomplete, and propagate that into any
Declarator that depends on it. This fixes several redundant errors and bad
recoveries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c91cc66e92b084acd1fdbaa1c3c74242741b3d46 07-Apr-2010 John McCall <rjmccall@apple.com> Check access for the implicit calls to destructors that occur when we
have a temporary object in C++.

Also fix a tag mismatch that Doug noticed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1927b1f1d3194c1b9e7c3fa622542dd244f1a963 02-Apr-2010 Douglas Gregor <dgregor@apple.com> Minor cleanup with the ternary operator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
849b243d4065f56742a4677d6dc8277609a151f8 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
275313cbb0847f1f117f60d144d113804d4fa42d 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d0ebe080eee7c37e73754068b47fd90cc506e128 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
dec4c248f4c13c99d25e07f9e4e3f9f75c0772cb 27-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove unused static function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0fd8ff73630adab9a33123f23ef62fcf5c3cf326 26-Mar-2010 Douglas Gregor <dgregor@apple.com> When trying to determine whether one operand of a conditional
expression can be converted to the type of another, only apply the
lvalue-to-rvalue conversion to the type of the expression we're
converting, *not* the array-to-pointer or function-to-pointer
conversions. Fixes PR6595.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
b70cf44bf1b1956e0c6b98373c4f69b23afa0052 26-Mar-2010 Douglas Gregor <dgregor@apple.com> Switch semantic analysis of the conditional operator from using
CheckReferenceInit to using the new initialization sequence code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f0e0b17d0504d25b4673de015cf7401e2296323c 25-Mar-2010 Douglas Gregor <dgregor@apple.com> Kill off two more uses of Sema::CheckReferenceInit in favor of the new
initialization code. Exposed a bug where we were not marking an
implicit conversion as an lvalue when we were forming a call to a
conversion function whose return type is a reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
90c8c57bcd84083df85f76aac2aa62acb85eb077 18-Mar-2010 John McCall <rjmccall@apple.com> from code inspection, we were treating placement news with one argument as
non-placement news when selecting the corresponding operator delete; this is
fixed.
Access and ambiguity control for calls to operator new and delete. Also AFAICT



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d1b47bf17fde73fac67d8664bd65273742c00ecd 11-Mar-2010 John McCall <rjmccall@apple.com> Warn about comparing an unsigned expression with 0 in tautological ways.
Patch by mikem!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4 10-Mar-2010 John McCall <rjmccall@apple.com> Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
7b9a5aa7c0d76f577699d25ce6afe21ecccb60b7 02-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> During codegen assert that any copy assignment, destructor or constructor that
we need to synthesize has been marked as used by Sema.

Change Sema to avoid these asserts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
6d90870fe821a9b1a7822d3e28032042d03e5680 26-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.

This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b2cb1cbd727469e1567a6f2535895e6b64e12c35 25-Feb-2010 Douglas Gregor <dgregor@apple.com> When computing the composite pointer type for relational comparisons,
equality comparisons, and conditional operators, produce a composite
pointer type with the appropriate additional "const" qualifiers if the
pointer types would otherwise be incompatible. This is a small
extension (also present in GCC and EDG in a slightly different form)
that permits code like:

void** i; void const** j;
i == j;

with the following extwarn:

t.cpp:5:5: warning: comparison of distinct pointer types ('void **' and
'void const **') uses non-standard composite pointer type
'void const *const *' [-pedantic]
i == j;
~ ^ ~

Fixes PR6346, and I'll be filing a core issue about this with the C++
committee.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
edc90500b1d2587bf0b698fada14537d6741fddf 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Restore the invariant that a nested-name-specifier can only contain
class types, dependent types, and namespaces. I had previously
weakened this invariant while working on parsing pseudo-destructor
expressions, but recent work in that area has made these changes
unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a2e7dd2f4a50d835351153aee568d35ccc986310 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

p->T::~T()

where p has dependent type.

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

Fixes PR6380.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
fce46ee68f779e239826e69e45d01d4c8e5323ca 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Keep track of the location of the '~' in a pseudo-destructor expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
26d4ac97fb514bb60c2536eae6f203dc569159d9 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Retain complete source information for the type after the '~' in a
CXXPseudoDestructorExpr.

Update template instantiation for pseudo-destructor expressions to use
this source information and to make use of
Sema::BuildPseudoDestructorExpr when the base expression is dependent
or refers to a scalar type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b4a418fd23b6b66dff5379fecc50c09abe368edd 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Make sure that we have type source information for the scope type of a
pseudo-destructor expression. Attempt #1 at fixing the MSVC buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b57fb49b6569db9716877de6857e4de572edfb75 24-Feb-2010 Douglas Gregor <dgregor@apple.com> Split ActOnPseudoDestructorExpr into the part that interprets the
parser's data structures and the part that performs semantic analysis
and AST building, in preparation for improved template instantiation
of pseudo-destructor expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e0601ea1220348957dacec5f3dd0707837365290 24-Feb-2010 Douglas Gregor <dgregor@apple.com> Retain source information for the "type-name ::" in a
pseudo-destructor expression such as

p->T::~T()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
77549080fb7b9af31606b3c1b4830a94429fb1fd 24-Feb-2010 Douglas Gregor <dgregor@apple.com> ActOnPseudoDestructorExpr now performs all semantic analysis for
pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr
node directly. Currently, this only affects pseudo-destructor
expressions when they are parsed, but not after template
instantiation. That's coming next...

Improve parsing of pseudo-destructor-names. When parsing the
nested-name-specifier and we hit the sequence of tokens X :: ~, query
the actual module to determine whether X is a type-name (in which case
the X :: is part of the pseudo-destructor-name but not the
nested-name-specifier) or not (in which case the X :: is part of the
nested-name-specifier).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d4dca08d6b7ed2e3e3718caa6fd735960b135e9a 24-Feb-2010 Douglas Gregor <dgregor@apple.com> Rework parsing of pseudo-destructor expressions and explicit
destructor calls, e.g.,

p->T::~T

We now detect when the member access that we've parsed, e.g.,

p-> or x.

may be a pseudo-destructor expression, either because the type of p or
x is a scalar or because it is dependent (and, therefore, may become a
scalar at template instantiation time).

We then parse the pseudo-destructor grammar specifically:

::[opt] nested-name-specifier[opt] type-name :: ∼ type-name

and hand those results to a new action, ActOnPseudoDestructorExpr,
which will cope with both dependent member accesses of destructors and
with pseudo-destructor expressions.

This commit affects the parsing of pseudo-destructors, only; the
semantic actions still go through the semantic actions for member
access expressions. That will change soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
93649fdc5e0c46e26bcba06ad39aa80196d3df27 23-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement crazy destructor name lookup semantics differently in
C++98/03 and C++0x, since the '0x semantics break valid C++98/03
code. This new mess is tracked by core issue 399, which is still
unresolved.

Fixes PR6358 and PR6359.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ce056bcaa1c97b89a4b2de2112c62d060863be2b 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b10cd04880672103660e5844e51ee91af7361a20 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement support for parsing pseudo-destructor expression with a nested-name-specifier, e.g.,

typedef int Int;
int *p;
p->Int::~Int();

This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5e895a87d001ea2e97f5201d22cc5241992ca5a2 21-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Commiting a revert from dgregor of a bit of destructor logic until we can
figure out how not to break lots of code using this. See PR6358 and PR6359 for
motivating examples. FIXME's left in the code and the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b372b0ff1f1a0c6814163e0fe2f22f343bac87a8 18-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixed a crash specific to blocks in c++ uncovered by an internal
test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
124b878dba5007df0a268ea128a6ad8dc5dd2c5e 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Improve parsing and instantiation of destructor names, so that we can
now cope with the destruction of types named as dependent templates,
e.g.,

y->template Y<T>::~Y()

Nominally, we implement C++0x [basic.lookup.qual]p6. However, we don't
follow the letter of the standard here because that would fail to
parse

template<typename T, typename U>
X0<T, U>::~X0() { }

properly. The problem is captured in core issue 339, which gives some
(but not enough!) guidance. I expect to revisit this code when the
resolution of 339 is clear, and/or we start capturing better source
information for DeclarationNames.

Fixes PR6152.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ad7fe864862305c2f71e047cdf6706ef43aebdc0 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix leak in CXXNewExpr where the SubExprs array would get allocated directly using 'new[]' instead of the allocator associated with ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
838db383b69b9fb55f55c8e9546477df198a4faa 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
ae4c77dc8a77ee89e5b2de8003283249e38075c3 05-Feb-2010 Douglas Gregor <dgregor@apple.com> When we're parsing an expression that may have looked like a
declaration, we can end up with template-id annotation tokens for
types that have not been converted into type annotation tokens. When
this is the case, translate the template-id into a type and parse as
an expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
4a73ea9c4e87aa111901f3c27b08f0571b58a4cf 03-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Teach the allocation function overload handling to deal with templates, and
prevent a crash on templates when looking for an existing declaration of the
predefined global operators. This fixes PR5918.

Added an easy test case for the overload handling, but testing the crash is
a bit trickier. Created a new test that can use multiple runs with a define to
trigger which test case is used so we can test this type of issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a873dfc9e7314681bb37efd9ab185045de121e43 03-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement the lvalue-to-rvalue conversion where needed. The
lvalue-to-rvalue conversion adjusts lvalues of qualified, non-class
type to rvalue expressions of the unqualified variant of that
type. For example, given:

const int i;
(void)(i + 17);

the lvalue-to-rvalue conversion for the subexpression "i" will turn it
from an lvalue expression (a DeclRefExpr) with type 'const int' into
an rvalue expression with type 'int'. Both C and C++ mandate this
conversion, and somehow we've slid through without implementing it.

We now have both DefaultFunctionArrayConversion and
DefaultFunctionArrayLvalueConversion, and which gets used depends on
whether we do the lvalue-to-rvalue conversion or not. Generally, we do
the lvalue-to-rvalue conversion, but there are a few notable
exceptions:
- the left-hand side of a '.' operator
- the left-hand side of an assignment
- a C++ throw expression
- a subscript expression that's subscripting a vector

Making this change exposed two issues with blocks:
- we were deducing const-qualified return types of non-class type
from a block return, which doesn't fit well
- we weren't always setting the known return type of a block when it
was provided with the ^return-type syntax

Fixes the current Clang-on-Clang compile failure and PR6076.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6997aae42800d95a1189a6186af438feb19ecc54 31-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Switch expressions like T() and T(1,2) over to new-style initialization. I'm
not quite sure what we want to do about the AST representation; comments
welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
3005efeb131ccddcda9c332c83e49c32349e2aed 16-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Make the AST explicitly represent the cast of the first operand of a
pointer-to-member operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9d125033a9853f3b572a4c9e2f9e2d4e5e346973 15-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
de8ac49d32e85d4f65f3e9624f5e21d631babbb0 02-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of more unnecessary code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d2835b709e9929a97c09ea3e651342d0951ec982 02-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Get rid of some unnecessary code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5132655e4296b780672e9a96b46a740135073534 24-Dec-2009 Douglas Gregor <dgregor@apple.com> When transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
expressions (e.g., for template instantiation), just transform the
subexpressions and return those, since the temporary-related nodes
will be implicitly regenerated. Fixes PR5867, but I said that
before...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
154fe9812faddcd94568a64aee5f3cb0d47003d9 23-Dec-2009 Douglas Gregor <dgregor@apple.com> There is no such thing as typeinfo for a cv-qualified type. Assert
that this is true when mangling, then fix up the various places in
Sema and/or CodeGen that need to remove qualifiers. Addresses a
linking issue when building LLVM with Clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
765ccba920269eefbf572ec4bcd6ac7b6e9f9f77 23-Dec-2009 Douglas Gregor <dgregor@apple.com> Diagnose the use of incomplete types in C++ typeid expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f57f207a0fcf5fb7883597b57dd03faf952318dd 23-Dec-2009 Douglas Gregor <dgregor@apple.com> Remove cv-qualifiers from the argument to typeid

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6e790ab61bf4835944971955e84279112833ef0c 23-Dec-2009 Douglas Gregor <dgregor@apple.com> Allow the first parameter of operator new to be a cv-qualified
size_t. Also, fix an issue with initialization of parameters in calls,
where we weren't removing the cv-qualifiers on the parameter type
itself. Fixes PR5823.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
90f9382b3e97afa55e6aaaa4ab31c7473a8c7bb9 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d6542d8efcf8389c3aab764f9e29ac284e16eda6 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't use the location information but we did spend a bunch of time building faked-up TypeLocs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
18ef5e28a9a2677f8b1dce1fb2638d66e0a1621f 18-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:

- InitializationSequence now has a "C conversion sequence" category
and step kind, which falls back to
- Changed the diagnostics for returns to always have the result type
of the function first and the type of the expression second.
CheckSingleAssignmentConstraints to peform checking in C.
- Improved ASTs for initialization of return values. The ASTs now
capture all of the temporaries we need to create, but
intentionally do not bind the tempoary that is actually returned,
so that it won't get destroyed twice.
- Make sure to perform an (elidable!) copy of the class object that
is returned from a class.
- Fix copy elision in CodeGen to properly see through the
subexpressions that occur with elidable copies.
- Give "new" its own entity kind; as with return values and thrown
objects, we don't bind the expression so we don't call a
destructor for it.

Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
fc2844846e91398205fddc71196fe9dda04e105f 16-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.

feel free to chage the name to this lengthy argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
5ee56e95c3905d2e7bc403631b03865cdbdd8a42 16-Dec-2009 Anders Carlsson <andersca@mac.com> Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename Action::FullExpr to Action::MakeFullExpr to avoid name clashes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
99a2e600f9e2e51d3ce10fb6f27191677ac65b2a 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0ece491d8f62ce67f047491a6703fac0d3bd4ff4 15-Dec-2009 Anders Carlsson <andersca@mac.com> ShouldDestroyTemporaries? I don't think so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5501636b41318a9161d5f2b278e6e2c6a794e4d2 10-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Add support for finding composite type of twp objective-c pointers
in objective-c++ mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
eac813909b3ca1142ad186f6c6a1b1ae0dbf9378 09-Dec-2009 Anders Carlsson <andersca@mac.com> Look through using declarations when searching for allocation overloads.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
772fffa2349524dbcad59dbfec7b71a47be229e6 09-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5730: make sure to consistently call
PerformObjectArgumentInitialization from BuildCXXMemberCallExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
0cedfbdb44d865f38ec2de4bf92838f53c5607ec 08-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allow matching 0 with an objective-c pointer type
in objective-c++ mode. Fixes radar 7443165



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a93c934af4fbf97cbe8e649d82e68ccacfe57c95 07-Dec-2009 John McCall <rjmccall@apple.com> DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1f5f3a4d58a1c7c50c331b33329fc14563533c04 03-Dec-2009 Douglas Gregor <dgregor@apple.com> When we're building a CXXExprWithTemporaries, only include those
temporaries that are within our current evaluation context. That way,
nested evaluation contexts (e.g., within a sizeof() expression) won't
see temporaries from outer contexts. Also, make sure to push a new
evaluation context when instantiating the initializer of a variable;
this may be an unevaluated context or a potentially-evaluated context,
depending on whether it's an in-class initializer or not. Fixes PR5672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5ec02ae147760c32ad5b6fb0fec30ab3b3696778 02-Dec-2009 Anders Carlsson <andersca@mac.com> In Sema, whenever we think that a function is going to cause a vtable to be generated, we mark any virtual implicit member functions as referenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1bcee0a5a29981f8c78a8620d1c78841dbc5c348 02-Dec-2009 John McCall <rjmccall@apple.com> Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to
return null on overloaded results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6bc9768408d4b45e00350018b6e3540bc05d267d 02-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a code gen. crash synthesizing a destructor.
Fixes pr5660.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
d888962cff03b543fbe9ac6051ec6addf5b993b4 27-Nov-2009 Eli Friedman <eli.friedman@gmail.com> More work on ScalarExprEmitter::EmitCastExpr: for every cast kind, either
implement it explicitly or assert that it doesn't make sense for a scalar.
This caught a couple interesting issues: one, CK_BaseToDerivedMemberPointer
casts were getting silently miscompiled, and two, Sema was constructing some
strange implicit casts of type CK_UserDefinedConversion.

The change in SemaExprCXX makes sure the cast kinds are getting set correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2afce7248b7a362f1e322ad18e43484d575b9c9d 26-Nov-2009 Douglas Gregor <dgregor@apple.com> Refactor our handling of expression evaluation contexts, so that Sema
maintains a stack of evaluation contexts rather than having the parser
do it. This change made it simpler to track in which contexts
temporaries were created, so that we could...

"Forget" about temporaries created within unevaluated contexts, so
that we don't build a CXXExprWithTemporaries and, therefore, destroy
the integral-constness of our expressions. Fixes PR5609.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
99e9b4d172f6877e6ba5ebe75bb8238721f5e01c 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2fe168fc8979d9640e5babec17fa5cf11400088b 24-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Refactor argument collection of constructor calls using
the common routine.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4cd1c706c2bfd3533df563c3b7292c85c7143f31 24-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> More cleanup of argument call collection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
048f52aa9c9c78538fa369af2fc4b7031a55fa77 24-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Refactor collection of call arguments in common code.
Add support for variadic collection functions. More to do
here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a7605db78f39fa744da94faacee504e7601bb7c5 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Un-break instantiation of if statements with conditional variables

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8cfe5a784133d90bf329fd20801824a6f71bb8ca 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bc0e0781da778bd5eb41a810419912893ae20448 23-Nov-2009 Anders Carlsson <andersca@mac.com> Handle converting member pointers to bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
31658dfe908d07666e2820ced8443a9a1988f1eb 20-Nov-2009 Douglas Gregor <dgregor@apple.com> When checking the base object of a member access expression (b.foo,
b->foo), don't look through pointers unless we have an -> operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e44201a2841a38cc4165f630afd1709e7d9cd752 20-Nov-2009 Douglas Gregor <dgregor@apple.com> Don't build an explicit conversion to a reference type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f3c1f0e13614d384f77b2b1fdea386c74c407d0f 20-Nov-2009 Douglas Gregor <dgregor@apple.com> When we have a non-dependent expression such as

A::f

that occurs within a non-static member function with a type-dependent
"this", don't consider this to be a case for introduction of an
implicit "(*this)." to refer to a specific member function unless we
know (at template definition time) that A is a base class of *this.

There is some disagreement here between GCC, EDG, and Clang about the
handling of this case. I believe that Clang now has the correct,
literal interpretation of the standard, but have asked for
clarification (c++std-core-15483).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
498429fa24555ac1c849d8bc6a893d29bd3da4b6 19-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement new-operators with default args.
Fixes pr5547.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
19d70731388c4ed84d9270ddc5b1937218dcf572 18-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> ignore parens surounding the type when diagnosing
pointer-to-member cast types used in expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
05ebda9490e15f900edb2e5c690e067abcb37b2e 18-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch fixes a bug in misdiagnosing correct
use of pointer to data member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
03c5705a99a96a471b2868898ee9688a6721e02a 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Require the object type of a member access expression ("." or "->") to
be complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
a439e6f8f57eaeb0a02960d8f2d8ad124ba8b3d5 16-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Repair broken FindCompositePointerType. Correct early termination condition. Get CVR qualifiers from canonical types. Traverse collected qualifiers in reverse order on rebuilding the pointer, so that we don't swap inner and outer qualifiers. That last one fixes PR5509.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
78f74551815f8b23bc0f8acf87640e963fad07d4 15-Nov-2009 Anders Carlsson <andersca@mac.com> Factor finding a deallocation function for a record type out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
50724302e24d44a27e3bc45e7185a710d6eb3c2d 15-Nov-2009 Anders Carlsson <andersca@mac.com> If we find a deallocation function in the class scope, but it is a placement function we should not look for a deallocation function in the global scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
0ba63ea5be2c90ef62d1350ea4a0a0c415a785f1 14-Nov-2009 Anders Carlsson <andersca@mac.com> Diagnose ambiguity of operator delete and operator delete[]. Sebastian, please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
00b98c229ef28a5e82943bb23d09fb46d24ca381 12-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve source-location information for implicitly-generated member call expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a8ce9ecae8670fe8e189755b14d73fd84087e51f 08-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Fix use-after-free bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b7a86f5c5f9cdea126817247cc1fd3a7441388da 06-Nov-2009 Douglas Gregor <dgregor@apple.com> When we encounter a derived-to-base conversion when performing an
implicit conversion sequence, check the validity of this conversion
and then perform it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4c0cea2d9e933195f3af4aaf7bb5c65de80bdefc 06-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Minor cleanup of my last patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
b13c87f0c9705d91d5a3e134be9934c9ad531071 05-Nov-2009 John McCall <rjmccall@apple.com> Implement the conditional-operator part of -Wsign-compare. Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests. These seem to expose some oddities in the
types we're converting C++ enumerators to; in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.

Note to self: stop baiting Doug in my commit messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
43d8863df9d02f81acdf5f73fbc288f285bf442e 04-Nov-2009 Douglas Gregor <dgregor@apple.com> When starting a C++ member access expression, make sure to compute the
type of the object even when it is dependent. Specifically, this makes
sure that we get the right type for "this->", which is important when
performing name lookup into this scope to determine whether an
identifier or operator-function-id is a template name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6f26920dfa5020202016b18f52ccd120d9c7e518 03-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Remove previous patch for pr5296 due to further clarification
of value-initialization and trivial constructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2d1c21414199a7452f122598189363a3922605b1 03-Nov-2009 Douglas Gregor <dgregor@apple.com> Replace the code that parses member access expressions after "." or
"->" with a use of ParseUnqualifiedId. Collapse
ActOnMemberReferenceExpr, ActOnDestructorReferenceExpr (both of them),
ActOnOverloadedOperatorReferenceExpr,
ActOnConversionOperatorReferenceExpr, and
ActOnMemberTemplateIdReferenceExpr into a single, new action
ActOnMemberAccessExpr that does the same thing more cleanly (and can
keep more source-location information).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
02a24ee67c0a91bdb0db8a651d5748595652e670 03-Nov-2009 Douglas Gregor <dgregor@apple.com> Use ParseUnqualifiedId when parsing id-expressions. This eliminates
yet another copy of the unqualified-id parsing code.

Also, use UnqualifiedId to simplify the Action interface for building
id-expressions. ActOnIdentifierExpr, ActOnCXXOperatorFunctionIdExpr,
ActOnCXXConversionFunctionExpr, and ActOnTemplateIdExpr have all been
removed in favor of the new ActOnIdExpression action.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7a343142901f7f6bd1965051a24ae6a12c6f2148 01-Nov-2009 Douglas Gregor <dgregor@apple.com> Within a template, qualified name lookup can refer to a non-dependent type
that is not known to be a base class at template definition time due
to some dependent base class. Treat qualified name lookup that refers
to a non-static data member or function as implicit class member
access when the "this" type would be dependent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
6c813e1cb719a328f01619c3d44910be4e79e4d5 27-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Generate constructor for value-initialization cases, even if the
implementation technique doesn't call the constructor at that point.
DR302. Fixes pr5296.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ef78ac60136dc694ed383b3d0109224d97791d2f 26-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Add 'fixit' hint on mis-use of pointer-to-member
binary operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8ce35b095e8fca45e04c1bda14ed0548ce7536ad 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Remove the Skip parameter from GetTypeForDeclarator and dependents. Take the opportunity to improve an error message and fix PR4498.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f071e9b173dbaf97b00849c309a97c5aa3c49ae9 23-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose misuse of '.*' and '->*' operators during parse
instead of crashing in code gen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7a1f4cc8d5ce5813d8def23d6ec9783cb2f4450b 23-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Fixed a code gen bug (by fixing the AST) involving user-defined
pointer-to-member type conversion follwed by a pointer-to-member
standard conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e961afbf3f5604b043773192de77effa207cbe8c 22-Oct-2009 Douglas Gregor <dgregor@apple.com> Refactor our handling of implicit member reference expressions to get most of the logic out of BuildDeclarationNameExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
dd62b15665a4144c45c1f7c53665414ad5f7f4f2 20-Oct-2009 Douglas Gregor <dgregor@apple.com> Parse a simple-template-id following a '~' when calling a destructor, e.g.,

t->~T<A0, A1>()

Fixes PR5213.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4fa26848acfbec29a748df4b58d6d654027b49c7 18-Oct-2009 Anders Carlsson <andersca@mac.com> When building a cast argument, make sure to bind the result to a temporary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
089407be3fb616fb1246f2aee29b8a9c58ec7807 17-Oct-2009 Douglas Gregor <dgregor@apple.com> When type-checking a C++ "new" expression, don't type-check the actual
initialization if any of the constructor/initialization arguments are
type-dependent. Fixes PR5224.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
93034ca3d025e948ddfcdd78868957efc70741a7 16-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Implement derived-to-base AST/code gen. There is a
FIXME in CGCXX.cpp that I would like Anders to
take a look at.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
de699e551062f2b20e66decd4de87ee0804b67cc 14-Oct-2009 Anders Carlsson <andersca@mac.com> The operator loc points to the operator, not the function decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
dced226e37f7c2c31c25d06c514f29b610fe2a54 11-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Test exception spec compatibility on return type and parameters.

Along the way, use RequireCompleteType when testing exception spec types.
Separate all the ugly spec stuff into its own file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2c7588f1260c6655cfb73126b695d2f79ae170bb 10-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement the core checking for compatible exception specifications in assignment and initialization.

The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet.
This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
432887fadd6bf87a6985906d6cef356b1f617d84 30-Sep-2009 John McCall <rjmccall@apple.com> Spare the processors of those poor wretches who have no choice but to write
unbounded chains of operator-> delegations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c4e8321deb2bd83f734a09749460050f40ec51d1 30-Sep-2009 John McCall <rjmccall@apple.com> Detect operator-> chains of arbitrary length. Use a terrible data structure
to strike fear into the hearts of CPUs everywhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4a4e345a8bf749b5462a127ecfb1f90d4a9d6ba7 30-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> self-referecing operator '->' member function was causing
infinit recursion. This patch fixes it. [13.3.1.2]-p2



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5d64e5b6bc03462e8b7d0cd804565829afb1b508 30-Sep-2009 Douglas Gregor <dgregor@apple.com> Find operators new/delete in base classes. FIXME -= 2;


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1070c9f7acc889336be6f80c70dc1b32622cc83d 29-Sep-2009 Douglas Gregor <dgregor@apple.com> The C++ delete expression strips cv-qualifiers from the pointed-to type. My previous fix eliminated this behavior, so bring it back again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9091656e423f2354e53b2b3baa95b3eb5510badc 29-Sep-2009 Douglas Gregor <dgregor@apple.com> Handle C++ delete expressions when the overloaded delete operator is a
"usual deallocation function" with two arguments. CodeGen will have to
handle this case specifically, since the value for the second argument
(the size of the allocated object) may have to be computed at run
time.

Fixes the Sema part of PR4782.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
b3c477415f49668be7a770c8f44c217b42e3ccd3 25-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Refixed pr5050 per Anders comment. Test case enhanced
per Doug's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7498e50aea92276fdd8aceb7076b4156ee6dbab4 25-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fix the AST tree so ir-gen can do the conversion via copy construction.
Fixed pr5050.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
51bebc83e74001ed0412d82aadae9eb247fee2d4 23-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> This patch addresses a few issues related to 8.5.3 [dcl.init.ref]
It uses a recent API to find inherited conversion functions to do
the initializer to reference lvalue conversion (and removes a FIXME).
It issues the ambiguity diagnostics when multiple conversions are found.
WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ac18b2e3af8d0c5304f74e362a1d4207363e4c94 23-Sep-2009 Anders Carlsson <andersca@mac.com> Cast the array size expr to a size_t

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
7adb10fa317cd7eacb0959f775e77353d4f24ad1 16-Sep-2009 Douglas Gregor <dgregor@apple.com> When implicitly declaring operators new, new[], delete, and delete[],
give them the appropriate exception specifications. This,
unfortunately, requires us to maintain and/or implicitly generate
handles to namespace "std" and the class "std::bad_alloc". However,
every other approach I've come up with was more hackish, and this
standard requirement itself is quite the hack.

Fixes PR4829.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8b915e7048b20b0feb60ec90c365a8eb68360cd4 16-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> 1) don't do overload resolution in selecting conversion
to pointer function for delete expression. 2)
Treat type conversion function and its 'const' version
as identical in building the visible conversion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f652793d4d32cc71b5ee2167069cbd363baa75de 15-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Perform overload resolution when selecting a pointer conversion
function for delete of a class expression and issue
good diagnostic when result is ambiguous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
aac6e3a6bbca5952263648e70cbd56d9f89cf4a2 15-Sep-2009 Anders Carlsson <andersca@mac.com> If a conversion operator exists in a base class, make sure to cast the object to that base class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f6c213a931f8eedf91531f3204cc828f18466fd5 15-Sep-2009 Anders Carlsson <andersca@mac.com> When performing an user defined conversion sequence, perform the initial standard conversion sequence. This lets us remove a workaround in SemaCompleteConstructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
626c2d6bc8fe57078dec2a8974994bc92ee0e1e5 15-Sep-2009 Anders Carlsson <andersca@mac.com> Revert for real.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7f5d03a9bec7488290209f5a1077fbce56f4206f 15-Sep-2009 Anders Carlsson <andersca@mac.com> Whoops, didn't mean to commit this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4c5fad3f73957420b0410f7370cbd63b09f32a1c 15-Sep-2009 Anders Carlsson <andersca@mac.com> Only reuse an already existing ImplicitCastExpr if the cast kinds are the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
283e4d59b8fe63e93f20b6ffb3a623a4f60a85ea 14-Sep-2009 Anders Carlsson <andersca@mac.com> If a function call returns a reference, don't bind it to a temporary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
6250921cc5bd3493a0d99fa2c32ec9716767a965 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> More work toward having an access method for visible
conversion functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
5346278f81930e7fd0545bbbb2fc217c6921b109 11-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build visible conversion function list lazily and make its
first use in calling the conversion function on delete statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
043cad21b78c6b02597cdc7b6ead32388e27ebc7 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Diagnose VLAs as an error in C++.

Also, treat the GNU __null as an integral constant expression to match
GCC's behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9cd9f3f55d22f34f1d69db8bfc2735c4e1e082c3 10-Sep-2009 Douglas Gregor <dgregor@apple.com> For a C++ delete expression where the operand is of class type that
has a single conversion to pointer-to-object type, implicitly convert
to that pointer-to-object type (C++ [expr.delete]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
39da0b8145eaec7da7004f9b3645c5c9f4f63b1d 10-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0aebc81e02397a5987aaa8e8c7acbdb01a31d7c3 09-Sep-2009 Anders Carlsson <andersca@mac.com> If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f47511ab0575b8c4752e33cdc4b82a84dcc4d263 08-Sep-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr now takes a MultiExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ec8e5ea799412a9d2aac4814c9c62cc32b3faad5 05-Sep-2009 Anders Carlsson <andersca@mac.com> Pass the ConstructLoc to BuildCXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a78c5c34fbd20fde02261c3f3e21933cd58fcc04 04-Sep-2009 Douglas Gregor <dgregor@apple.com> If a destructor is referenced or a pseudo-destructor expression is
formed without a trailing '(', diagnose the error (these expressions
must be immediately called), emit a fix-it hint, and fix the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a71d819bb8f50c28938db0f2867d3fb6e2ce5910 04-Sep-2009 Douglas Gregor <dgregor@apple.com> Implement AST, semantics, and CodeGen for C++ pseudo-destructor
expressions, e.g.,

p->~T()

when p is a pointer to a scalar type.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
34374e6ce5710a91c478f69379220ff20c3e7f15 04-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to instantiate destructors used to destruct
base and data members when they are needed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c68afe2cbe7f875a9243c411077602fb5f5dc74b 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2dd078ae50ff7be1fb25ebeedde45e9ab691a4f0 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Rewrite of our handling of name lookup in C++ member access expressions, e.g.,

x->Base::f

We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.

We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.

I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b633c4ee622df81d4572ef57dac54ebed69bb9bf 01-Sep-2009 Anders Carlsson <andersca@mac.com> Add a CK_FunctionToPointerDecay cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f328a2857d6dc397ec7a304b07d40893891f7f98 31-Aug-2009 Douglas Gregor <dgregor@apple.com> Add parsing for references to member function templates with explicit
template argument lists, e.g., x.f<int>().

Semantic analysis will be a separate commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a6f0f9d589a06737707fe914e06bd6d4bfae0997 31-Aug-2009 Douglas Gregor <dgregor@apple.com> Support explicit C++ member operator syntax, from James Porter!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
31976591dee494994f2546c72c23e1e35a9c1555 29-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for code gen. for c-style cast which ends in
using class's conversion functions [12.3.2-p2]


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7fe5d72fbc8605b60d42d32394248ea76cf763a0 29-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> path to ir-gen 12.3.1 Conversion by constructor



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
4fc7ab364110d6ad1c10dd38dbeb0597fed7e2f5 28-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen related patch for type conversion
with class type conversion methods. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
e7624a75b74633ff9c54d1c60ace2707fe298008 27-Aug-2009 Anders Carlsson <andersca@mac.com> Add a BuildCXXTemporaryObjectExpr and use it so default arguments will be instantiated correctly for temporary object expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bb60a509f47a95a4ed9366ec1fc65850da654d38 27-Aug-2009 Anders Carlsson <andersca@mac.com> In ActOnCXXTypeConstructExpr, check that the type is complete and non-abstract before creating any expressions. This assures that any templates are instantiated if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
d497ba7ca5e52cd4523822055abd5e89dfec1800 27-Aug-2009 Anders Carlsson <andersca@mac.com> Remove the PrintType argument from RequireCompleteType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9099ff0cf91ac9e0b2d5a142807fa384ce842fc4 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> AST for conversion by conversion functions. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2cf738f1944d1cc724ea7561b84440a3a1059e45 26-Aug-2009 Anders Carlsson <andersca@mac.com> More support for pseudo dtors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e9f42087aabfdb6b2afc35c7e38ac65da063b409 26-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> update to CXXFunctionalCastExpr to support ir-gen for
type convesions of class objects [class.conv]. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3aa4ca439da54bc71def778126c9cf10c7d910ed 26-Aug-2009 Anders Carlsson <andersca@mac.com> Address some of Doug's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ec7738776ba68576db5d8316af399d1f983245ee 26-Aug-2009 Anders Carlsson <andersca@mac.com> Parsing of pseudo-destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
da3f4e2dd5938145f132be237a2ed5914cc86702 25-Aug-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr now returns an OwningExprResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
20b3e9918cf7d7845c920baabc4fb2f1ac0ee1d2 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement support for equality comparisons (!=, ==) of member
pointers, by extending the "composite pointer type" logic to include
member pointer types.

Introduce test cases for member pointer comparisons, including those
that involve the builtin operator candidates implemented earlier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
a5d82000f7b173a0a5ce34dc8c09a03f98d9e439 21-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e8661906d49ef6c9694a9cc845ca62a85dbc016d 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use Sema's LocInfoType to pass and preserve type source info through the Parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a1d5662d96465f0fddf8819d245da4d19b892eff 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d67c4c31a83773a4280bdf8d8b5097a1ce92488e 16-Aug-2009 Anders Carlsson <andersca@mac.com> Store the delete operator for delete expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
9abf2aedae7538cfd85f3ff0898a6d14385c8e36 16-Aug-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
089c2602ebaccdda271beaabdd32575b354d4d09 16-Aug-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr doesn't need to take an ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e955e7221a9cf335a089f548c01e854dca95ca99 11-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Check whether a tag was defined in a C++ condition declaration using GetTypeForDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
824957643238ea1712b966deee9c65043ac6ffea 08-Aug-2009 Anders Carlsson <andersca@mac.com> Use CastExpr::CK_ArrayToPointerDecay and fix an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cdb61979755c1c0699c1ee25eede9a50bf94d29b 08-Aug-2009 Anders Carlsson <andersca@mac.com> More CastKind work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
1cf9ff87ee235ad252332a96699abdb32bd6facb 06-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Set and use Elidable in elimination of copy ctors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b2c352ed5586cf869a5dad87a528b9ac000d2fae 05-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to improve ir-gen for constructors with default argument
expressions and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
50d62d1b4a98adbc83de8f8cd1379ea1c25656f7 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
a83f7ed3de1ce98d633dfb6bb223bb7711893dce 03-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Minor renaming/refactoring. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
ef0cb8e62d090ad88a01ca9fa89e48d7416f0ac7 29-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make functional-style casts emit correct messages, and fix a crash-on-invalid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
58f9f2c884af6b72d036b746a016d8031d31cb7a 14-Jul-2009 Steve Naroff <snaroff@apple.com> Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).

I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
771d7c374327d8f55a77431d78eae7b89f16a499 11-Jul-2009 Anders Carlsson <andersca@mac.com> Remove some unused code from an experiment that I didn't like.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
3292d5ce510061ea50152f53b7ab462b622176f4 07-Jul-2009 Anders Carlsson <andersca@mac.com> Some (most) type trait expressions require that the argument passed in is a complete type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f8d736ca54191c3cf9395ca41ed9b03777774321 27-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed MarcDestructorReferenced -> MarkDestructorReferenced


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8d2b35630d4afc474b766eeab1f1bef469cf633a 27-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to mark destructors when they are used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2e01cdacc5ecab5a14329405dc481a18ac3ccfdc 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Eliminate DeclPtrTy() arguments to ActOnDeclarator that are just a very, very weird way to pass "false". No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ac7610dad6653bad02dd42de198ca358b6fb1f1d 22-Jun-2009 Douglas Gregor <dgregor@apple.com> Rework the way we track which declarations are "used" during
compilation, and (hopefully) introduce RAII objects for changing the
"potentially evaluated" state at all of the necessary places within
Sema and Parser. Other changes:

- Set the unevaluated/potentially-evaluated context appropriately
during template instantiation.
- We now recognize three different states while parsing or
instantiating expressions: unevaluated, potentially evaluated, and
potentially potentially evaluated (for C++'s typeid).
- When we're in a potentially potentially-evaluated context, queue
up MarkDeclarationReferenced calls in a stack. For C++ typeid
expressions that are potentially evaluated, we will play back
these MarkDeclarationReferenced calls when we exit the
corresponding potentially potentially-evaluated context.
- Non-type template arguments are now parsed as constant
expressions, so they are not potentially-evaluated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f54741e6465692d3bdbae974ac3beeeab92e4a95 16-Jun-2009 Anders Carlsson <andersca@mac.com> Handle temporaries in default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
99ba36de0d5b34624e74e77bffa73929617976cb 05-Jun-2009 Anders Carlsson <andersca@mac.com> Improvements to CXXExprWithTemporaries in preparation for fixing a bug with default arguments that have temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d958389d52170be1c6dee93031d34b13809b786b 31-May-2009 Anders Carlsson <andersca@mac.com> Make sure to copy back arguments that can be changed by FindAllocationOverload. This fixes placement new. (Sebastian, please review).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
fc27d268cb34cbb8d186c6ad7cc043d41581ce71 31-May-2009 Anders Carlsson <andersca@mac.com> Fix an off by one error when trying to perform copy initialization of operator new and operator delete arguments. Sebastian, please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
75bbb97f6e413633f2537e42f90547ccac559fde 31-May-2009 Anders Carlsson <andersca@mac.com> Forgot the implementation. Thanks Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
88eaf075c56672761b72cc50957db4a35bf24ebd 31-May-2009 Anders Carlsson <andersca@mac.com> Clean up the newly added C++ AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a19e66d448223ccb1570a37d8838480011c8ecf8 31-May-2009 Anders Carlsson <andersca@mac.com> It's OK for a full expr to be null. This fixes the failing test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
f5dcd3885865c931fdbd16f36237af70743d53c6 30-May-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl needs to take a full expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
860306ee303d4c60068b76cca7cfc7b60323f8b7 30-May-2009 Anders Carlsson <andersca@mac.com> Add the newly created temporary to the ExprTemporaries stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ff6b3d64c9f07155f1414411b8451d7bf8937c62 30-May-2009 Anders Carlsson <andersca@mac.com> Stop using CXXTempVarDecl and use CXXTemporary instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8e587a15da6d3457a418239d5eb4146fcbd209f3 30-May-2009 Anders Carlsson <andersca@mac.com> Remove VarDecl from CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
def11996fb558f58a8a7ae87aa95eb0bb96bfe4a 30-May-2009 Anders Carlsson <andersca@mac.com> Add Sema::MaybeBindToTemporary which takes an expression and (if needed) wraps it in a CXXBindTemporaryExpr. Use this when creating CXXTemporaryObjectExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3433cf7dfda405bf51bba914a338adf645a87e3b 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ "new" expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d81e6ca6e378c3996a139066a5c4b7fc1869630c 20-May-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression type, CXXUnresolvedConstructExpr, to
describe the construction of a value of a given type using function
syntax, e.g.,

T(a1, a2, ..., aN)

when the type or any of its arguments are type-dependent. In this
case, we don't know what kind of type-construction this will be: it
might construct a temporary of type 'T' (which might be a class or
non-class type) or might perform a conversion to type 'T'. Also,
implement printing of and template instantiation for this new
expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr,
our existing tests cover template instantiation of this new expression
node.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7c3e8a1ddb19030a7937e02afd59607c40026348 19-May-2009 Anders Carlsson <andersca@mac.com> Create CXXConstructExpr calls for arguments passed to functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bde200858679c58ca1d7acdc4a75de3bef210b20 17-May-2009 Anders Carlsson <andersca@mac.com> Fix instantiate-function-1.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
165a0a07c0a91f8d61ee3737b62e7f376bb7e1c7 17-May-2009 Anders Carlsson <andersca@mac.com> Implement Sema::ActOnFinishFullExpr and create a CXXExprWithTemporaries node if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
9afe1308ed19dffc281dca5cfbe521826754980f 14-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> When there are any member new operators, global versions aren't looked up at all.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3f5b61c394f4f205bcb4d316eb2a7a0a68b8af86 14-May-2009 Douglas Gregor <dgregor@apple.com> Implement explicit instantiations of member classes of class templates, e.g.,

template<typename T>
struct X {
struct Inner;
};

template struct X<int>::Inner;

This change is larger than it looks because it also fixes some
a problem with nested-name-specifiers and tags. We weren't requiring
the DeclContext associated with the scope specifier of a tag to be
complete. Therefore, when looking for something like "struct
X<int>::Inner", we weren't instantiating X<int>.

This, naturally, uncovered a problem with member pointers, where we
were requiring the left-hand side of a member pointer access
expression (e.g., x->*) to be a complete type. However, this is wrong:
the semantics of this expression does not require a complete type (EDG
agrees).

Stuart vouched for me. Blame him.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
4f149632ed57f3136f330d230100b9787d938a3e 07-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a FIXME in new expression checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
de866f3d4d2653ae59a54e41e6616a6c23c63cc8 05-May-2009 Douglas Gregor <dgregor@apple.com> Turns out that Sebastian already implemented the logic to compute the
composite pointer type, and his is better! Updated relational- and
equality-operator checking accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
0c6db9417dceeb082296c4e097be5de3ee1c5eb7 04-May-2009 Douglas Gregor <dgregor@apple.com> Implement support for comparing pointers with <, >, <=, >=, ==, and !=
in C++, taking into account conversions to the "composite pointer
type" so that we can compare, e.g., a pointer to a derived class to a
pointer to a base class.

Also, upgrade the "comparing distinct pointer types" from a warning to
an error for C++, since this is clearly an error. Turns out that we
hadn't gone through and audited this code for C++, ever.

Fixes <rdar://problem/6816420>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
972041f45bdf8df7ea447221292d7827466ba94b 27-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Improve validation of C++ exception handling: diagnose throwing incomplete types and jumps into protected try-catch scopes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
a5cd2cdd11179387aa01f43cb6d6af440e006553 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make reference class unification in conditional expressions check for validity of the conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
eaaebc7cf10dc1a2016183a262ad3256bc468759 25-Apr-2009 Chris Lattner <sabre@nondot.org> This is a pretty big cleanup for how invalid decl/type are handle.
This gets rid of a bunch of random InvalidDecl bools in sema, changing
us to use the following approach:

1. When analyzing a declspec or declarator, if an error is found, we
set a bit in Declarator saying that it is invalid.
2. Once the Decl is created by sema, we immediately set the isInvalid
bit on it from what is in the declarator. From this point on, sema
consistently looks at and sets the bit on the decl.

This gives a very clear separation of concerns and simplifies a bunch
of code. In addition to this, this patch makes these changes:

1. it renames DeclSpec::getInvalidType() -> isInvalidType().
2. various "merge" functions no longer return bools: they just set the
invalid bit on the dest decl if invalid.
3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator
methods now set invalid on the decl returned instead of returning an
invalid bit byref.
4. In SemaType, refering to a typedef that was invalid now propagates the
bit into the resultant type. Stuff declared with the invalid typedef
will now be marked invalid.
5. Various methods like CheckVariableDeclaration now return void and set the
invalid bit on the decl they check.


There are a few minor changes to tests with this, but the only major bad
result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this
next.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
09c4abb1057f0eb53a9c2b5c2f22b1472362156e 24-Apr-2009 Anders Carlsson <andersca@mac.com> Add an ASTContext parameter to CXXTemporaryObjectExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
26de54983e7977fad615c94012f2f67d0d1cf404 24-Apr-2009 Anders Carlsson <andersca@mac.com> Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
9bebfadb807aba0bc272197aff1cb4b2284c00a6 19-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Bring member pointer operands of the conditional operator to a common type. We're getting there ...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d1bd7fc4cd88f8790c56620d22560e19717f468a 19-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Another piece of the conditional operator puzzle. We'll want to use FindCompositePointerType in some other places, too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
76458501a8963fa11b91c9337a487de6871169b4 17-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement lvalue test for conditional expressions.
Add a few commented lines to the test case that point out things that don't work yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
8dcb29db8483d4dcaeeecc0e653b642b0a41cd2c 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Fix a few isObjectTypes that really need to be isIncompleteOrObject
types; add another use of RequireCompleteType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e7450f5dbd5bed63b8ef9db86350a8fc3db011e8 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Make sure to use RequireCompleteType rather than testing for
incomplete types. RequireCompleteType is needed when the type may be
completed by instantiating a template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
8211effbd3abc5948a5d6924c87e72323016a376 24-Mar-2009 Anders Carlsson <andersca@mac.com> More work on diagnosing abstract classes. We can now handle cases like

class C {
void g(C c);

virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
11f21a08cd40caec93e088c404bbf3136917a035 23-Mar-2009 Anders Carlsson <andersca@mac.com> More improvements to abstract type checking. Handle arrays correctly, and make sure to check parameter types before they decay.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b9bbe49f513080b3307e88bdee0d383f4b8c1d4e 23-Mar-2009 Anders Carlsson <andersca@mac.com> It's an error to try to allocate an abstract object using new.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
f53597fb16142bdb4a66901f8c0b768db4f2a548 15-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
ba49817c5b9f502602672861cf369fd0e53966e8 13-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for several more kinds of expressions:
- C++ function casts, e.g., T(foo)
- sizeof(), alignof()

More importantly, this allows us to verify that we're performing
overload resolution during template instantiation, with
argument-dependent lookup and the "cached" results of name lookup from
the template definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
86447ec25fa34aa3c2f48ebc49ec09bc1f03f002 09-Mar-2009 Douglas Gregor <dgregor@apple.com> Rename DiagnoseIncompleteType to RequireCompleteType, and update the documentation to reflect the fact that we can instantiate templates here

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
2850784bda09416fc7e9d57f5baa36c9351c757c 26-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make more AST nodes and semantic checkers dependent-expression-aware.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2224f84658fb9b3725a31f2680edb64ae73bf705 25-Feb-2009 Douglas Gregor <dgregor@apple.com> C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
00e68e2cc5ce37cb95beb801cae73c0d1e9dda37 09-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Update new expression to make use of Declarator::getSourceRange().
References are not objects; implement this in Type::isObjectType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7c8bd60da52c3280f2fac27977efd74cd290b131 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Move CheckPointerToMemberOperands to SemaExprCXX.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
ebc07d57be9e0722b4b9c66625e1fca43dcc2ee0 03-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Allow taking the address of data members, resulting in a member pointer.
Pointers to functions don't work yet, and pointers to overloaded functions even less. Also, far too much illegal code is accepted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
500d3297d2a21edeac4d46cbcbe21bc2352c2a28 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
3e8ffd2e96e7842245f1ae0cb631eba75da1a6f7 29-Jan-2009 Steve Naroff <snaroff@apple.com> Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInContext().

The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert.

The plan is to eventually deprecate both of these functions. For now, I'm focused on performance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
133147d2d31bdcd6943635f80e77d78d2504148f 28-Jan-2009 Steve Naroff <snaroff@apple.com> Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
20c6b3b85e186cd52d5d99489132d71d498159eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
4ec339f43c0cae2678334850c90926bea10999c7 19-Jan-2009 Douglas Gregor <dgregor@apple.com> Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type).
Fixes <rdar://problem/6500531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cd965b97cfac7b7a53a835810ec2bc2ac7a9dd1a 18-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a few expression actions to smart pointers.
These actions are extremely widely used (identifier expressions and literals); still no performance regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
66b947fdf9104b53d7e8caa8f71ee0c0e3fe1521 16-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix <rdar://problem/6502934>. We were creating an ImplicitCastExpr
with reference type (it should be an lvalue with non-reference type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
506ae418eb171d072f2fb4f6bc46d258b52cbf97 16-Jan-2009 Douglas Gregor <dgregor@apple.com> Part one of handling C++ functional casts. This handles semantic
analysis and AST-building for the cases where we have N != 1
arguments. For N == 1 arguments, we need to finish the C++
implementation of explicit type casts (C++ [expr.cast]).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
eb11cd078ba8682bbb9b082f8f6ead8be5c98581 14-Jan-2009 Douglas Gregor <dgregor@apple.com> Refactor name lookup.

This change refactors and cleans up our handling of name lookup with
LookupDecl. There are several aspects to this refactoring:

- The criteria for name lookup is now encapsulated into the class
LookupCriteria, which replaces the hideous set of boolean values
that LookupDecl currently has.

- The results of name lookup are returned in a new class
LookupResult, which can lazily build OverloadedFunctionDecls for
overloaded function sets (and, eventually, eliminate the need to
allocate member for OverloadedFunctionDecls) and contains a
placeholder for handling ambiguous name lookup (for C++).

- The primary entry points for name lookup are now LookupName (for
unqualified name lookup) and LookupQualifiedName (for qualified
name lookup). There is also a convenience function
LookupParsedName that handles qualified/unqualified name lookup
when given a scope specifier. Together, these routines are meant
to gradually replace the kludgy LookupDecl, but this won't happen
until after we have base class lookup (which forces us to cope
with ambiguities).

- Documented the heck out of name lookup. Experimenting a little
with using Doxygen's member groups to make some sense of the Sema
class. Feedback welcome!

- Fixes some lingering issues with name lookup for
nested-name-specifiers, which now goes through
LookupName/LookupQualifiedName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
fc767615bc67d3a7587b1fb2e0494c32c9dbd7a5 14-Jan-2009 Ted Kremenek <kremenek@apple.com> FunctionDecl::setParams() now uses the allocator associated with ASTContext to allocate the array of ParmVarDecl*'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
482b77d1cb4ca08391d1f749436f092a4cc24427 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
64b45f7e0d3167f040841ac2920aead7f080730d 05-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> PODness and Type Traits

Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5cc3709b843c799e268f944b7bf9dbdc79cefe8d 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Fix misguided type selection

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
798d119415323ebcd029ffe1e0fb442a4ca8adbb 13-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Some utilities for using the smart pointers in Actions, especially Sema. Convert a few functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
caaf29a08761b14fbe42a29080c22dd6961056d1 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Added a warning when referencing an if's condition variable in the
"else" clause, e.g.,

if (int X = foo()) {
} else {
if (X) { // warning: X is always zero in this context
}
}

Fixes rdar://6425550 and lets me think about something other than
DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
898574e7496ba8fd76290079d3a9d06954992734 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7f6623914e779e41eb3d85f9a2dc3affea5de1e8 04-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Code cleanup in new handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
636a7c42d42800f69caadcdea433312fd642a4b3 04-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix some diagnostics and enhance test cases. Now tests member new and ambiguous overloads.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
b5a57a69e5fdac6dd9a92be717e279486c4a0128 03-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Overload resolution for the operator new function. Member version is still untested.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
cee63fbf0e64ac526582312bf8cf33263fc5c16e 02-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Handle new by passing the Declaration to the Action, not a processed type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
4c5d320a7581f4b80b151630c91cea5727fa9923 21-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d3a94e24ddf3fb90de76b17bd176d9ed61e66f2c 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove another old-school Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
572af49cc0052931e7b06902d99c72f04b75704e 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove the type_info identifier cache. Compared to the cost
of doing the lookup_decl, the hash lookup is cheap. Also,
typeid doesn't happen enough in real world code to worry about
it.

I'd like to eventually get rid of KnownFunctionIDs from Sema
also, but today is not that day.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
487a75ab300552e42afa45b8199133f838a40e5f 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Some tweaks suggested by Argiris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
dcd5ef12488e4c7ea844327835896ca86b609a97 19-Nov-2008 Chris Lattner <sabre@nondot.org> remove one more old-style Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
10c4262aeb5212375e3fa64e76887bd9bcc79924 18-Nov-2008 Douglas Gregor <dgregor@apple.com> As threatened previously: consolidate name lookup and the creation of
DeclRefExprs and BlockDeclRefExprs into a single function
Sema::ActOnDeclarationNameExpr, eliminating a bunch of duplicate
lookup-name-and-check-the-result code.

Note that we still have the three parser entry points for identifiers,
operator-function-ids, and conversion-function-ids, since the parser
doesn't (and shouldn't) know about DeclarationNames. This is a Good
Thing (TM), and there will be more entrypoints coming (e.g., for C++
pseudo-destructor expressions).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
e94ca9e4371c022329270436b3dd77adc4ddfa8f 18-Nov-2008 Douglas Gregor <dgregor@apple.com> Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names.
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator.

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
2def48394f6d48bde0dec2b514193c2b533265b5 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
c42e1183846228a7fa5143ad76507d6d60f5c6f3 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ 'typeid' parsing and sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
26d85b197257bfa15cd8b10dfef9e741e19c4fc5 05-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Move named cast sema functions to their own file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
4e84935b299f2572601419692f1f2e84def685e7 05-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> A small error message improvement and some comment cleanup for static_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
7ad8390f7992ab7f19b1460c5f0b9d96f165c4e9 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
796da18402f286b897782a298ae3b20c459c102e 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Create a new expression class, CXXThisExpr, to handle the C++ 'this' primary expression. Remove CXXThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
d5a56f0e5d8f495a471fe739195f86756e22de48 02-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Source ranges for named cast diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp
9d293dfc0ad7c44ae0b5eb9517f1ed8c8d8b7ff7 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Improve our handling of (C++) references within Clang. Specifically:
- Do not allow expressions to ever have reference type
- Extend Expr::isLvalue to handle more cases where having written a
reference into the source implies that the expression is an lvalue
(e.g., function calls, C++ casts).
- Make GRExprEngine::VisitCall treat the call arguments as lvalues when
they are being bound to a reference parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
49badde06e066d058d6c7fcf4e628a72999b65a9 27-Oct-2008 Douglas Gregor <dgregor@apple.com> Refactor the expression class hierarchy for casts. Most importantly:
- CastExpr is the root of all casts
- ImplicitCastExpr is (still) used for all explicit casts
- ExplicitCastExpr is now the root of all *explicit* casts
- ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
- CXXFunctionalCastExpr inherits from ExplicitCastExpr
- CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
- Added classes CXXStaticCastExpr, CXXDynamicCastExpr,
CXXReinterpretCastExpr, and CXXConstCastExpr to

Also, fixed returned-stack-addr.cpp, which broke once when we fixed
reinterpret_cast to diagnose double->int* conversions and again when
we eliminated implicit conversions to reference types. The fix is in
both testcase and SemaChecking.cpp.

Most of this patch is simply support for the renaming. There's very
little actual change in semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
2f639b9f3c6b081f076d2ac6d75115ce44bfa249 24-Oct-2008 Douglas Gregor <dgregor@apple.com> Semantic analysis for C++ reinterpret_cast and const_cast. Patch by Sebastian Redl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.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/SemaExprCXX.cpp
4021a84eb1634a1e18bb3c258274477e8fdcd861 07-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use getCustomDiagID() instead of specifying the diagnostic in the 'DiagnosticKinds.def' file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
77a52233f7c0f162672652051bfe78b65ad4f789 12-Sep-2008 Douglas Gregor <dgregor@apple.com> Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
5921093cf1c2e9a8bd1a22b6f612e551bae7476b 10-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement Sema support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
987a14bf5883ef6e5d07f1c83eb6d41a8212a78c 22-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add support for C++'s "type-specifier ( expression-list )" expression:

-The Parser calls a new "ActOnCXXTypeConstructExpr" action.
-Sema, depending on the type and expressions number:
-If the type is a class, it will treat it as a class constructor. [TODO]
-If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node
-If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
12bc692a78582f1cc32791325981aadcffb04c5e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> Minor #include cleaning
- Drop TokenKinds.h from Action.h
- Move DeclSpec.h from Sema.h into individual Sema .cpp files


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
d9f6910f4ef37c0e8eeee2a01287d9572c3176ef 10-Aug-2008 Chris Lattner <sabre@nondot.org> rename PreDefinedExpr -> PredefinedExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
07952324dda0e758c17f8bc3015793c65c51c48c 01-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add Sema support for C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExprCXX.cpp