History log of /external/clang/lib/Sema/SemaExpr.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 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/SemaExpr.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

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

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
45c2eed19c012d8b5e686aedb28cdbb36347fee5 27-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195303:
------------------------------------------------------------------------
r195303 | rsmith | 2013-11-20 17:53:02 -0800 (Wed, 20 Nov 2013) | 4 lines

PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. This is a different, and more
targeted, approach than that in r194540.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f41e20ae7a36806d148f0e50fa8e9339b5d759a4 19-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195126:
------------------------------------------------------------------------
r195126 | joerg | 2013-11-19 05:38:38 -0800 (Tue, 19 Nov 2013) | 2 lines

Revert r194540, it breaks various C++ programs.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
758c4d86bb9b2298374fce5b3ca4a35f953f2d2e 14-Nov-2013 Joey Gouly <joey.gouly@arm.com> [OpenCL] Make sure we put string literals in the constant address space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f2febe6b5e9213fb4d97e1d4f9b47166be89afad 13-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. Patch by Ivan A. Kosarev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3efb8e866d6d5c1ad9f59f8f27058c7a6ebedd3e 07-Nov-2013 Benjamin Kramer <benny.kra@googlemail.com> Add parens for || in && in assert. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
bafa74f360cb3ec82fa8c688845330f491d167fd 07-Nov-2013 David Majnemer <david.majnemer@gmail.com> [-fms-extensions] Add support for __FUNCDNAME__

Summary:
Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled
function name via __FUNCDNAME__. This implementation is very naive and
unoptimized, it is expected that __FUNCDNAME__ would be used rarely in
practice.

Reviewers: rnk, rsmith, thakis

CC: cfe-commits, silvas

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5423746bbd6128027ad16de77718d507cedc97a9 02-Nov-2013 Richard Trieu <rtrieu@google.com> Change the other -Wtautological-compare warnings to not trigger in template
specializations. Also switch to -Wuninitialized for a test case that depended
on a warning firing in template specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d9553e35e1e3af6fc4ca817b169dc796a5b54bcd 01-Nov-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC. Define a new cc1 flag
-fobjc-subscripting-legacy-runtime which is off
by default and on only when using ObjectiveC
legacy runtime. Use this flag to allow
array and dictionary subscripting and disallow
objectiveC pointer arithmatic in ObjectiveC
legacy runtime. // rdar://15363492


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7784d5166243ddd388b3a4c1f7bde7db6bbac4f2 26-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> Minor performance improvement to not do unnecessary work
in my last patch. // rdar://14989999


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4e7f00c74487bca84993a1f35d0a26a84ed2b1a0 25-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC: under -Wunused-property-ivar warn if property's
backing warning is not used in one of its accessor methods.
// rdar://14989999


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
02debf605cd904edac8dceb196e5f142ce3d14eb 25-Oct-2013 Jordan Rose <jordan_rose@apple.com> Add -Wstring-plus-char, which warns when adding char literals to C strings.

Specifically, this warns when a character literal is added (using '+') to a
variable with type 'char *' (or any other pointer to character type). Like
-Wstring-plus-int, there is a fix-it to change "foo + 'a'" to "&foo['a']"
iff the character literal is on the right side of the string.

Patch by Anders Rönnholm!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d33c40838367ffcc3206a7120a0ce32922b66d8 25-Oct-2013 David Majnemer <david.majnemer@gmail.com> Sema: Do not allow lambda expressions to appear inside of constant expressions

We would previously not diagnose this which would lead to crashes (on
very strange code).

This fixes PR17675.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
645526c3e42170e356f792b1bc0ac2acb65c26c4 23-Oct-2013 David Majnemer <david.majnemer@gmail.com> Parse: Disable delayed template parsing for constexpr functions

Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing. However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.

Instead, simply disable delayed template parsing for constexpr function
templates. This largely reverts the changes made in r191484 but keeps
it's unit test.

This fixes PR17661.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a36ddbe8bf0c7269656f554288703afbb2b0a034 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc6509175e1ce5cc1b48d1b97ac8d23d8b74167c 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename some functions for consistency.

Every other function in Redeclarable.h was using Decl instead of Declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8690cee218a59d3f6eaca17b9c25d03a52ebacaa 15-Oct-2013 Reid Kleckner <reid@kleckner.net> ms-compat: Fix taking the address of a member of a dependent base

If unqualified id lookup fails while parsing a class template with a
dependent base, clang with -fms-compatibility will pretend the user
prefixed the name with 'this->' in order to delay the lookup. However,
if there was a unary ampersand, Sema::ActOnDependentIdExpression() will
create a DependentDeclRefExpr, which is not what we wanted at all. Fix
this by building the CXXDependentScopeMemberExpr directly instead.

In order to be fully MSVC compatible, we would have to defer all
attempts at name lookup to instantiation time. However, until we have
real problems with system headers that can't be parsed, we'll put off
implementing that.

Fixes PR16014.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
edb5fdfb732d9b05f7f3c3248edea7b14331f4a4 15-Oct-2013 David Majnemer <david.majnemer@gmail.com> Sema: Consider it an error to apply __builtin_offsetof to a member in a virtual base

icc 13 and g++ 4.9 both reject this while we would crash.

Fixes PR17578.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
730a2c2f915d81f6cdb53918d8b155ee25b8175f 11-Oct-2013 Douglas Gregor <dgregor@apple.com> Diagnose by-copy captures of abstract classes.

Fixes <rdar://problem/14468891>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6e04a849fec62c15968f8a1c94ac380f5eae7b99 10-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Taking the address of a dtor is illegal per C++ [class.dtor]p2.

Emit a proper error instead of crashing in CodeGen. PR16892.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d69f37b5822420e3c3a1b2e875b122aca8248533 08-Oct-2013 Alp Toker <alp@nuanti.com> Make InstantiatingTemplate depth checks clearer

The bool conversion operator on InstantiatingTemplate never added value and
only served to obfuscate the template instantiation routines.

This replaces the conversion and its callers with an explicit isInvalid()
function to make it clear what's going on at a glance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b328e29173d15baf3f44ccdc9c310ee741caaaf7 07-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add support for WG21 N3599 (literal operator template for strings) as a GNU
extension. The GCC folks have decided to support this even though the standard
committee have not yet approved this feature.

Patch by Hristo Venev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2815d9c9989c52ac9c5687253bc544fac9d32c7f 07-Oct-2013 NAKAMURA Takumi <geek4civic@gmail.com> Sema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, IsBlock, and IsLambda. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
02d831c7e7dc1517abed9cc96abdfb937af954eb 07-Oct-2013 Faisal Vali <faisalv@yahoo.com> Refactor tryCaptureVar using ExtractMethod. No functionality change.

In chicago, Doug had requested that I go ahead and commit the refactor as a separate change, if all the tests passed.

Lets hope the buildbots stay quiet.

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9b93f206d89dbf86805b610b417bb874f7f446e8 01-Oct-2013 Eli Friedman <eli.friedman@gmail.com> Tweak changes in r186464 to avoid a crash.

Currently, IR generation can't handle file-scope compound literals with
non-constant initializers in C++.

Fixes PR17415 (the first crash in the bug).

(We should probably change (T){1,2,3} to use the same codepath as T{1,2,3} in
C++ eventually, given that the semantics of the latter are actually defined by
the standard.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
39edfeb34b0b0b8033179e35cf13cd5d95d56fa8 28-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Switch from putting init capture VarDecls in the surrounding DeclContext to
putting them in the call operator's DeclContext. This better matches the
language wording and avoids some cases where code gets confused by them for
namespace-scope lambdas and the like.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d0629eb137d06bf6d46a430abdb7fa044909298b 27-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Variable templates: handle instantiation of static data member templates
appropriately, especially when they appear within class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
54679205de1a348f410d03ce4b331b56b21dce49 27-Sep-2013 David Majnemer <david.majnemer@gmail.com> Sema: Respect -fdelayed-template-parsing when parsing constexpr functions

Functions declared as constexpr must have their parsing delayed in
-fdelayed-template-parsing mode so as not to upset later template
instantiation.

N.B. My reading of the standard makes it seem like delayed template
parsing is at odds with constexpr. We may want to make refinements in
other places in clang to make constexpr play nicer with this feature.

This fixes PR17334.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e67ebbed3dfdd6950b1d56eab7cb66b9a209381b 26-Sep-2013 Kaelyn Uhrain <rikka@google.com> Fix a bug in the typo correction replacement location.

I noticed the wrong text was being replaced with the correction while
working on expanding the "namespace-aware" typo correction to include
classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a41c97a5d1912ffd184381d269fd8e5a25ee5e59 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
414a1bdbdaf250e0488589f12865c8961831b65d 18-Sep-2013 Hal Finkel <hfinkel@anl.gov> Add the intrinsic __builtin_convertvector

LLVM supports applying conversion instructions to vectors of the same number of
elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to
cause such instructions to be generated when using builtin vector types.

C-style casting on vectors is already defined in terms of bitcasts, and so
cannot be used for these conversions as well (without leading to a very
confusing set of semantics). As a result, this adds a __builtin_convertvector
intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is
intended to aid the creation of vector intrinsic headers that create generic IR
instead of target-dependent intrinsics (in other words, this is a generic
_mm_cvtepi32_ps). As noted in the documentation, the action of
__builtin_convertvector is defined in terms of the action of a C-style cast on
each vector element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3312933e244d820c1c6fec83c4c0c0f67f42d25b 16-Sep-2013 Wei Pan <wei.pan@intel.com> Handle PredefinedExpr with templates and lambdas

Summary:

- lambdas, blocks or captured statements in templates were not
handled which causes codegen crashes.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0f115b3fc02be7b0d9c8bcefc36139ccb669f62e 13-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Fix regression from r190427.

<rdar://problem/14970968>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
812d6bcbd13190e6e5c2c915bf1499038d56b44b 10-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d7d94dc922075d131d51a4974f60c840e0e96cfb 06-Sep-2013 David Tweed <david.tweed@arm.com> OpenCL allows the (pre/post)-(increment/decrement) operator on integer vector types,
so allow that case and add appropriate tests.

Patch by Ruiling Song!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c5716c30d91212dcdea5e5c9b9ded9ed2439a09 06-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Add self-comparison warnings for fields.

This expands very slightly what -Wtautological-compare considers to be
tautological to include implicit accesses to C++ fields and ObjC ivars.
I don't want to turn this into a full expression-identity check, but
these additions seem pretty well-contained, and maintain the theme
of checking for "x == x".

<rdar://problem/14431127>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
86164e8f51fa89a3ec904607c3848dc4a21b12cf 05-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Note when a decl is used in AST files.

When an AST file is built based on another AST file, it can use a decl from
the fist file, and therefore mark the "isUsed" bit. We need to note this in
the AST file so that the bit is set correctly when the second AST file is
loaded.

This patch introduces the distinction between setIsUsed() and markUsed() so
that we don't call into the ASTMutationListener callback when it wouldn't
be appropriate.

Fixes PR16635.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
82b9709b6e6d4e9d0aa292c2c1cfd31e8fffb8f5 03-Sep-2013 David Blaikie <dblaikie@gmail.com> Reference extension is weird/surprising and unnecessary, let's not do that.

Found by Chris Wailes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bb0b6149611073bf83f13595f6155a27e05d408d 02-Sep-2013 Jin-Gu Kang <jaykang10@imrc.kist.re.kr> the call to UsualArithmeticConversions should come after the call to CheckVectorOperands on CheckConditionalOperands function. This problem caused compilation error with test17 on "test/CodeGen/ext-vector.c".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
15b2674896371ac2a0fe707b538a1a29dec9d8e4 26-Aug-2013 Wei Pan <wei.pan@intel.com> Handle predefined expression for a captured statement

- __func__ or __FUNCTION__ returns captured statement's parent
function name, not the one compiler generated.

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

Reviewed by bkramer



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
24146975f1af8c1b4b14e8545f218129d0e7dfeb 22-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Split isFromMainFile into two functions.

Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't. Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
28bdbf0861fefb33474fddbda1d3c66ee29be2af 21-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Use the right type for PredefinedExpr when it's in a lambda.

1. We now print the return type of lambdas and return type deduced functions
as "auto". Trailing return types with decltype print the underlying type.
2. Use the lambda or block scope for the PredefinedExpr type instead of the
parent function. This fixes PR16946, a strange mismatch between type of the
expression and the actual result.
3. Verify the type in CodeGen.
4. The type for blocks is still wrong. They are numbered and the name is not
known until CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
556ef7f8b833d20caf31b80f8c1b5cad2e32ef10 20-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16727: don't try to evaluate a potentially value-dependent expression when
checking for missing parens in &&/|| expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d67097ad41f4c2fe82ebce3f587e06498f1bd71 17-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2f835ca26aad970be44227d40269db45e73d0a08 16-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Don't allow unary negation on scoped enums.

PR16900.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c99b90edb85ea0a5be6ce567a8c0147b76534e15 14-Aug-2013 Eli Friedman <eli.friedman@gmail.com> sizeof(void) etc. should be a hard error in C++.

PR16872.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
834c058cb6b57465e60a4590afdab86c4ea6921d 09-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Omit llvm:: before ArrayRef, as we have using llvm::ArrayRef in include/clang/Basic/LLVM.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fbbdc5daee4dc772d4d137080890fd79492592d6 08-Aug-2013 Richard Trieu <rtrieu@google.com> Emit an error for enum increments and decrements in C++ mode.
Fixes PR16394.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ef4579cda09b73e3d4d98af48201da25adc29326 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0e2189791acf7fcec4f1b32af24efb2d363f30c1 05-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++'s restrictions on the type of an expression passed to a vararg
function: it can't be 'void' and it can't be an initializer list. We give a
hard error for these rather than treating them as undefined behavior (we can
and probably should do the same for non-POD types in C++11, but as of this
change we don't).

Slightly rework the checking of variadic arguments in a function with a format
attribute to ensure that certain kinds of format string problem (non-literal
string, too many/too few arguments, ...) don't suppress this error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8b051ce94e59c37cfe09e34fe2bf15c037cbbdb3 05-Aug-2013 David Majnemer <david.majnemer@gmail.com> Sema: Don't assume a nested name specifier holds a type

Sema::PerformObjectMemberConversion assumed that the Qualifier it was
given holds a type. However, the specifier could hold just a namespace.
In this case, we should ignore the qualifier and not attempt to cast to
it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3d672e4aa51fcf231de5d5283b1ee3f6c6a79e8c 01-Aug-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC ARC: finishing off issuing error when
retainable pointer is passed to an audited CF function
expecting CF type. // rdar://14569171


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
01ad048b70508bf21174cd25512b57f87b7c57a6 31-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC ARC: Do not issue bridge cast diagnostic when
passing a retainable object arg to a CF audited function
expecting a CF object type. Issue a normal type mismatch
diagnostic. This is wip // rdar://14569171


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
650c6056cc3d3fb569cdd34d6c527ee15e05dc8a 31-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC arc: minor refactoring in my last patch
to avoid future false positives. // rdar://14569171


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2651b7a44d1db7c2a9fe70689e0708394c343a7e 31-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC arc: Introduce a new initialization kind
for parameters passed to CF audited functions
to be used for better diagnostics. Current set but
unused. // rdar://14569171


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
89310785fe44470da0c1c1eefa54ad9c6dae8e78 31-Jul-2013 Richard Trieu <rtrieu@google.com> Fix a crasher than manifests when typo correction suggests a function template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
34f3bcf7f2907f618f7a10d919bda47e53db60dd 26-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Partially revert r186903.

It turns out that Plum Hall depends on us not emitting an error on
integer literals which fit into long long, but fit into
unsigned long long. So C99 conformance requires not conforming to C99. :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b3da613977f6b77dee2b382eeff5713168a4ca18 23-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Integers which are too large should be an error.

Switch some warnings over to errors which should never have been warnings
in the first place. (Also, a minor fix to the preprocessor rules for
integer literals while I'm here.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4e16bf2511ab335cfcf74a273332ad7c00a786de 23-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Don't emit open-paren fixit without close-paren.

getLocForEndOfToken() isn't guaranteed to succeed; if it doesn't, make sure
we do something sane.

Fixes PR16673. I'm not sure how to write a testcase for this short of grepping
through the diagnostic output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a5e660188a3c654cf0c88ed1093b28207e870b2b 20-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make IgnoreParens() look through ChooseExprs.

This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes <rdar://problem/14438917>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c4ef9485252c6a408acb70aac5a153dcd9d860c7 19-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Clean up diagnostics for inheriting constructors.

No new diagnostics, just better wording and notes pointing at more
relevant locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8df014e2b173f9c0595f87480d59caaf8979fca3 17-Jul-2013 Jean-Daniel Dupas <devlists@shadowlab.org> Improve idiomatic-parentheses by checking method family instead of relying on the selector name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
21cde050b64eefbb5094af67985752eee42d00e2 17-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++. This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
27ec2d0acc51fc661f3ab10693565f5f0653b294 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Make CheckAddressOfOperand a member of Sema so it can be reused by
__builtin_addressof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6c4898b6ff23950cddca6948ef3fa0dd1848f6f1 09-Jul-2013 Kaelyn Uhrain <rikka@google.com> Attempt typo correction for function calls with the wrong number of arguments.

Combined with typo correction's new ability to apply global/absolute nested
name specifiers to possible corrections, cases such as in PR12287 where the
desired function is being shadowed by a lexically closer function with the
same name but a different number of parameters will now include a FixIt.

On a side note, since the test for this change caused
test/SemaCXX/typo-correction.cpp to exceed the typo correction limit for
a single file, I've included a test case for exceeding the limit and added
some comments to both the original and part two of typo-correction.cpp
warning future editors of the files about the limit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
09bddcf8c0ce4cc2f2a18e050e971539e8a396f8 08-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix Sema for compares with _Atomic vars.

Use UsualArithmeticConversions unconditionally in analysis of
comparisons and conditional operators: the method performs
the usual arithmetic conversions if both sides are arithmetic, and
usual unary conversions if they are not. This is just a cleanup
for conditional operators; for comparisons, it fixes the issue that
we would try to check isArithmetic() on an atomic type.

Also, fix GetExprRange() in SemaChecking.cpp so it deals with variables
of atomic type correctly.

Fixes PR15537.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b9240e058bf3451685df73fc8ce181b3046e92b 05-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl& for function arguments instead of SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c77039e1b6b81a4ec448ef7b57c894fefaa8433a 05-Jul-2013 David Majnemer <david.majnemer@gmail.com> Sema: Call IgnoreParens fewer times in CheckAddressOfOperand


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ee0a47998ca7db5d31291a397aca38219d3dfd7d 05-Jul-2013 Craig Topper <craig.topper@gmail.com> Add typedefs for Densemaps containing SmallVectors to avoid repeating the SmallVector size when creating iterators for the DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
09d19efaa147762f84aed55efa7930bb3616a4e5 04-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
14b7673b341c0c9edc719754b9c2faafac21fe36 04-Jul-2013 Richard Trieu <rtrieu@google.com> Improve -Wlogical-not-parentheses to catch when the not is applied to an enum.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b2567ddad9a1142d7224e5363029d640e8f4f59d 03-Jul-2013 Kaelyn Uhrain <rikka@google.com> Allow typo correction to try removing nested name specifiers.

The removal is tried by retrying the failed lookup of a correction
candidate with either the MemberContext or SS (CXXScopeSpecifier) or
both set to NULL if they weren't already. If the candidate identifier
is then looked up successfully, make a note in the candidate that the
SourceRange should include any existing nested name specifier even if
the candidate isn't adding a different one (i.e. the candidate has a
NULL NestedNameSpecifier).

Also tweak the diagnostic messages to differentiate between a suggestion
that just replaces the identifer but leaves the existing nested name
specifier intact and one that replaces the entire qualified identifier,
in cases where the suggested replacement is unqualified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
07369dde9d72213bf8a48288cd8b29999af9a40c 01-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix mangling for block literals.

Blocks, like lambdas, can be written in contexts which are required to be
treated as the same under ODR. Unlike lambdas, it isn't possible to actually
take the address of a block, so the mangling of the block itself doesn't
matter. However, objects like static variables inside a block do need to
be mangled in a consistent way.

There are basically three components here. One, block literals need a
consistent numbering. Two, objects/types inside a block literal need
to be mangled using it. Three, objects/types inside a block literal need
to have their linkage computed correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
02a01faadb2771f4ca5174ed3e798bec0afb96c4 28-Jun-2013 John McCall <rjmccall@apple.com> Ensure that debugger calls to signature-less functions default to
passing arguments in the fixed style.

We have an abstraction for deciding this, but it's (1) deep in
IR-generation, (2) necessarily tied to exact argument lists, and
(3) triggered by unprototyped function types, which we can't
legitimately make in C++ mode. So this solution, wherein Sema
rewrites the function type to an exact prototype but leaves the
variadic bit enabled so as to request x86-64-like platforms to
pass the extra variadic info, is very much a hack, but it's one
that works in practice on the platforms that LLDB will support
in the medium term --- the only place we know of where it's a
problem is instance methods in Windows, where variadic functions
are implicitly cdecl. We may have a more abstracted base on which
to build a solution by then.

rdar://13731520

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
642038d7c5855b54afbca298631da93b7889d4a5 27-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7348454025693dd20a411c2bcaabd4460cb87559 26-Jun-2013 Joerg Sonnenberger <joerg@bec.de> Don't use unnamed local enums as template arguments.
Fixes -Werror bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
86648b13eb01c0565de7264b27799ba81c7ad060 26-Jun-2013 Faisal Vali <faisalv@yahoo.com> Fix PCH bug with member templates of local classes in nontemplate functions.

As noted by Richard in the post:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130624/082605.html, the following code should not add an entry
into PendingLocalImplicitInstantiations, since local instantiations
should only occur within the context of other instantiations:

int foo(double y) {
struct Lambda {
template<class T> T operator()(T t) const { return t; };
} lambda;
return lambda(y);
}

Hence the attached code does the following:
1) In MarkFunctionReferenced, check if ActiveInstantiations.size()
is non-zero before adding to PendingLocalImplicitInstantiations.
2) In InstantiateFunctionDefinition, we swap out/in
PendingLocalImplicitInstantiations so that only those
pending local instantiations that are added during the instantiation
of the current function are instantiated recursively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ea943145787bd286256b72c3e658db27674cfc44 24-Jun-2013 Ted Kremenek <kremenek@apple.com> Tweak -Wdeprecated-objc-pointer-introspection to have a subgroup for results of using -performSelectorXXX.

-performSelector: and friends return a value that is boxed as an Objective-C
pointer. Sometimes it is an Objective-C pointer, sometimes it isn't.
Some clients may wish to silence this warning based on calling
this method.

Fixes <rdar://problem/14147304>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
12df246d6dea2ee1f92c186f922f1afcf499647a 24-Jun-2013 Reid Kleckner <reid@kleckner.net> [AST] Introduce a new DecayedType sugar node

The goal of this sugar node is to be able to look at an arbitrary
FunctionType and tell if any of the parameters were decayed from an
array or function type. Ultimately this is necessary to implement
Microsoft's C++ name mangling scheme, which mangles decayed arrays
differently from normal pointers.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e2a90b8bb054fc8de6c115a31bfadf7868bcf0c3 22-Jun-2013 Richard Trieu <rtrieu@google.com> Extend -Wnon-pod-varargs to check calls made from member pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0538f0e9200df56974b5a71bc276dbce456e9781 22-Jun-2013 Richard Trieu <rtrieu@google.com> Extend -Wnon-pod-varargs to more cases, such as function pointers as return
types and function pointer arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f462b0152f10eed0b989b07bcf457b6fb0d83bdb 20-Jun-2013 Richard Trieu <rtrieu@google.com> Extend -Wnon-pod-varargs to check calls made from function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f67129ab204e2884d674075d74e8ffe1f17f67e3 19-Jun-2013 Reid Kleckner <reid@kleckner.net> [Windows] Fix __declspec(property) when the getter returns a ref

This fixes an issue when parsing atlbase.h.

Patch by Will Wilson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ddb5a3926d715ab4354ca36117679e3f4d5d3e21 14-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Unify return type checking for functions and ObjC methods. Move all the
random checks for ObjC object return types to SemaType.cpp.

Fixes issue with ObjC method type checking reported on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
93f32da079874f70857af42eb9be382f307d4f1e 14-Jun-2013 Chandler Carruth <chandlerc@gmail.com> Fix the warning for divide by zero to be a bit more robust. ;]

Previously, it only ever fired for zeros which formed null pointers.
Now, hilariously, in C++98 this was almost anything. Including tricks
like warning on the divisor in this code:

typedef char c3[3];
size_t f(c3* ptr) {
return (sizeof(ptr) / sizeof(*ptr)) / (size_t)(!(sizeof(ptr) % sizeof(*ptr)));
}

Why the RHS of the outer divide is a null pointer constant is a sordid
tale of sorrow. Anyways, the committee fixed this for C++11 and onward
as part of core isssue 903, and Richard recently implemented this fix
causing the warning to go away here (and elsewhere).

This patch restores the warning here and adds it for numerous other
somewhat obvious gaffes:

int g(int x) {
return x / (int)(0.0);
}

The patch is essentially just using the full power of our constant
folding in Clang to produce the warning, but insisting that it must fold
to an *integer* which is zero so that we don't get false positives
anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
01e0b1f24af250da37faf953cd82626b360622f6 11-Jun-2013 David Majnemer <david.majnemer@gmail.com> Implement DR61: Address of ambiguous bound methods should be disallowed

DR61 affirms that expressions containing unresolved member access should
be disallowed when performing "address of" operations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4017d7378b1544e6c43f0ad857e6c18c3957efe0 11-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi]: Issue better warning when nsstring literal is missing
the '@'. PR16287 and // rdar://14106083


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0567a79130a251bf464ce21ecf3f8b9fb5207900 10-Jun-2013 Reid Kleckner <reid@kleckner.net> Use FPT::getArgTypes() instead of manually building ArrayRefs

Made significantly easier with git-clang-format.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ef0e4e6eda13c2dcd6d4d43f1750d1d73202d16a 10-Jun-2013 Richard Trieu <rtrieu@google.com> Add a new warning, -Wlogical-not-parentheses, to -Wparentheses.

This warning triggers on the logical not of a non-boolean expression on the
left hand side of comparison. Often, the user meant to negate the comparison,
not just the left hand side of the comparison. Two notes are also emitted,
the first with a fix-it to add parentheses around the comparison, and the other
to put parenthesis around the not expression to silence the warning.

bool not_equal(int x, int y) {
return !x == y; // warn here
}

return !(x == y); // first fix-it, to negate comparison.

return (!x) == y; // second fix-it, to silence warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cc28eff95644b247d2cac643ff83ff7db7d8adb2 08-Jun-2013 Jin-Gu Kang <jaykang10@imrc.kist.re.kr> Added a type checking which handle the case of an ext vector and integral scalar


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b165fddec068f75c876063bb1a8e724cf12b3039 07-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> fix up recogtion of block pointer type in my last patch.
// rdar://14085217.
e-This line, and those below, will be ignored--

M lib/Sema/SemaExpr.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7523606638128e19d6993c356851fd3e88078201 07-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> blocks: fixes an ast bug when block pointer variable
is evaluated in a condition expression and then
dereferenced to envoke the block. This is
pr15663 and I applied a slight variation of the
patch with a test case. (patch is from
Arthur O'Dwyer). Also // rdar://14085217


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
211c8ddb5b500ed84833751363d0cfe1115f4dd3 05-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Model temporary lifetime-extension explicitly in the AST. Use this model to
handle temporaries which have been lifetime-extended to static storage duration
within constant expressions. This correctly handles nested lifetime extension
(through reference members of aggregates in aggregate initializers) but
non-constant-expression emission hasn't yet been updated to do the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
942dfe2e4d75f9d7c6f2e73eadac6fa659a5f853 24-May-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Don't diagnose an empty lookup for inline assmebly. This happen
for labels in inline assembly that aren't in the lookup tables. E.g.,

__asm {
a:
jmp a
}

rdar://13983623


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
569b4ad6506960f1a7f191107c185cb1566a7fbb 21-May-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C arc: don't count use of __weak
variables when they are used in such unevaluated
contexts as __typeof, etc. // rdar://13942025


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
2521dfa550805e3ca50c63eccbb185e6720a4041 17-May-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C++ (and c++) Sema: Patch fixes a sema crash when gnu’s ?: extension
is used for Objective-C++’s dictionary subscripting. This is done by filtering
out all placeholder types before check on lowering of the
common expression is done. // rdar://1374918.
Reviewed by John McCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d8e9646bc000bab521ce52ed294209a92298cef 16-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> First pass of semantic analysis for init-captures: check the initializer, build
a FieldDecl from it, and propagate both into the closure type and the
LambdaExpr.

You can't do much useful with them yet -- you can't use them within the body
of the lambda, because we don't have a representation for "the this of the
lambda, not the this of the enclosing context". We also don't have support or a
representation for a nested capture of an init-capture yet, which was intended
to work despite not being allowed by the current standard wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7247c88d1e41514a41085f83ebf03dd5220e054a 15-May-2013 David Blaikie <dblaikie@gmail.com> Use only explicit bool conversion operator

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

DiagnosticBuilder kept its implicit conversion operator owing to the
prevalent use of it in return statements.

One bug was found in ExprConstant.cpp involving a comparison of two
PointerUnions (PointerUnion did not previously have an operator==, so
instead both operands were converted to bool & then compared). A test
is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix
(adding operator== to PointerUnion in LLVM).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
181e3ecc0907ae0103586a9f4db52241995a8267 13-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Cleanup handling of UniqueExternalLinkage.

This patch renames getLinkage to getLinkageInternal. Only code that
needs to handle UniqueExternalLinkage specially should call this.

Linkage, as defined in the c++ standard, is provided by
getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.

Most places in the compiler actually want isExternallyVisible, which
handles UniqueExternalLinkage as internal.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
15f92bad58c8650b1306729744b1a1230197497a 10-May-2013 Hans Wennborg <hans@hanshq.net> Add support for __wchar_t in -fms-extensions mode.

MSVC provides __wchar_t. This is the same as the built-in wchar_t type
from C++, but it is also available with -fno-wchar and in C.

The commit changes ASTContext to have two different types for this:

- WCharTy is the built-in type used for wchar_t in C++ and __wchar_t.

- WideCharTy is the type of a wide character literal. In C++ this is
the same as WCharTy, and in C it is an integer type compatible with
the type in <stddef.h>.

This fixes PR15815.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
524387ae3dfc0c4cf2b095f83f9e47aa549b7e55 09-May-2013 Ben Langmuir <ben.langmuir@intel.com> CodeGen for CapturedStmts

EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function. This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function. It is based
on GenerateBlockFunction, but is much simpler. The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
993f43f24d7a45a5cd4678a3316b0852261fc5d4 06-May-2013 John McCall <rjmccall@apple.com> Grab-bag of bit-field fixes:

- References to ObjC bit-field ivars are bit-field lvalues;
fixes rdar://13794269, which got me started down this.
- Introduce Expr::refersToBitField, switch a couple users to
it where semantically important, and comment the difference
between this and the existing API.
- Discourage Expr::getBitField by making it a bit longer and
less general-sounding.
- Lock down on const_casts of bit-field gl-values until we
hear back from the committee as to whether they're allowed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2624b8157660902303bfce5551cfdd38272d01e5 06-May-2013 Jordan Rose <jordan_rose@apple.com> Fix representation of compound literals for C++ objects with destructors.

Previously, this compound literal expression (a GNU extension in C++):

(AggregateWithDtor){1, 2}

resulted in this AST:

`-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
`-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
`-CXXBindTemporaryExpr [...] 'struct AggregateWithDtor' (CXXTemporary [...])
`-InitListExpr [...] 'struct AggregateWithDtor'
|-IntegerLiteral [...] 'int' 1
`-IntegerLiteral [...] 'int' 2

Note the two CXXBindTemporaryExprs. The InitListExpr is really part of the
CompoundLiteralExpr, not an object in its own right. By introducing a new
entity initialization kind in Sema specifically for compound literals, we
avoid the treatment of the inner InitListExpr as a temporary.

`-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
`-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
`-InitListExpr [...] 'struct AggregateWithDtor'
|-IntegerLiteral [...] 'int' 1
`-IntegerLiteral [...] 'int' 2

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
10f6f065456a2cfb6c2ab5dfedefb930e5e52e9d 06-May-2013 John McCall <rjmccall@apple.com> Require the containing type to be complete when we see
__alignof__ of a field.

This problem can only happen in C++11.

Also do some petty optimizations.

rdar://13784901

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
5543169296beeb183b9c9392debc774fcf493eeb 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
60e141e1f87211ca831de6821003d80fe20a06f3 04-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement most of N3638 (return type deduction for normal functions).
Missing (somewhat ironically) is support for the new deduction rules
in lambda functions, plus PCH support for return type patching.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c95d413660756c474bc8f97e5b32edc7ddff3850 04-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
a07a6c3e756d0a6a5baa2cad9d165f79f0fb1b42 01-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15884: In the 'taking the address of a temporary' extension, materialize the
temporary to an lvalue before taking its address. This removes a weird special
case from the AST representation, and allows the constant expression evaluator
to deal with it without (broken) hacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
443adec6b06878be2180bf389ec88a68e9b5997c 30-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C (mostly arc): Under ARC, we often have unneeded qualifiers
in the diagnostics. Remove them when reporting incompatible
Objective-C pointer types. // rdar://13752880.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
97aea95f46f27ff0927faa72baa7fe2b0bce1d2d 29-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix an assertion failure / accepts-invalid in -fms-extensions mode. Don't build
a dependent-scope id expression when a templated member function of a
non-templated class references an unknown identifier, since instantiation won't
rebuild it (and we can tell at parse time that it'll never work). Based on a
patch by Faisal Vali!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3aaf41aea00507c019d1e3d016c0334ceb49dd61 23-Apr-2013 Ted Kremenek <kremenek@apple.com> Add a warning for Objective-C pointer introspection, which is solely the job of the Objective-C runtime.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1a7df995d4a62cd579c390b2d0cfb34a61878434 18-Apr-2013 Richard Trieu <rtrieu@google.com> Switch the note order for -Woverloaded-shift-op-parentheses so that the note
with the silence fix-it comes first. This is more consistent with the rest
of the warnings in -Wparentheses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2a6e528cbd687e22744d5d7eba428afea99da300 17-Apr-2013 Richard Trieu <rtrieu@google.com> Add warning group -Woverloaded-shift-op-parentheses to -Wparentheses. This
will fire on code such as:

cout << x == 0;

which the compiler will intrepret as

(cout << x) == 0;

This warning comes with two fixits attached to notes, one for parentheses to
silence the warning, and another to evaluate the comparison first.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
236d9d16c9b42001085611a82d37b9d5a4f39c1f 16-Apr-2013 Douglas Gregor <dgregor@apple.com> Fix handling of atomic shift operations, from Serge Pavlov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
62165c93f529ba3b714c446e61c561abaee81599 15-Apr-2013 Joey Gouly <joey.gouly@arm.com> Remove some dead code that has not been used since 2010.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d1cc514a6ac03f34de0aa5a4f4010d21d650d8f9 04-Apr-2013 Tanya Lattner <tonic@nondot.org> Update OpenCL comments to mention spec section and version.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
0c70181854a95fca0e0d56dfa1203eb2216052ea 02-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit hints when warning
about 'isa' ivar being explicitely accessed
when base is a user class object reference.
// rdar://13503456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b421d926cdc632489915d39556f04c14f59d2392 02-Apr-2013 John McCall <rjmccall@apple.com> Add -Wstatic-local-in-inline, which warns about using a static local
variable in a C99 inline (but not static-inline or extern-inline)
function definition.

The standard doesn't actually say that this doesn't apply to
"extern inline" definitions, but that seems like a useful extension,
and it at least doesn't have the obvious flaw that a static
mutable variable in an externally-available definition does.

rdar://13535367

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
66dca6eaaa2e9c24023fc919ab72b8ae2df1e288 30-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Don't crash when trying to emit a precedence warning on postinc/decrement.

Post-Inc can occur as a binary call (the infamous dummy int argument), but it's
not really a binary operator.

Fixes PR15628.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
52b2e7085f09bf7834b41f6e807aff5ac97bd3a5 29-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Warn on sizeof on binary ops on decayed arrays.

The array will decay into a pointer, creating an unexpected result.
sizeof(array + int) is an easy to make typo for sizeof(array) + int.

This was motivated by a NetBSD security bug, used sizeof(key - r) instead of
sizeof(key) - r, reducing entropy in a random number generator.
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN&f=h

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
99a72d2d875321b4d91e6aef4e20b289f3d05db4 29-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Produce precise diagnostic when
'isa' ivar is accessed provided it is the first
ivar. Fixit hint will follow in another patch.
This is continuation of // rdar://13503456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ec8deba768e7ba93ad9974763dc3902896924a3c 28-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Provide fixit suggestions when class object
is accessed via accessing 'isa' ivar to use
object_getClass/object_setClass apis.
// rdar://13503456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7e35274df4a598d5e3e4b8b5567bcb256fc2ab2f 27-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C: Issue more precise warning when user
is accessing 'isa' as an object pointer.
// rdar://13503456. FixIt to follow in another patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e79ce292d93f955c1219c3977c02199bd3dc6544 26-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13473493> Handle 'this->' insertion recovery within trailing return types.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8ff563c2178866779903cb1b47c2962c39309995 22-Mar-2013 Daniel Jasper <djasper@google.com> Fix DeclRefExpr::getFoundDecl() for usages by reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b760f11fae94e3003b9241ac50c02617465f2fa2 22-Mar-2013 John McCall <rjmccall@apple.com> Fix a crash-on-valid where a block capture copy expression was
picking up cleanups from earlier in the statement. Also fix a
crash-on-invalid where a reference to an invalid decl from an
enclosing scope was causing an expression to fail to build, but
only *after* a cleanup was registered from that statement,
causing an assertion downstream.

The crash-on-valid is rdar://13459289.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7cca821e1acf0f1b4fe892c3111bfb2086832e4e 19-Mar-2013 John McCall <rjmccall@apple.com> Add a clarifying note when a return statement is rejected because
we expect a related result type.

rdar://12493140

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7132be1ef46248746990590b91e693dfc3cce251 19-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Diagnose uses of 'alignof' on functions in -pedantic mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
07b0fdcee8d64222b274779d02851cc53d18e0db 18-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Bring inheriting constructor implementation up-to-date with current defect
reports, and implement implicit definition of inheriting constructors.
Remaining missing features: inheriting constructor templates, implicit
exception specifications for inheriting constructors, inheriting constructors
from dependent bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
62bbe07f5aed5a2f9ae55ef480c4268cb4435d99 15-Mar-2013 Jordan Rose <jordan_rose@apple.com> Add some assertions to appease the static analyzer.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d1b09641ecf2e754bf3fd244dc45dbf3e460c1b 14-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Avoid computing the linkage too early. Don't invalidate it.

Before this patch we would compute the linkage lazily and cache it. When the
AST was modified in ways that could change the value, we would invalidate the
cache.

That was fairly brittle, since any code could ask for the a linkage before
the correct value was available.

We should change the API to one where the linkage is computed explicitly and
trying to get it when it is not available asserts.

This patch is a first step in that direction. We still compute the linkage
lazily, but instead of invalidating a cache, we assert that the AST
modifications didn't change the result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
75525c4cce5e1e097d3fab4391b11619d87cedfd 06-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: don't crash after diagnosing
using object subscripting without declaring objectForKeyedSubscript:
// rdar://13333205


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
48f904271effd381ec3c1ae33b97d1ec7d95860a 04-Mar-2013 John McCall <rjmccall@apple.com> Centralize and refine the __unknown_anytype argument rules
and be sure to apply them whether or not the debugger gave
us a method declaration.

rdar://12565338

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7a534b94138ef2ad1a75b26b3b5bf1aa948d4121 04-Mar-2013 John McCall <rjmccall@apple.com> Perform non-overload placeholder conversions on the operands
to a subscript operator.

rdar://13332183

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
94f3f549a7e0c426d5ffda7f25d1983c885dab9c 21-Feb-2013 Ted Kremenek <kremenek@apple.com> Remove superfluous null pointer check. The pointer is used prior to this check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
63631bd173df1decfff98ae6a7ed7f3d5f886b86 21-Feb-2013 Ted Kremenek <kremenek@apple.com> Teach serialized diagnostics about notes without locations.

Along the way, improve a diagnostic for "previous declaration here" for implicit parameters.

Fixes <rdar://problem/13211384>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
52e933b0c3a1d552ab0e4d629ee15cff99a94447 21-Feb-2013 Joey Gouly <joey.gouly@arm.com> Add support to Sema and CodeGen for floating point vector types in OpenCL.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0adb17502365b56dca99bfa971c59514ece54877 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Avoid implicit conversions of Optional<T> to bool.

This is a precursor to making Optional<T>'s operator bool 'explicit' when
building Clang & LLVM as C++11.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
39e6ab4be93d9c5e729a578ddd9d415cd2d49872 18-Feb-2013 David Blaikie <dblaikie@gmail.com> Replace TypeLoc llvm::cast support to be well-defined.

The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0dc4ff2209b7b3b5ee479754d12176e43df0cd8e 18-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> Prevent crash on multiple user errors (which I cannot reproduce in
a small test case). // rdar://13178483.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2e85e743dc3d5b2f7ee6cd94a0c35fbc2e40e829 15-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Unnest early exit and remove an unnecessary bad cast.

cast<ObjCObjectPointerType> doesn't look through sugar, getAs does.
Fixes PR15257.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
26202291b161f8598c0c342cba12c6552e44d44c 14-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: When implementing custom accessor method for
a property, the -Wdirect-ivar-access should not warn when
accessing the property's synthesized instance variable.
// rdar://13142820


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d3b4f0e27ffa8d73f8c69a717c39c39a4d47ff0c 14-Feb-2013 Nick Lewycky <nicholas@mxc.ca> When marking derived classes' virtual methods ODR-used in order to trigger
instantiation in order to permit devirtualization later in codegen, skip over
pure functions since those can't be devirtualization targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a2905ea609c8ed1bf41a6b917358983d9f26dc6d 12-Feb-2013 John McCall <rjmccall@apple.com> Perform placeholder conversions on the controller of a _Generic
expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9dd74c5504c743c96ea3a1d691d6a75ec3a98147 12-Feb-2013 John McCall <rjmccall@apple.com> Diagnose loads of 'half' l-values in OpenCL.
Patch by Joey Gouly!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7cea1487602536e91a2c36511f5ad56ff1b2dc68 05-Feb-2013 Nick Lewycky <nicholas@mxc.ca> Test for virtual instead of pure here. It has the exact same effect, and John
claims it will improve performance.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
afbcab8d10d4208c7ad8da79e948432117d4a326 05-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15095: Use more correct source locations for the InitListExpr we fake up for
vector initialization. Patch by John Stratton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a4dc51b46861eb52626f89183da7610437baba93 05-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add some missing diagnostics for C++11 narrowing conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3fa3feab35096b608f1d79bb541798b37a55e7b9 02-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take
address of rvalue of type 'T'".

For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully
saying "cannot take address of rvalue of type '<overloaded function type>'".

For the case of &array_temporary, treat it just like a class temporary
(including allowing it as an extension); the existing diagnostic wording
for the class temporary case works fine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b7e5eec2f57bd82c6ddb762ca3dd7b7d8697e9d5 02-Feb-2013 Nick Lewycky <nicholas@mxc.ca> This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug that caused us to not mark the function referenced just
because we didn't want to mark it odr used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
41f7b1a854362f7de5cb6d6b0c2964373dede51d 01-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objc: Provide correct fixit instruction when two mismatched
nsstringis are compared without. // rdar://12716301


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
57dab7135269ba12b979a91415153d00794c7727 01-Feb-2013 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Fix PR14881 by implementing conversion rules between int and complex int.

Prior to the patch, Clang does not properly promote types when a complex
integer operand is combined with an integer via a binary operator, or when
one is assigned to the other in either order. This patch detects when
promotion is needed (and permissible) and generates the necessary code.

The test assmes no target has the same size operands for "char" and
"long long," and that no target performs arithmetic on char operands without
extending them to a larger format first. If there are any targets for
which this is not the case, they should be XFAILed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cd0655b17249c4c4908ca91462657f62285017e6 01-Feb-2013 Nick Lewycky <nicholas@mxc.ca> Add a new -Wundefined-inline warning for inline functions which are used but not
defined. Fixes PR14993!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
869709c06eefd1d756ae4290646d4412103697bd 31-Jan-2013 Nick Lewycky <nicholas@mxc.ca> Fix grammar in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4ceaf337be78fa89b4a97f351be6d0bda962d7de 31-Jan-2013 Nick Lewycky <nicholas@mxc.ca> Fix ODR-use of a MemberExpr to check before marking a pure function used. Remove
a workaround for this bug from the -Wundefined-internals warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16bdd3b98e40a5a04705d399b90ddd88babd1c3d 30-Jan-2013 Ted Kremenek <kremenek@apple.com> Hoist retrieval of Expr* into caller. No functionality change.

Just makes the code a little cleaner, and easier to reason about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e1ac4aec0d30d2d81876e555017e727cc374ff5e 30-Jan-2013 Tim Northover <Tim.Northover@arm.com> Also promote fp16 types to double when they're anonymous variadic arguments.

__fp16 isn't covered by the standard, but this resolves the oddity that float
gets promoted when passed variadically, but not the smaller type. This is
required by the AArch64 ABI, and a sane action elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4ea6a646af4765791d0829034016bd47eff8c789 24-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Micro cleanup: use an array of const char, rather than an array of char, as the
type of the string literal implicitly used for a raw user-defined literal call.
No test; this has no semantic impact.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
19dbb20ac4371fae3190379a7e7bd467af3c00aa 23-Jan-2013 Joey Gouly <joey.gouly@arm.com> Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
e178e70e14380cf8828a307f912fcdbd3882b752 09-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> put back diagnostics when flexible members are captured
in lambdas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b20eb10c8f51d26b0c486f345db25e26f96acb06 09-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Fix typo (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b3040f51a96248fa34ba14cf54914d361142bd7 09-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Remove lambda from my last patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
456cfc0010ceb785f1e41735935302884b8b4250 09-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Fixes typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c0816f36d9012c5ed1445ed969fba5b60bcec01 09-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> objectiveC blocks: It is impractical to capture
struct variables with flexiable array members in
blocks (and lambdas). Issue error instead of
crashing in IRGen. // rdar://12655829


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a6d2020412455ec582454811435202eadc037081 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Move loop variable update.
Thanks to Dmitri Gribenko for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b9725cfb0a50731930a6331beb70f361b4d52a29 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Mark all subsequent decls used.

In the source

static void f();
static void f();
template<typename T>
static void g() {
f();
}
static void f() {
}
void h() {
g<int>();
}

the call to f refers to the second decl, but it is only marked used at the end
of the translation unit during instantiation, after the third f decl has been
linked in.

With this patch we mark all subsequent decls used, so that it is easy to check
if a symbol is used or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cbb99efceb3a2c27ba2382df97f3b69c75974f94 08-Jan-2013 Ted Kremenek <kremenek@apple.com> Don't warn about undefined varargs argument behavior in unreachable code.

Fixes <rdar://problem/12322000>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7a83421776416d6a9044fb03b5b02208b47646c1 07-Jan-2013 David Tweed <david.tweed@arm.com> Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to be
with respect to the lower "left-hand-side bitwidth" bits, even when negative);
see OpenCL spec 6.3j. This patch both implements this behaviour in the code
generator and "constant folding" bits of Sema, and also prevents tests
to detect undefinedness in terms of the weaker C99 or C++ specifications
from being applied.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4e24f0f711e2c9fde79f19fa1c80deaab3f3b356 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby 'C++0x' comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
0f46e64947bdd570a499732c4b459961627d8745 28-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improve diagnostic wording for when an implicitly-deleted special member
function is selected by overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d3292c88ad6360823818b78d67875eceb3caedfb 21-Dec-2012 Ted Kremenek <kremenek@apple.com> Tweak Sema::CheckLiteralKind() to also include block literals

This simplifies some diagnostic logic in checkUnsafeAssignLiteral(),
hopefully making it less error prone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f530ff76de3b270f2287d3555d93b5d270643eeb 21-Dec-2012 Ted Kremenek <kremenek@apple.com> Change checkUnsafeAssignLiteral() to use the new Sema::CheckLiteralKind().

Along the way, fix a bug in CheckLiteralKind(), previously in diagnoseObjCLiteralComparison, where we didn't ignore parentheses
in boxed expressions for purpose of classification.

In other words, both @42 and @(42) should be classified as numeric
literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3ee069bddb538ebafff2068e99136cc526fb9fdd 21-Dec-2012 Ted Kremenek <kremenek@apple.com> Hoist logic for classifying Objective-C literals into Sema (proper) for use with other diagnostics.

No immediate (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
87aa2fbc75a897e7c4a4082374aaba3f50db6f0f 21-Dec-2012 Roman Divacky <rdivacky@freebsd.org> Remove duplicate includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5cf1589db395371975bd3315b9126eb5c9be6701 21-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix regression in r170489: when instantiating a direct initializer which is a
CXXScalarValueInitExpr (or an ImplicitValueInitExpr), strip it back down to an
empty pair of parentheses so that the initialization code can tell that we're
performing value-initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
42427409fd75a48381071e6da008a3c06897437a 06-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Sema: Don't emit a warning when __func__ is used in a lambda outside of a function.

Fixes PR14518.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
464a01a67c2cf7c42c4d15f687f6b9a622468783 01-Dec-2012 Douglas Gregor <dgregor@apple.com> Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8b8a09e496fbed361d4c8e9e8cc259454a094258 29-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge function types in C.

Among other differences, GCC accepts

typedef int IA[];
typedef int A10[10];
static A10 *f(void);
static IA *f(void);
void g(void) {
(void)sizeof(*f());
}

but clang used to reject it with:

invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
* Use the type from the function type in initializations, even if an parameter
is available.
* Fix the merging of the noreturn attribute in function types.
* Make CodeGen handle the fact that an parameter type can be different from
the corresponding type in the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
84268904947ada7e251932a6f5b0f4364df7a2c7 29-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
82c458ea76bf8f0981e3d1b5070c0b0e5878d784 28-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C arc: load of a __weak object happens via call to
objc_loadWeak. This retains and autorelease the weakly-refereced
object. This hidden autorelease sometimes makes __weak variable alive even
after the weak reference is erased, because the object is still referenced
by an autorelease pool. This patch overcomes this behavior by loading a
weak object via call to objc_loadWeakRetained(), followng it by objc_release
at appropriate place, thereby removing the hidden autorelease. // rdar://10849570


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
426391cd51af86f9d59eceb0fb1c42153eccbb9a 16-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> A step towards sorting out handling of triviality of special members in C++11.

Separate out the notions of 'has a trivial special member' and 'has a
non-trivial special member', and use them appropriately. These are not
opposites of one another (there might be no special member, or in C++11 there
might be a trivial one and a non-trivial one). The CXXRecordDecl predicates
continue to produce incorrect results, but do so in fewer cases now, and
they document the cases where they might be wrong.

No functionality changes are intended here (they will come when the predicates
start producing the right answers...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ebbcd1de4f6b0a88b5c9108529b21306968bd79f 15-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Fix DiagnoseBitwisePrecedence so it doesn't cast "-1" to the type
BinaryOperator::Opcode. This is bad form, and the behavior of the static_cast
in this case is unspecified according to the standard.

Fixes a warning that showed up from r167992 on self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b8a8de316dade43fff95d7bfd2cfaa367f53faea 14-Nov-2012 John McCall <rjmccall@apple.com> Accept and pass arguments to __unknown_anytype in argument
positions of Objective-C methods.

It is possible to recover a lot of type information about
Objective-C methods from the reflective metadata for their
implementations. This information is not rich when it
comes to struct types, however, and it is not possible to
produce a type in the debugger's round-tripped AST which
will really do anything useful during type-checking.
Therefore we allow __unknown_anytype in these positions,
which essentially disables type-checking for that argument.
We infer the parameter type to be the unqualified type of
the argument expression unless that expression is an
explicit cast, in which case it becomes the type-as-written
of that cast.

rdar://problem/12565338

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
87da0b757638011ce84fd57f72e15b20bb523b19 10-Nov-2012 Jordan Rose <jordan_rose@apple.com> -Wobjc-literal-compare: look through implicit casts.

This warning was failing to fire under ARC because of the implicit
lifetime casts added around the object literal expression.

<rdar://problem/11300873>, again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ce2661f9ccb85de1aacaa7c3ea414a757f5986f6 07-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11851 (and duplicates): Whenever a constexpr function is referenced,
instantiate it if it can be instantiated and implicitly define it if it can be
implicitly defined. This matches g++'s approach. Remove some cases from
SemaOverload which were marking functions as referenced when just planning how
overload resolution would proceed; such cases are not actually references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
713c287caf70922f93cfd9292540bad274c4a82f 23-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> When rebuilding a DependentScopeDeclRefExpr, perform a lookup into the scope
even if it's dependent, in case it now names a member of the current instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
efeeccfb5efa94b6b4198298a80ad9a699bebcce 21-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r166268, reverted in r166272, with a fix for the issue which Nick
found: if an overloaded operator& is present before a template definition,
the expression &T::foo is represented as a CXXOperatorCallExpr, not as a
UnaryOperator, so we didn't notice that it's permitted to reference a non-static
data member of an unrelated class.

While investigating this, I discovered another problem in this area: we are
treating template default arguments as unevaluated contexts during substitution,
resulting in performing incorrect checks for uses of non-static data members in
C++11. That is not fixed by this patch (I'll look into this soon; it's related
to the failure to correctly instantiate constexpr function templates), but was
resulting in this bug not firing in C++11 mode (except with -Wc++98-compat).

Original message:

PR14124: When performing template instantiation of a qualified-id outside of a
class, diagnose if the qualified-id instantiates to a non-static class member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b687f3ba4cdc3fd6e4fa9a89addc1efa61761eeb 20-Oct-2012 Logan Chien <tzuhsiang.chien@gmail.com> Fix __builtin_va_arg assertion failure in ARM AAPCS.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5016a70c183a50845a0421802d161093dd0643f6 20-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1472: A reference isn't odr-used if it has preceding initialization,
initialized by a reference constant expression.

Our odr-use modeling still needs work here: we don't yet implement the 'set of
potential results of an expression' DR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5f531a489774ce46370fcb005a51d46d511f7914 19-Oct-2012 David Blaikie <dblaikie@gmail.com> Clarify wording of -Wshift-op-parentheses.

Suggestion from Matt Beaumont-Gay reviewing r165283.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
79cf161f178e36ce6d8aeea2a247e367b8d0fc34 19-Oct-2012 Nick Lewycky <nicholas@mxc.ca> Revert r166268, this fix for a crash-on-invalid introduced a rejects-valid.
Richard has an unreduced testcase to work with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
80ddc31c5379df78a007eaf08d531efdbcd9b161 19-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14124: When performing template instantiation of a qualified-id outside of a
class, diagnose if the qualified-id instantiates to a non-static class member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c9a2daf902aacb1a606497a7d09a7c2c29957ed 16-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> Minor tweak to last patch along with a test case.
// rdar://12491143


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9f5933a73b2dde9164f4fed001d987491f277c9a 16-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> fixes an objc crash involving objc bool literal on
hopelessly poorly written code after spewing several
errors. // rdar://12491143


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7a0c064770355a4918df69f95de8dea6338a59a2 16-Oct-2012 Daniel Dunbar <daniel@zuster.org> Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dc0d4e251b4c41b75c5d93f1866a8a0952b1c6ae 15-Oct-2012 Nico Weber <nicolasweber@gmx.de> Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.

See PR14013.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6952c018318a8ce57e336d7ed2a4819a98182fa2 12-Oct-2012 David Blaikie <dblaikie@gmail.com> Fix typo correction of one qualified name to another.

When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.

This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).

Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
abeadfb11fde148f15c2fd67015e8163609d5b68 12-Oct-2012 David Blaikie <dblaikie@gmail.com> Provide a fixit when taking the address of an unqualified member function.

This only applies if the type has a name. (we could potentially do something
crazy with decltype in C++11 to qualify members of unnamed types but that
seems excessive)

It might be nice to also suggest a fixit for "&this->i", "&foo->i",
and "&foo.i" but those expressions produce 'bound' member functions that have
a different AST representation & make error recovery a little trickier. Left
as future work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
04bec39d61f2b392d798882c9141fecf3ca653c5 10-Oct-2012 Jordan Rose <jordan_rose@apple.com> Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.

Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl
(the latter by name) over to findPropertyDecl. This actually makes
-Wreceiver-is-weak a bit stronger than it was before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b34c176994aaa781eff6cd8755a48cfb109e809 08-Oct-2012 David Blaikie <dblaikie@gmail.com> Use a single note diagnostic for all the precedent/parentheses warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0bea86307eb8c16339315a1e261fc490eb505c5b 08-Oct-2012 David Blaikie <dblaikie@gmail.com> StringRef-ify Binary/UnaryOperator::getOpcodeStr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b3f55c5728aaf0d28579e67db3dd34c2934e7805 05-Oct-2012 David Blaikie <dblaikie@gmail.com> Implement -Wshift-op-parentheses for: a << b + c

This appears to be consistent with GCC's implementation of the same warning
under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user
defined type for compatibility with C++ stream IO. Otherwise suggest
parentheses around the addition or subtraction subexpression.

(this came up when MSVC was complaining (incorrectly, so far as I can tell)
about a perceived violation of this within the LLVM codebase, PR14001)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3f001ff471aec590a65a383a25367a4e1c82f5a3 03-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could
create retain cycles. Provide fixit. // rdar://11194874


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
7a2704800943fbb69207e125d28186278712af36 29-Sep-2012 Jordan Rose <jordan_rose@apple.com> -Warc-repeated-use-of-weak: check ivars and variables as well.

Like properties, loading from a weak ivar twice in the same function can
give you inconsistent results if the object is deallocated between the
two loads. It is safer to assign to a strong local variable and use that.

Second half of <rdar://problem/12280249>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
58b6bdcdeb683a3504f2248a409e1f4e85876cee 29-Sep-2012 Jordan Rose <jordan_rose@apple.com> Add a warning (off by default) for repeated use of the same weak property.

The motivating example:

if (self.weakProp)
use(self.weakProp);

As with any non-atomic test-then-use, it is possible a weak property to be
non-nil at the 'if', but be deallocated by the time it is used. The correct
way to write this example is as follows:

id tmp = self.weakProp;
if (tmp)
use(tmp);

The warning is controlled by -Warc-repeated-use-of-receiver, and uses the
property name and base to determine if the same property on the same object
is being accessed multiple times. In cases where the base is more
complicated than just a single Decl (e.g. 'foo.bar.weakProp'), it picks a
Decl for some degree of uniquing and reports the problem under a subflag,
-Warc-maybe-repeated-use-of-receiver. This gives a way to tune the
aggressiveness of the warning for a particular project.

The warning is not on by default because it is not flow-sensitive and thus
may have a higher-than-acceptable rate of false positives, though it is
less noisy than -Wreceiver-is-weak. On the other hand, it will not warn
about some cases that may be legitimate issues that -Wreceiver-is-weak
will catch, and it does not attempt to reason about methods returning weak
values.

Even though this is not a real "analysis-based" check I've put the bug
emission code in AnalysisBasedWarnings for two reasons: (1) to run on
every kind of code body (function, method, block, or lambda), and (2) to
suggest that it may be enhanced by flow-sensitive analysis in the future.

The second (smaller) half of this work is to extend it to weak locals
and weak ivars. This should use most of the same infrastructure.

Part of <rdar://problem/12280249>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
80bfa3d125fa0b9c636977ea37b4a55b2c9b1037 26-Sep-2012 Eli Friedman <eli.friedman@gmail.com> Fix an edge case of mangling involving the combination of a lambda and typeid.
typeid (and a couple other non-standard places where we can transform an
unevaluated expression into an evaluated expression) is special
because it introduces an an expression evaluation context,
which conflicts with the mechanism to compute the current
lambda mangling context. PR12123.

I would appreciate if someone would double-check that we get the mangling
correct with this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e3b136bd873508c9ac0ee6eba98c2a810a177eba 24-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Change the wording of the extension warning from
> 'long long' is an extension when C99 mode is not enabled
to
> 'long long' is a C++11 extension
while compiling in C++98 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fc97ea29b1afd9e87341bce2b0cbb0c7172b7dd8 24-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Small cleanup of literal semantic analysis: hiding 'char *' pointers behind
StringRef makes code cleaner. Also, make the temporary buffer smaller:
512 characters is unreasonably large for integer literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fd09088880f758c874edc8d3d22fa922baec0483 21-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: when diagnosing deprecated/unavailable usage of
setter or getter backing a deprecated/unavailable property,
also not location of the property. // rdar://12324295


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e10f4d384f5ae113d72a5193a1332c1930635ccc 15-Sep-2012 Jordan Rose <jordan_rose@apple.com> -Warc-retain-cycles: warn at variable initialization as well as assignment.

Specifically, this should warn:

__block block_t a = ^{ a(); };

Furthermore, this case which previously warned now does not, since the value
of 'b' is captured before the assignment occurs:

block_t b; // not __block
b = ^{ b(); };

(This will of course warn under -Wuninitialized, as before.)

<rdar://problem/11015883>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6db351abf27e907b4a01570a6aa8e7b898522449 14-Sep-2012 Douglas Gregor <dgregor@apple.com> In debugger mode, allow comparisons between pointers and integers
without a cast. Fixes <rdar://problem/11830912>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3359fa306836ffb64401aad4b561e7647b20d6ef 06-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> refactoring + objective-C specific test for my last patch.
// rdar://12233989


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d40d9e3bd6638399260332d8c7a98ac715f7b0d 06-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> c: make __attribute__((unused)) transitive.
Don't warn if annotated decl is used inside another
unused. // rdar://12233989


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a6c66cedc022c9e5d45a937d6b8cff491a6bf81b 31-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Change the representation of builtin functions in the AST
(__builtin_* etc.) so that it isn't possible to take their address.
Specifically, introduce a new type to represent a reference to a builtin
function, and a new cast kind to convert it to a function pointer in the
operand of a call. Fixes PR13195.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
961713055e636170da59d7006a878cb4ba518a5d 30-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: clang must implicitly convert
__objc_yes/__objc_no to (BOOL)1/(BOOL)0 when
BOOL is declared; otherwise it resorts to
default of 'signed char'. This is important to
selecting the correct Numeric API numberWithBool:
Can't have a clang test for this. Will checkin and
executable llvm test. // rdar://12156616


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a414a2f3ae818953c88443bd617aa89a2b7712e5 29-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: make -Widiomatic-parentheses work
when assignment expression in conditional invloves
property reference. // rdar://11066598


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
27bec77f5eb0920b401497be32713cb42339edef 17-Aug-2012 Douglas Gregor <dgregor@apple.com> Don't do jump-scope checking when code completion is enabled. It's
both a waste of time, and prone to crash due to the use of the
error-recovery path in parser. Fixes <rdar://problem/12103608>, which
has been driving me nuts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
50800fc551ac6b8a95cca662223e7f061bbd169a 08-Aug-2012 David Blaikie <dblaikie@gmail.com> Implement warning for integral null pointer constants other than the literal 0.

This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...

There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.

Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.

Review by Sean Silva and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ed6662dcd95a3349b6c94bb0df2ff4378a029df8 08-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objc: Include all types when issuing warning under
-Wdirect-ivar-access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b25466e8b33285a13d0303461db37e903ec505c1 08-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objc-arc: Make -Wdirect-ivar-access accessible to all
memory models, except when arc is accessing a weak
ivar (which is an error). // rdar://6505197


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cff863fd803874d251ef8725d5c08dec90924627 07-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: Exclude -Wdirect-ivar-access for arc.
Allow direct ivar access in init and dealloc methods
in mrr. // rdar://650197


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c69d7356caa9dd08cd957f1a4a263da62eae5bc1 07-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: Implement gcc's -Wdirect-ivar-access option.
// rdar://6505197


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
71f55f771794674a410171dbf3cb5dbedf95d033 07-Aug-2012 David Blaikie <dblaikie@gmail.com> Refactor checks for unevaluated contexts into a common utility function.

The one caller that's surrounded by nearby code manipulating the underlying
evaluation context list is left unmodified for readability.

Review by Sean Silva and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1503f0ddab0057e33efa21393fc0577580d6287a 31-Jul-2012 John McCall <rjmccall@apple.com> Introduce new queries on ObjCRuntime for how to interpret subscripts
on object pointers and whether pointer arithmetic on object pointers
is supported. Make ObjFW interpret subscripts as pseudo-objects.
Based on a patch by Jonathan Schleifer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
adb1d4c18ee83249d4cffc99ef902f98e846092a 23-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12917: Remove incorrect assumption that lambda mangling information cannot
change once it's been assigned. It can change in two ways:
1) In a template instantiation, the context declaration should be the
instantiated declaration, not the declaration in the template.
2) If a lambda appears in the pattern of a variadic pack expansion, the
mangling number will depend on the pack length.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ddcfbc9ad1817f545610999d655ac6c28d4c0c12 19-Jul-2012 Jordan Rose <jordan_rose@apple.com> For varargs, diagnose passing ObjC objects by value like other non-POD types.

While we still want to consider this a hard error (non-POD variadic args are
normally a DefaultError warning), delaying the diagnostic allows us to give
better error messages, which also match the usual non-POD errors more closely.

In addition, this change improves the diagnostic messages for format string
argument type mismatches by passing down the type of the callee, so we can
say "variadic method" or "variadic function" appropriately.

<rdar://problem/11825593>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
251c449b280eb845017a6c022ed7189d17c63d49 17-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
379b28183a7dcb715c3f3eb2da4b0157d6d8ffbe 17-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> Issue warning when assigning out-of-range integer values to enums.
Due to performance cost, this is an opt-in option placed
under -Wassign-enum. // rdar://11824807


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d5209ae13a7c42e2b7fa641f75a66e545959cbed 17-Jul-2012 Jordan Rose <jordan_rose@apple.com> -Wobjc-literal-compare: don't warn when comparing against nil.

Checks against nil often appear as guards in macros, and comparing
Objective-C literals to nil has well-defined behavior (if tautological).

On OS X, 'nil' has not been typed as 'id' since 10.6 (possibly earlier),
so the warning was already not firing, but other runtimes continue to use
((id)0) or some variant. This change accepts comparisons to any null pointer;
to keep it simple, it looks through all casts (not just casts to 'id').

PR13276

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eec207f02a0208814bb8b4ca90099a2fed016244 17-Jul-2012 Jordan Rose <jordan_rose@apple.com> Add -Wobjc-string-compare under -Wobjc-literal-compare.

Suggested by Ted, since string literal comparison is at least slightly more
sensible than comparison of runtime literals. (Ambiguous language on
developer.apple.com implies that strings are guaranteed to be uniqued within
a translation unit and possibly across a linked binary.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8d872ca7f10bb70d0757b894af79641679262bba 17-Jul-2012 Jordan Rose <jordan_rose@apple.com> Now that -Wobjc-literal-compare is a warning, put the fixit on a note.

Recovering as if the user had actually called -isEqual: is a bit too far from
the semantics of the program as written, /even though/ it's probably what they
intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7e54fb5fcc7d7b8e843501652cf7c19cea6c4c57 16-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13365: Fix code which was trying to treat an array of DeducedTemplateArgument
as an array of its base class TemplateArgument. Switch the const
TemplateArgument* parameters of InstantiatingTemplate's constructors to
ArrayRef<TemplateArgument> to prevent this from happening again in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6deae7cc8de2fb7578ed244d064cd34af744aac5 09-Jul-2012 Jordan Rose <jordan_rose@apple.com> Downgrade the "direct comparison" error for ObjC literals to a warning.

Chris pointed out that while the comparison is certainly problematic
and does not have well-defined behavior, it isn't any worse than some
of the other abuses that we merely warn about and doesn't need to make
the compilation fail.

Revert the release notes change (r159766) now that this is just a new warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ab91ef1dbe524bba3c0147b11dfdd394153c783d 08-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR9793: Treat substitution as an instantiation step for the purpose of the
-ftemplate-depth limit. There are various ways to get an infinite (or merely
huge) stack of substitutions with no intervening instantiations. This is also
consistent with gcc's behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7c81b43bef441960e921e0eb72d249369b7dd96c 03-Jul-2012 Nico Weber <nicolasweber@gmx.de> Rename -Wself-assign-memvar to -Wself-assign-field to improve local consistency a bit.

(cf -Wunused-private-field and several other existing -field diagnostics.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7dd900ed308506f9cf1cb72c70db1652f94cab37 02-Jul-2012 Jordan Rose <jordan_rose@apple.com> In blocks, only pretend that enum constants have enum type if necessary.

In C, enum constants have the type of the enum's underlying integer type,
rather than the type of the enum. (This is not true in C++.) Thus, when a
block's return type is inferred from an enum constant, it is incompatible
with expressions that return the enum type.

In r158899, I told block returns to pretend that enum constants have enum
type, like in C++. Doug Gregor pointed out that this can break existing code.

Now, we don't check the types of return statements until the end of the block.
This lets us go back and add implicit casts in blocks with mixed enum
constants and enum-typed expressions.

<rdar://problem/11662489> (again)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d68615f46da579fff14cc5ad028e5df79e97d03d 29-Jun-2012 Nico Weber <nicolasweber@gmx.de> Change condition to be the same as in SemaTemplateInstantiate.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
43bb1793c523f714bca1c49d804ba7c0cb62aca2 29-Jun-2012 Nico Weber <nicolasweber@gmx.de> Warn on self-assignment to member variables. PR13104.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e1971a136a75e6722059d759d9700e411f63f344 27-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Refactoring after r159290: don't hold onto and check a misleading QualType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
83ea530f9da1b8ca57773bf53418ce9fc98f46ac 27-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Check for non-POD vararg argument type after default argument promotion, not
before, so we don't incorrectly think arguments of function type are non-POD.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8d852e35adb46e0799538dfc9c80d44f27cd3597 27-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Implement John McCall's review of r159212 other than the this pointer not
being updated. Will fix that in a second.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159280 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0713d993cd0b4eb6a1b642c7d51d0f1845c1e986 27-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a crash I introduced in r159212.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0b4fe503ef00d9f8ea330850d3e3b303e9c7c876 26-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> During codegen of a virtual call we would extract any casts in the expression
to see if we had an underlying final class or method, but we would then
use the cast type to do the call, resulting in a direct call to the wrong
method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
831421f24057b93ea28bc92d8bd6290631a43caf 25-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Unrevert r158887, reverted in r158949, along with a fix for the bug which
resulted in it being reverted. A test for that bug was added in r158950.

Original comment:

If an object (such as a std::string) with an appropriate c_str() member function
is passed to a variadic function in a position where a format string indicates
that c_str()'s return type is desired, provide a note suggesting that the user
may have intended to call the c_str() member.

Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and
move it to SemaChecking in order to facilitate this. Factor the call checking
out of function call checking and block call checking, and extend it to cover
constructor calls too.

Patch by Sam Panzer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
28ad063b279378b19cb0704f977429df366a151e 23-Jun-2012 Nico Weber <nicolasweber@gmx.de> Support L__FUNCTION__ in microsoft mode, PR11789

Heavily based on a patch from
Aaron Wishnick <aaron.s.wishnick@gmail.com>.

I'll clean up the duplicated function in CodeGen as
a follow-up, later today or tomorrow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
94c4d61625122e7a7ac9a45418e88ad742fcc661 22-Jun-2012 Nico Weber <nicolasweber@gmx.de> Show fixit for unqualified calls to methods of dependent bases
when the calling site is a member function template.

Effectively reverts r111675.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4e294eea2c8a8965e24682ed9da8944969830813 22-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert r158887. This fixes pr13168.

Revert "If an object (such as a std::string) with an appropriate c_str() member function"

This reverts commit 7d96f6106bfbd85b1af06f34fdbf2834aad0e47e.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
05233276b5b0d76e9ebd75eaa2709dff9b316590 21-Jun-2012 Jordan Rose <jordan_rose@apple.com> Don't warn for -Wstatic-in-inline if the used function is also inline.

Also, don't warn if the used function is __attribute__((const)), in which case
it's not supposed to use global variables anyway.

The inline-in-inline thing is a heuristic, and one that's possibly incorrect
fairly often because the function being inlined could definitely use global
variables. However, even some C standard library functions are written using
other (trivial) static-inline functions in the headers, and we definitely don't
want to be warning on that (or on anything that /uses/ these trivial inline
functions). So we're using "inlined" as a marker for "fairly trivial".

(Note that __attribute__((pure)) does /not/ guarantee safety like ((const),
because ((const)) does not guarantee that global variables are not being used,
and the warning is about globals not being shared across TUs.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7d96f6106bfbd85b1af06f34fdbf2834aad0e47e 21-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> If an object (such as a std::string) with an appropriate c_str() member function
is passed to a variadic function in a position where a format string indicates
that c_str()'s return type is desired, provide a note suggesting that the user
may have intended to call the c_str() member.

Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and
move it to SemaChecking in order to facilitate this. Factor the call checking
out of function call checking and block call checking, and extend it to cover
constructor calls too.

Patch by Sam Panzer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b554f4756cefdce6e0109e96d2f13d594b30b8c 20-Jun-2012 Nico Weber <nicolasweber@gmx.de> Allow unqualified lookup of non-dependent member functions
in microsoft mode. Fixes PR12701.

The code for this was already in 2 of the 3 branches of a
conditional and missing in the 3rd branch, so lift it above
the conditional.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
33c0f3703de3ab6d8f3a41d7fb9d2b3489617b21 20-Jun-2012 Jordan Rose <jordan_rose@apple.com> Remove -Winternal-linkage-in-inline in C++.

It's very easy for anonymous external linkage to propagate in C++ through
return types and parameter types. Likewise, it's possible that a template
containing an inline function is only used with parameters that have internal
linkage. Actually diagnosing where the internal linkage comes from is fairly
difficult (both to locate and then to print nicely). Finally, since we only
have one translation unit available, we can't even prove that any of this
violates the ODR.

This warning needs better-defined behavior in C++ before it can really go in.

Rewording of the C warning (which /is/ specified by C99) coming shortly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
260611a32535c851237926bfcf78869b13c07d5b 20-Jun-2012 John McCall <rjmccall@apple.com> Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend: break this
down into a single target runtime kind and version, and compute
all the relevant information from that. This makes it
relatively painless to add support for new runtimes to the
compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime. This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c4429b9ee5045525f532d00e820a81b7eeac28f8 19-Jun-2012 Jordan Rose <jordan_rose@apple.com> Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.

Per post-commit review, it's not appropriate to use ExtWarn in C++, because
we can't prove that the inline function will actually be defined in more than
one place (and thus we can't prove that this violates the ODR).

This removes the warning entirely from uses in the main source file in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0eb3f45a92f706d50de55aefb19d66febfba78aa 19-Jun-2012 Jordan Rose <jordan_rose@apple.com> Support -Winternal-linkage-in-inline in C++ code.

This includes treating anonymous namespaces like internal linkage, and allowing
const variables to be used even if internal. The whole thing's been broken out
into a separate function to avoid nested ifs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
11b46a0a49075f338eb4849c2b7d680945be9250 18-Jun-2012 Jordan Rose <jordan_rose@apple.com> Allow internal decls in inline functions if the function is in the main file.

This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)

I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
860a319e62b0e256817a458396d191aa91c0787a 16-Jun-2012 Eli Friedman <eli.friedman@gmail.com> Fix Sema and IRGen for atomic compound assignment so it has the right semantics when promotions are involved.
(As far as I can tell, this only affects some edge cases.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
106af9e86adbbb3a05f2c339d509fcd3b4274504 15-Jun-2012 Jordan Rose <jordan_rose@apple.com> Warn when a static variable is referenced in a non-static inline function.

This is explicitly forbidden in C99 6.7.4p3. This is /not/ forbidden in C++,
probably because by default file-scope const/constexpr variables have internal
linkage, while functions have external linkage. There's also the issue of
anonymous namespaces to consider. Nevertheless, there should probably be a
similar warning, since the semantics of inlining a function that references
a variable with internal linkage do not seem well-defined.

<rdar://problem/11577619>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
03f1eb031b84e93415b792c4b45d8da71c88e92d 15-Jun-2012 Douglas Gregor <dgregor@apple.com> Check the parameter lists and return type of both blocks and lambdas
for unexpanded parameter packs. Fixes the crash-on-invalid in
PR13117.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
9f63a451b1b3e36c0c82fcfe78828182bb9a6fa0 08-Jun-2012 Jordan Rose <jordan_rose@apple.com> Disallow using ObjC literals in direct comparisons (== and friends).

Objective-C literals conceptually always create new objects, but may be
optimized by the compiler or runtime (constant folding, singletons, etc).
Comparing addresses of these objects is relying on this optimization
behavior, which is really an implementation detail.

In the case of == and !=, offer a fixit to a call to -isEqual:, if the
method is available. This fixit is directly on the error so that it is
automatically applied.

Most of the time, this is really a newbie mistake, hence the fixit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
855243789cb44799c03f4c7216d3d6308805f549 07-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Plug a long standing memory leak in TemplateArgument.

The integral APSInt value is now stored in a decomposed form and the backing
store for large values is allocated via the ASTContext. This way its not
leaked as TemplateArguments are never destructed when they are allocated in
the ASTContext. Since the integral data is immutable it is now shared between
instances, making copying TemplateArguments a trivial operation.

Currently getting the integral data out of a TemplateArgument requires creating
a new APSInt object. This is cheap when the value is small but can be expensive
if it's not. If this turns out to be an issue a more efficient accessor could
be added.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
36d02af300a207242f0486b4255420d8be796b21 05-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add a warning for when an array-to-pointer decay is performed on an array
temporary or an array subobject of a class temporary, and the resulting value
is used to initialize a pointer which outlives the temporary. Such a pointer
is always left dangling after the initialization completes and the array's
lifetime ends.

In order to detect this situation, this change also adds an
LValueClassification of LV_ArrayTemporary for temporaries of array type which
aren't subobjects of class temporaries. These occur in C++11 T{...} and GNU C++
(T){...} expressions, when T is an array type. Previously we treated the former
as a generic prvalue and the latter as a class temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
40e29999daa20646decd3fe4aeb88a487874049c 03-Jun-2012 Nico Weber <nicolasweber@gmx.de> Improve fixit for comparison operator on lhs of bitwise operator.

Before:
test.cc:2:18: note: place parentheses around the == expression to silence this warning
if (0 == flags & 0xdd)
^
( )

Now:
test.cc:2:18: note: place parentheses around the == expression to silence this warning
if (0 == flags & 0xdd)
^
( )



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a27cb253877ac2aa971b2be0623845cf45ebb286 30-May-2012 Eric Christopher <echristo@apple.com> Remove some extra braces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4872e1014844632083690cc1d021b95218a5023b 28-May-2012 David Blaikie <dblaikie@gmail.com> Fix PR12960 by not attempting to correct cases when we're not actually instantiatiating a template.

This comes up in the begin/end calls of a range-for (see the included test
case). Other suggestions are welcome, though this seems to do the trick without
regressing anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a6115068cde719142eb394db88612c185cabd05b 24-May-2012 Eli Friedman <eli.friedman@gmail.com> Add a warning to diagnose statements in C++ like "*(volatile int*)x;". Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d57f52ca4d0e9d5d42dd6947d1e66d693625cf2c 16-May-2012 Douglas Gregor <dgregor@apple.com> Clean up r156925, so that we only mark the capturing DeclRefExpr of a
lambda as referring to a local in an enclosing scope if we're in the
enclosing scope of the lambda (not it's function call operator). Also,
turn the test into an IR generation test, since that's where the
crashes occurred. Really fixes PR12746 / <rdar://problem/11465120>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
29a93f810ae5277446f610e8b6cdf0985febb989 16-May-2012 Douglas Gregor <dgregor@apple.com> Fix code generation of variables reference expressions when mixing
blocks and lambdas, based heavily on a patch from Meador Inge. Fixes
PR12746 / <rdar://problem/11465120>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9fb1ac520d1806ba2b069f6087f40fc9c704b067 15-May-2012 David Blaikie <dblaikie@gmail.com> Don't warn when NULL is used within a macro but its conversion is outside a macro.

This fixes the included test case & was reported by Nico Weber.

It's a little bit nasty using the difference in the conversion context, but
seems to me like a not unreasonable solution. I did have to fix up the
conversion context for conditional operators (it seems correct to me to include
the context for which we're actually doing the comparison - across all the
nested conditionals, rather than the innermost conditional which might not
actually have the problematic implicit conversion at all) and template default
arguments (this is a bit of a hack, since we don't have the source location of
the '=' anymore, so I just used the start of the parameter - open to
suggestions there)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c608c3c0781e15b74fbbda03f8708cc85a3dd488 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Further improvement to wording of overload resolution diagnostics, and including
the sole parameter name in the diagnostic in more cases. Patch by Terry Long!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f7b8056f1ff0c0409a9523a34f78b69ab8314bec 11-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11857: When the wrong number of arguments are provided for a function
which expects exactly one argument, include the name of the argument in
the diagnostic text. Patch by Terry Long!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
f502d8ec9b43b259db9e37e9622279df46070fed 04-May-2012 Douglas Gregor <dgregor@apple.com> Switch RequireLiteralType() off of PartialDiagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b9e05f1b326996f3a46b6e2c66050e77bed0e223 04-May-2012 Stephen Canon <scanon@apple.com> Add support for full-width 128-bit integer literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ca2e1b7990230c5088eb2f280cea9db5f516ad69 01-May-2012 David Blaikie <dblaikie@gmail.com> Workaround a miscompile in 483.xalancbmk while we figure it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c1c0725978ed31253af5ef4849a124e8fc13ebbb 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix PR12378: provide conversion warnings on default args of function templates

Apparently we weren't checking default arguments when they were instantiated.
This adds the check, fixes the lack of instantiation caching (which seems like
it was mostly implemented but just missed the last step), and avoids
implementing non-dependent default args (for non-dependent parameter types) as
uninstantiated default arguments (so that we don't warn once for every
instantiation when it's not instantiation dependent).

Reviewed by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
98f71aae339e00bfc7b556a78e2538931198ec9c 28-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> C++11 weakens the requirement for types used with offsetof from POD to standard layout type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
152f6b7be508fbc61543f3736ebd390d7ac84bd1 28-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Rename isPODType (using the C++98 rules) into isCXX98PODType and make isPODType decide which one to use based on LangOptions.

- -Wc++98-compat depends on the c++98 definition
- Now __is_pod returns the right thing in c++11 and c++98 mode
- All changes to the type traits test are validated against g++ 4.7

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
13bffc532bafd45d4a77867993c1afb83c7661be 19-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR 12586: Fix assert while running libc++ testsuite: deal with exception
specifications on member function templates of class templates and other such
nested beasties. Store the function template from which we are to instantiate
an exception specification rather than trying to deduce it. Plus some
additional test cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d448ce0932708038adb93456b817722a314b647f 18-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> VerifyICE: Pass PartialDiagnostics by reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
93a49944e0e68e32bc22d45d44ee136b34beffb3 16-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
97b57a2170c2138fb71d336d77c6db7728938108 13-Apr-2012 John McCall <rjmccall@apple.com> When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups,
we should flag that in the enclosing function, not in the block
that we're about to pop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
262acdab8ba128857a6e5323f767f5e154ce75e6 12-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c literals: Issue warning and ignore
when BOOL is not of an intergal type when
boolean literals are used. // rdar://11231426


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f7ecc3016e6309a092493070d071489516b273c0 12-Apr-2012 Douglas Gregor <dgregor@apple.com> Compute standard conversion sequences for conversions to atomic
types. The second and third conversions in the sequence are based on
the conversion for the underlying type, so that we get sensible
overloading behavior for, e.g., _Atomic(int) vs. _Atomic(float).

As part of this, actually implement the lvalue-to-rvalue conversion
for atomic types. There is probably a pile of code in SemaExpr that
can now be deleted, but I haven't tracked it down yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
99850388609234e01901e316bca6ca6ffbd09337 12-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c numeric literal: type of boolean is
that of typedef BOOL if found.
// rdar://11231426


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e7ea28a5855beaa828e11f5b1ffe6cf0d6209861 10-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: remove IsConstProperty as it does not
seem to get called any more. Also add an assert in
isModifiableLvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5915561b32212af1179a2cabd894f49b4b0dc016 10-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: add an assertion for property
expression enterring IsConstProperty function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb52f86a62db523e3c993686b3ed92c55d59d53c 09-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix bugs found by -Wconstant-conversion improvements currently under review.

Specifically, using a an integer outside [0, 1] as a boolean constant seems to
be an easy mistake to make with things like "x == a || b" where the author
intended "x == a || x == b".

The bug caused by calling SkipUntil with three token kinds was also identified
by a VC diagnostic & reported by Francois Pichet as review feedback for my
commit r154163. I've included test cases to verify the error recovery that was
broken/poorly implemented due to this bug.

The other fix (lib/Sema/SemaExpr.cpp) seems like that code was never actually
reached in any of Clang's tests & is related to Objective C features I'm not
familiar with, so I've not been able to construct a test case for it. Perhaps
someone else can.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d2008e2c80d6c9282044ec873a937a17a0f33579 07-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement support for null non-type template arguments for non-type
template parameters of pointer, pointer-to-member, or nullptr_t
type in C++11. Fixes PR9700 / <rdar://problem/11193097>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7f39d51d9c8f551fd09c1feee3d8033f5702b2cb 06-Apr-2012 John McCall <rjmccall@apple.com> Fix a Sema invariant bug that I recently introduced involving
the template instantiation of statement-expressions.

I think it was jyasskin who had a crashing testcase in this area;
hopefully this fixes it and he can find his testcase and check it in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ae916a14cf727b4ce3ac316f4fd780d1c83c5baf 06-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Properly implement the C rules for composite types for qualified pointers in conditionals. Patch by Tim Northover.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
73f428cf2c5a0847014a3125b7bb8d271aaa7c65 04-Apr-2012 John McCall <rjmccall@apple.com> Enter an expression evaluation context when parsing
statement-expressions. Prevents cleanups and such from being
claimed by the first full-expression in the block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6c656c3d89523d8ddd143f96e11f6bc16c10c60b 04-Apr-2012 Ted Kremenek <kremenek@apple.com> Remove dead assignment to local variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5bdaac5454d93d1dcdc2319818497b685be56fcf 02-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Finish PR10217: Ensure we say that a special member was implicitly, not
explicitly, deleted in all relevant cases, and explain why.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
100c6491c99e92f6b6e9551d0b0cfe3d65eb306b 30-Mar-2012 John McCall <rjmccall@apple.com> Forbid the block and lambda copy-capture of __autoreleasing variables
in ARC, under the usual reasoning limiting the use of __autoreleasing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a78eca20429e55b041bffcea1938cd0df07a6ebd 28-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: Improve diagnostics and
provide 'fixit' hint when dictionary index
is not of proper type. // rdar://11062080


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
78dae24600a877f52dbb6e58bfd5778754a00974 13-Mar-2012 John McCall <rjmccall@apple.com> Alternate fix to PR12248: put Sema in charge of special-casing
the diagnostic for assigning to a copied block capture. This has
the pleasant side-effect of letting us special-case the diagnostic
for assigning to a copied lambda capture as well, without introducing
a new non-modifiable enumerator for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
36f5cfe4df32af6c5fe01228102512996f566f9d 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3d13c5a1e72ed8f8be9c083791d30643d1b1ec43 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [AST] Reduce Decl::getASTContext() calls.
- This function is not at all free; pass it around along some hot paths instead
of recomputing it deep inside various VarDecl methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1e5bc4ffb2db5b575fb28d7ebffb6bb36b034162 08-Mar-2012 John McCall <rjmccall@apple.com> Don't crash when a statement in a block is ill-formed but
introduces cleanups anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b453ad3214d00acc51c9aa702c76c58354d84b84 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add support for cooked forms of user-defined-integer-literal and
user-defined-floating-literal. Support for raw forms of these literals
to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd66be718f23c8149d74ae8b011b002e11e8d5ba 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> User-defined literal support for character literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9fcce65e7e1307b5b8da9be13e4092d6bb94dc1d 07-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> AST representation for user-defined literals, plus just enough of semantic
analysis to make the AST representation testable. They are represented by a
new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic
properties, including full CodeGen support, are achieved for free by this
representation.

UserDefinedLiterals can never be dependent, so no custom instantiation
behavior is required. They are mangled as if they were direct calls to the
underlying literal operator. This matches g++'s apparent behavior (but not its
actual mangling, which is broken for literal-operator-ids).

User-defined *string* literals are now fully-operational, but the semantic
analysis is quite hacky and needs more work. No other forms of user-defined
literal are created yet, but the AST support for them is present.

This patch committed after midnight because we had already hit the quota for
new kinds of literal yesterday.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
458a7fbe7349c7906fa4ca96c09e6ceb02aa8ea7 07-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c lldb support: don't perform ivar access control check
when debugging. // rdar://10997647


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba66c6c5eb9b8023b985960dff5b92d7aa7c8ad7 07-Mar-2012 Sean Callanan <scallanan@apple.com> Cleanup (style). Thanks to Argyrios for catching
this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ce9c8319f43556d9c3fe2771665483d310d86fd8 06-Mar-2012 Sean Callanan <scallanan@apple.com> Extended the UnknownAnyTy resolver to handle
blocks with unknown return types. This allows
LLDB to call blocks even when their return types
aren't provided in the debug information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
27949f65b089fec7902b2a15d718b3d1b0ccf988 06-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Undo patch for // rdar://10735698



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
abf9d908cce6ffe2ee7b739d98fc7344a4f9fe3b 05-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> patch to optionally warn for block implementations without explicit
return types that return non-void values. // rdar://10735698


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1cb2d742eb6635aeab6132ee5f0b5781d39487d7 02-Mar-2012 Nico Weber <nicolasweber@gmx.de> Add -Wstring-plus-int, which warns on "str" + int and int + "str".

It doesn't warn if the integer is known at compile time and within
the bounds of the string.

Discussion: http://comments.gmane.org/gmane.comp.compilers.clang.scm/47203



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a0e005b06b271f6dd1fdbbeed03d9e14f7f3e6a3 02-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Change diagnostic test for my last patch.
// rdar://10961370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16581335fc32abcbc6ab14eda7af38cf759664b7 02-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure that we instantiate static reference data members of class templates
early, since their values can be used in constant expressions in C++11. For
odr-use checking, the opposite change is required, since references are
odr-used whether or not they satisfy the requirements for appearing in a
constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e853bb34ec1f86e12dcdaa9b5e782fac2117b08f 02-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> c/objc: problem originally reported as an objective-c bug.
But it is in the underlying c part of clang. clang crashes
in IRGen when passing an incomplete type argument to
variadic function (instead of diagnosing the bug).
// rdar://10961370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
88530d5e138f36ea80a7d70c14f37095b8eba85b 01-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Fix the isReferenced bit on parameters in a couple of edge cases. PR12153.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fd819783aafa39b3bfdfcc095270352074ef4734 29-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a couple -Wuninitialized warnings from gcc. Reported by David Greene.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
72b8b1ef9f7fb4f66fefcbd8d82fce2301b851d4 29-Feb-2012 Eli Friedman <eli.friedman@gmail.com> A couple minor bug-fixes for template instantiation for expressions which are sometimes potentially evaluated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ac6260187b6b2f26faa9264d170d649a501f58a9 29-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make the odr-use logic work correctly for constant-expressions. PR12006.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d8ab2ed4b7555b6fde965238222e5099614d7bb 27-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Convert initializer lists to temporaries in CreateBuiltinBinOp. Allows assignment of init lists to built-in types and resolves PR12088.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
03f68788036803c0bad3fe6ea9a4ea31ba195a2b 26-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make sure we don't try to produce a definition of an implicitly-deleted function


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a66eccbf1f26a2a48c59b6e733dde9c79c19f0df 25-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Improve the diagnostic in ARC mode when a conditional with an Objective-C type and void* is used. <rdar://problem/10486347>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ed878af7914df535b32d64f555fa118413186672 25-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement C++11 [over.match.copy]p1b2, which allows the use of
explicit conversion functions to initialize the argument to a
copy/move constructor that itself is the subject of direct
initialization. Since we don't have that much context in overload
resolution, we end up threading more flags :(.

Fixes <rdar://problem/10903741> / PR10456.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
97df54e0c075bc8d6a869597e771dad0c11a2180 23-Feb-2012 Douglas Gregor <dgregor@apple.com> Pull the OpaqueValueExpr's source expression into its constructor, so
that we can correctly compute value-dependence of the OVE.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
f4b7de1cef3007cc0479775638198287384d9af1 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Improve our handling of lambda expressions that occur within default
arguments. There are two aspects to this:

- Make sure that when marking the declarations referenced in a
default argument, we don't try to mark local variables, both because
it's a waste of time and because the semantics are wrong: we're not
in a place where we could capture these variables again even if it
did make sense.
- When a lambda expression occurs in a default argument of a
function template, make sure that the corresponding closure type is
considered dependent, so that it will get properly instantiated. The
second bit is a bit of a hack; to fix it properly, we may have to
rearchitect our handling of default arguments, parsing them only
after creating the function definition. However, I'd like to
separate that work from the lambdas work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ccc1b5eebc6ca8a904c58c0468b9a71483b7c7cf 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement name mangling for lambda expressions that occur within the
default arguments of function parameters. This simple-sounding task is
complicated greatly by two issues:

(1) Default arguments aren't actually a real context, so we need to
maintain extra state within lambda expressions to track when a
lambda was actually in a default argument.
(2) At the time that we parse a default argument, the FunctionDecl
doesn't exist yet, so lambda closure types end up in the enclosing
context. It's not clear that we ever want to change that, so instead
we introduce the notion of the "effective" context of a declaration
for the purposes of name mangling.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dfb80ded6767f7b79a0f1fa4f6921d543ff0a643 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix wrong-code bug: __imag on a scalar lvalue should produce a zero rvalue,
rather than an lvalue referring to the scalar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8b1d32bf63bce17503a979bb99fe008cabc05a0e 18-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused but set variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
68932845a432d2a1dbbc57a84fd85bbb37c90487 18-Feb-2012 Douglas Gregor <dgregor@apple.com> Unify our computation of the type of a captured reference to a
variable; it was previously duplicated, and one of the copies failed
to account for outer non-mutable lambda captures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bd64520ca4e4d4c531637d311f8ea384c912fce8 17-Feb-2012 Douglas Gregor <dgregor@apple.com> Only add 'const' to the type of variables captured in a lambda when
we're capturing it by value in a non-mutable lambda.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7bdc15252ca2415f149ad812f0e5184d758e6105 16-Feb-2012 Douglas Gregor <dgregor@apple.com> Lambda closure types are always considered to be like "local" classes,
even if they are not within a function scope. Teach template
instantiation to treat them as such, and make sure that we have a
local instantiation scope when instantiating default arguments and
static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
f6e2e0291b8964ed41b4325e21dd90b86e791f10 16-Feb-2012 Douglas Gregor <dgregor@apple.com> Implicitly define a lambda's conversion functions (to function
pointers and block pointers). We use dummy definitions to keep the
invariant that an implicit, used definition has a body; IR generation
will substitute the actual contents, since they can't be represented
as C++.

For the block pointer case, compute the copy-initialization needed to
capture the lambda object in the block, which IR generation will need
later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4773654f2700d6fbb20612fbb6763b35860fa74d 15-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce a new initialization entity for lambda captures, and
specialize location information and diagnostics for this entity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
37ce0104b182c9410cf2a76fe5a63a81dac876ac 15-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> If a static data member of a class template which could be used in a constant
expression is referenced, defined, then referenced again, make sure we
instantiate it the second time it's referenced. This is the static data member
analogue of r150518.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
57b9c4e9d85971e20ab0dac3eadabae672c43c62 14-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> If a constexpr function template specialization is referenced, and then the
template is defined, and then the specialization is referenced again, don't
forget to instantiate the template on the second reference. Use the source
location of the first reference as the point of instantiation, though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a73652465bcc4c0f6cb7d933ad84e002b527a643 14-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement support for lambda capture pack expansions, e.g.,

[&values...] { print(values...); }




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
14c598268ff7534d3753ae84eba9b8a81bf0bf8f 14-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Use a simpler (and more efficient) pattern to pad vectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dfca6f53ab97d28d43e3fa2564209df08f3d282c 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce support for template instantiation of lambda
expressions. This is mostly a simple refact, splitting the main "start
a lambda expression" function into smaller chunks that are driven
either from the parser (Sema::ActOnLambdaExpr) or during AST
transformation (TreeTransform::TransformLambdaExpr). A few minor
interesting points:

- Added new entry points for TreeTransform, so that we can
explicitly establish the link between the lambda closure type in the
template and the lambda closure type in the instantiation.
- Added a bit into LambdaExpr specifying whether it had an explicit
result type or not. We should have had this anyway.

This code is 'lightly' tested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9daa7bfdff7256cef693d7bf10084881bcb9253c 13-Feb-2012 Douglas Gregor <dgregor@apple.com> Keep track of the set of array index variables we use when we
synthesize a by-copy captured array in a lambda. This information will
be needed by IR generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f8af98286022f72157d84951b48fde5fb369ab29 12-Feb-2012 Douglas Gregor <dgregor@apple.com> Within the body of a lambda expression, decltype((x)) for an
id-expression 'x' will compute the type based on the assumption that
'x' will be captured, even if it isn't captured, per C++11
[expr.prim.lambda]p18. There are two related refactors that go into
implementing this:

1) Split out the check that determines whether we should capture a
particular variable reference, along with the computation of the
type of the field, from the actual act of capturing the
variable.
2) Always compute the result of decltype() within Sema, rather than
AST, because the decltype() computation is now context-sensitive.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3a45c0e61dfc19f27b8ebcb15dd70159a36f1f9a 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Change the way we store initialization kinds so that all direct inits can distinguish between list and parens form. This allows us to correctly diagnose the last test cases from litb.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5b9cc5df25c2198f270dd1d5c438fdce70d4051d 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Represent C++ direct initializers as ParenListExprs before semantic analysis
instead of having a special-purpose function.

- ActOnCXXDirectInitializer, which was mostly duplication of
AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
ago), is dropped completely.
- MultiInitializer, which was an ugly hack I added, is dropped again.
- We now have the infrastructure in place to distinguish between
int x = {1};
int x({1});
int x{1};
-- VarDecl now has getInitStyle(), which indicates which of the above was used.
-- CXXConstructExpr now has a flag to indicate that it represents list-
initialization, although this is not yet used.
- InstantiateInitializer was renamed to SubstInitializer and simplified.
- ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
always produces a ParenListExpr. Placed that so far failed to convert that
back to a ParenExpr containing comma operators have been fixed. I'm pretty
sure I could have made a crashing test case before this.

The end result is a (I hope) considerably cleaner design of initializers.
More importantly, the fact that I can now distinguish between the various
initialization kinds means that I can get the tricky generalized initializer
test cases Johannes Schaub supplied to work. (This is not yet done.)

This commit passed self-host, with the resulting compiler passing the tests. I
hope it doesn't break more complicated code. It's a pretty big change, but one
that I feel is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6d968363877388f0a0268711d59367907b465ae1 10-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Indexing API: Fully index implict template instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
67b2c554dc12f589471713b7b01e9c94257ae593 10-Feb-2012 Douglas Gregor <dgregor@apple.com> Add test from [expr.prim.lambda]p12, which deals with odr-use and
nested captures. We currently don't get odr-use correct in array
bounds, so that bit is commented out while we sort out what we need to
do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
73d90928c0462daf0665fd7f8e44ca00d896540d 10-Feb-2012 Douglas Gregor <dgregor@apple.com> Add various tests for captures and the reaching scope of the lambda
expression. Implement C++11 [expr.prim.lambda]p12's requirement that
capturing a variable will odr-use it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d6cf912e1e33167452f328d15b98a790c58c03c0 10-Feb-2012 Ted Kremenek <kremenek@apple.com> Revert r145999. This turned out to be a bad idea. Unfortunately, 'id' is used so profusely
in many APIs and large codebases that this made the deprecated warning trigger happy to
the point of not being useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e2c5913c48f66bfec9e58a8ad1d90e5eeffad586 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement C++ [expr.prim.lambda]p2, which bans lambda expressions in
unevaluated operands. Be certain that we're marking everything
referenced within a capture initializer as odr-used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
18fe084d72392a5ceaa1fab7d3f3f0d0f2538069 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement capture-by-copy for arrays in lambdas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
20f87a4cd91b8d76571dc96aece916ac0bdf8b9f 09-Feb-2012 Douglas Gregor <dgregor@apple.com> When we create a non-static data member in the closure object for a
capture, make sure we actually add the field.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1f9a5db047c00f66f4a1ebfc6ae2bf78433036e3 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Factor the logic for capturing variables in a lambda into its own
function; it's going to get longer soon. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
503384f731b5abcbf870b0a5224eb920e631db0a 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Various interrelated cleanups for lambdas:
- Complete the lambda class when we finish the lambda expression
(previously, it was left in the "being completed" state)
- Actually return the LambdaExpr object and bind to the resulting
temporary when needed.
- Detect when cleanups are needed while capturing a variable into a
lambda (e.g., due to default arguments in the copy constructor), and
make sure those cleanups apply for the whole of the lambda
expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1e3767ac5449db6a1ede192d5e4217e34fa61f26 08-Feb-2012 Douglas Gregor <dgregor@apple.com> When computing the type of a local variable reference within a lambda,
only add 'const' for variables captured by copy in potentially
evaluated expressions of non-mutable lambdas. (The "by copy" part was
missing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
200fa53fd420aa8369586f569dbece04930ad6a3 08-Feb-2012 John McCall <rjmccall@apple.com> Revise the SplitQualType interface to make it its own thing instead of
a typedef of std::pair. This slightly improves type-safety, but mostly
makes code using it clearer to read as well as making it possible to add
methods to the type.

Add such a method for efficiently single-step desugaring a split type.
Add a method to single-step desugaring a locally-unqualified type.
Implement both the SplitQualType and QualType methods in terms of that.

Also, fix a typo ("ObjCGLifetime").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
0a29422eb722c0ffbb98b98d8636042b19069f1a 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Misc improvements to the diagnostic when a variable is odr-used in a context that is not allowed to capture variables.

Fixes PR11883.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
56ff283a1f8e4e898568426f56e67a096efd1f80 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a minor regression from my potentially-evaluated expression changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d9922af13edf3ddf8804a41a98d997324fdd58e 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed instantiation of DependentScopeDeclRefExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5bbc385ad2d8e487edfbc2756eaf4fb0b920cfe4 06-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move instantiateTemplateAttribute into the sema namespace, make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f7ccbad5d9949e7ddd1cbef43d482553b811e026 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
0cc5d40e5cb0af88c5487ac660ed259eb2b434ae 04-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Suppress the used-but-not-defined warning for static data members while I look into a rather nasty bug in the new odr-use marking code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
8deabc133c121f6c5561d0b2171a41cb2c29b2ce 03-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move isSentinelNullExpr() from Sema to ASTContext to make it more widely
available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3c0e80e9f2f733b7b56251e9bfd4c1097a81b2f5 03-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Refactor capture in blocks to use new-style capture hooks. Start adding a bit of the code for lambdas. The only visible changes are that we use the C++11 odr-used rules to figure out when a variable is captured, and type-checking in lambdas is slightly more accurate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
4f7dcdbdfc50a244c3f3ca66f15b0b39a56f8f64 02-Feb-2012 Matt Beaumont-Gay <matthewbg@google.com> Pacify gcc's -Wreturn-type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
16e46dd0c284296cea819dfbf67942ecef02894d 01-Feb-2012 Kaelyn Uhrain <rikka@google.com> Make the callback object to Sema::CorrectTypo mandatory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
84b007fae6c0cd30fa07074d34fbe2bf61fa44f9 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Refactor to share code for handling return statements between lambda expressions and block literals. As it turns out, almost all the logic can be shared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cd78e612d6fa8e214e6a6bb0e739a0c3e419df91 25-Jan-2012 Kaelyn Uhrain <rikka@google.com> Avoid correcting unknown identifiers to types where types aren't allowed.

Pass a typo correction callback object from ParseCastExpr to
Sema::ActOnIdExpression to be a bit more selective about what kinds of
corrections will be allowed for unknown identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
466f45a06b654d85e9504e37ccf7255ffe4f0e2b 24-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: Issue a generic diagnostic assigning to
an objc object in any abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7b383e4a3888c2bebc2762a94c23ad1fbb060281 24-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: issue error if assigning objects in fragile-abi too.
// rdar://10731065


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7514f31c8fa3fbb3428d0dca98c32145fb0faaa5 24-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename Sema::isNullExpr() -> Sema::isSentinelNullExpr() which is more descriptive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4f1813e55a13a19d4981d245d1da583c1051305b 23-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Sema::isNullExpr() that contains the checks that
Sema::DiagnoseSentinelCalls() does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
78a542478dd63c2789816dcc1cdab5c9a6eef99b 21-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Fix some comments relating to ExpressionEvaluationContexts. Get rid of a couple of uses of ConstantEvaluated which don't make sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
be25db97e20f72e960d87b52216b9fd9871c620b 21-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Add obvious missing call to MarkDeclarationReferenced.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
71b8fb5d4233420d2ed2f150a54ea61431bd8684 21-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make clang's AST model sizeof and typeof with potentially-evaluated operands correctly, similar to what we already do with typeid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b7ff74a6764ad837ce348bc7dd0f0804e4dbf492 20-Jan-2012 Benjamin Kramer <benny.kra@googlemail.com> Localize variable, remove unused assignment.

Found by the clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b0f9dd22bf469028b2c40eab60ad1019c3e6089d 19-Jan-2012 Tanya Lattner <tonic@nondot.org> A few style changes.
Change CheckVectorLogicalOperands to pass params by ref.
Add another test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
79f0a8262b330f5e1ffeb3af94e80c723d65ee85 18-Jan-2012 Seth Cantrell <seth.cantrell@gmail.com> Fix char literal types in C

L'x' is actually wchar_t

support C11 u and U char literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
93c878ee093f2a233c32b29f074e6a3f511e333f 18-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Fix a couple issues where we didn't correctly delay diagnostics in PotentiallyPotentiallyEvaluated contexts. In preparation for making sizeof() PotentiallyPotentiallyEvaluated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8788491e10a24e70b7282f312c22d74ac478c899 17-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Correctly resolve an overload set passed to an overloaded operator=. PR11784.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
561d3abc881033776ece385a01a510e1cbc1fa92 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unnecessary default cases in switches over enums.

This allows -Wswitch-enum to find switches that need updating when these enums are modified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
55693fbe18e9431dbb0ea9e20d140d8bc6bc4c72 17-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Revert r148271; this requires more thought.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
58219e7f27641bb3c635f17e79b7edc0a955a188 17-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Change the behavior of the lvalue-to-rvalue conversion for varargs in PotentiallyPotentiallyEvaluated contexts so that we model it in a sane way in most cases, and give up for the edge case which hopefully doesn't matter too much.

In preparation for correctly treating sizeof() as a PotentiallyPotentiallyEvaluated context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4f692c27d74e249d6ef8d24792c35f3e5c620e2a 16-Jan-2012 Tanya Lattner <tonic@nondot.org> Add support for OpenCL 1.1 logical operations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7a7ee3033e44b45630981355460ef89efa0bdcc4 16-Jan-2012 David Chisnall <csdavec@swan.ac.uk> Some improvements to the handling of C11 atomic types:

- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.

Still to do:

- Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg.
- Add a signal fence builtin
- Properly set the fenv state in atomic operations on floating point values
- Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context)
- Fix the many remaining corner cases



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
52e4c60e31fee851e2988f7909aebf488e57fc12 16-Jan-2012 David Blaikie <dblaikie@gmail.com> Refactor variables unused under non-assert builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
244ee7b89a483fd3764637abdf95de2893b437d0 15-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Pedantic diagnostic correction: in C++, we have integral constant expressions,
not integer constant expressions. In passing, fix the 'folding is an extension'
diagnostic to not claim we're accepting the code, since that's not true in
-pedantic-errors mode, and add this diagnostic to -Wgnu.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1136ef09ff327c2032ec20e2c2ab87cdbf017b1b 14-Jan-2012 Benjamin Kramer <benny.kra@googlemail.com> Use a smaller vector than SmallVector.

Shrinks OverloadCandidate from 208 to 168 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd9d64547831728dd792654bb26477f5099a2153 14-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Progress towards making isUsed() reflect whether a declaration is odr-used; don't set isUsed for local variables which are referenced in unevaluated contexts. Make other code use isReferenced() (which basically indicates that a declaration isn't dead) where appropriate.

I was forced to change test/SemaCXX/linkage.cpp because we aren't actually modeling extern "C" in the AST the way that testcase expects; we were not printing a warning only because we skipped the relevant check. Someone who actually understands the semantics here should fix that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f2b4f7b6772ccba2ea8aae411ea09d8d32d90015 12-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: do not warn when converting to a const id qualfied by its
list of protools. // rdar://10669694


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
a0b2ba1d0ec27240f922c95b5acd8df905e3d3e0 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Minor refactoring of sentinel warning on blocks. Add a test for this warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
ffbe9b9c64ab2e94b9d48ec56e511f75826fc80a 23-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.

Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1d238ea926bbdd04356ce475934fcd4cac654c4b 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
- variables of reference type
- constexpr variables


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3e9ea0b8cd7c4691d62e385245556be5fded58a7 21-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++ constant expression handling: eagerly instantiate static const integral data
members of class templates so that their values can be used in ICEs. This
required reverting r105465, to get such instantiated members to be included in
serialized ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b5ea9db3cf47e8d4bc60d922331773dbfd265c6f 20-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> objc/c++: Issue diagnostic when free-standing ivar is accessed
in class method instead of crash. // rdar://10593227


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f6702a3927147655206ae729a84339c4fda4c651 20-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Unlike in C++03, a constant-expression is not an unevaluated operand in C++11.
Split out a new ExpressionEvaluationContext flag for this case, and don't treat
it as unevaluated in C++11. This fixes some crash-on-invalids where we would
allow references to class members in potentially-evaluated constant expressions
in static member functions, and also fixes half of PR10177.

The fix to PR10177 exposed a case where template instantiation failed to provide
a source location for a diagnostic, so TreeTransform has been tweaked to supply
source locations when transforming a type. The source location is still not very
good, but MarkDeclarationsReferencedInType would need to operate on a TypeLoc to
improve it further.

Also fix MarkDeclarationReferenced in C++98 mode to trigger instantiation for
static data members of class templates which are used in constant expressions.
This fixes a link-time problem, but we still incorrectly treat the member as
non-constant. The rest of the fix for that issue is blocked on PCH support for
early-instantiated static data members, which will be added in a subsequent
patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
85c60db2131c6d210d4777c3d50bdaf0e69bb8bf 18-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence gcc warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25b009a9d2a79929112d3c28c7dd1730bf5246c8 16-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
60ef308e51c71b760d7f598c1b763ceb7b768148 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
daaefc5381f9aafbb1cb6f88fb5ac6aaf34d65bf 15-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Produce more detailed diagnostics when static_assert condition is not an ICE.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d3d08533116b4ad5ff5d29c88a0e136687297058 14-Dec-2011 Douglas Gregor <dgregor@apple.com> Don't consider an overloaded operator& when the expression is actually
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd1f29b6d686899bfd033f26e16cb1621e5549e8 12-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Prepare constant expression infrastructure for the generation of richer
diagnostics. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f48fdb0937e67f691393f9ffdf75653e5128ea13 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b76a97e91dc4bea0b6b3da06c84e02f50cd351d3 07-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> objc: issue deprecated/unavailable diagnostic when
methods with these attributes are sent to receivers
of 'id' type too. // rdar://10459930


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0586520acb2f368c874943353a222be7f00c3068 03-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> If block literal return type is not specified, return type of the block is
inferred from return types. All the return statements have to agree about the type.
// rdar://10466373


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f1d1ca5b2b40e66d927c2abd16d8baa21af6911f 01-Dec-2011 Douglas Gregor <dgregor@apple.com> When sending a message to a receiver that has "unknown any" type,
force the unknown any type to "id" so that the message send can be
completed without requiring a case. Fixes <rdar://problem/10506646>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
36ef7029ea437c216f0bde2a0d4817d8b15e47b2 29-Nov-2011 Lang Hames <lhames@gmail.com> Test isa<FunctionDecl> to exclude objective-C methods. This ensures the following cast will never fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
70f30c530bc6c8d76a6e18e01dcee62e308355cb 28-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> Remove code made redundant by my previous patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
39b4fc888d2b9b8fe1a9c982964b5054ba1c3c73 28-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> pinpoint name/location of deprecated/unavailable enumerator
whose enum has been made deprecated/unavailable in the warning.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c8ff915c4bafe520548cc29d342951da23591ae1 25-Nov-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works inside a friend function definition at class scope.

Basically we have to look into the parent *lexical* DeclContext for friend functions at class scope. That's because calling GetParent() return the namespace or file DeclContext.

This fixes all remaining cases of "Unqualified lookup into dependent bases of class templates" when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6efd4c55a1a481d92966a91141c03e8145234cf6 23-Nov-2011 Richard Trieu <rtrieu@google.com> Add feature to diagnostics that will provide more information on function
pointer mismatch. Cases covered are: initialization, assignment, and function
arguments. Additional text will give the extra information about the nature
of the mismatch: different classes for member functions, wrong number of
parameters, different parameter type, different return type, and function
qualifier mismatch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6226ae490903717c8c07782f28bc8349543021f 17-Nov-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works inside default argument instantiation.

This is a little bit tricky because during default argument instantiation the CurContext points to a CXXMethodDecl but we can't use the keyword this or have an implicit member call generated.

This fixes 2 errors when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e614d6c6b12f20f0072c20eb312db2e80d1cb051 16-Nov-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, make "Unqualified lookup into dependent bases of class templates" works inside static functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
32509f1e60451d86e9fbc473b6e853ba10b5fd1e 15-Nov-2011 John McCall <rjmccall@apple.com> Resolve placeholder expressions before trying to deduce
'auto'. Introduce a convenience method to make this a bit
easier, and use it elsewhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2bbcd5ce370753c86d312d2c72a97476ac35b073 14-Nov-2011 Ted Kremenek <kremenek@apple.com> ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ddadaa4579dbb12dcfad62ee86e1e52e12f298ee 12-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add missing casts to AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
538773cbfbba03b85d931efe122b743b7b0cc60d 11-Nov-2011 John McCall <rjmccall@apple.com> Be sure to insulate block literals from any cleanups in their
enclosing full-expressions. It is somewhat amazing that
this hasn't come up as a problem before.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
90f7b62aba1ae2d41bfe2286c210b027fc62681f 08-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> objc: Don't crash on missing @interface decl.
// rdar://10415026


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b9c2d235fb9449e249d74f48ecfec601650de93 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c637d738897b1745af3bad7fc551f26b98da838c 02-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> back out changes in r143399 and r143475.
rvale-references are captured by reference
in blocks. // rdar://9971124.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0505321691aa39105ecd2f92bb64cdaa932fbf08 01-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> Find copy constructor needed to copy an rvalue reference
c++ object into block descriptor. // rdar://9971124


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
64f45a24b19eb89ff88f7c3ff0df9be8e861ac97 01-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
treating wide strings as a series of bytes.

Patch by Seth Cantrell.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
51f4708c00110940ca3f337961915f2ca1668375 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c129f818038e0269ba6b095722aa70176dc321d 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ac51650d054c2eaada48d54dba52c08153d2daed 28-Oct-2011 John McCall <rjmccall@apple.com> Be sure to build a dependent expression when we see
a binary operator involving a dependently-typed overload set.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61ffd09797d661ae4ae18674d144a27be2d2f5f3 28-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add missing lvalue-to-rvalue conversion to vector splat casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
8628862a5f3fc739dbaa759599851d0aec3822ca 25-Oct-2011 John McCall <rjmccall@apple.com> Pull the pseudo-object stuff into its own file.
Tidy up some marginally related code just to annoy
single-purpose-commit lovers. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
7c81c2a5915878e4aa6908a097290fd47fb3a154 19-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't forget to complete the objc interface before asking for information,
otherwise lldb will suffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
013e5ce167d72b3617951002f8aea5ff79a37d72 19-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Move static array parameter checks to SemaExpr, per Doug's request

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e0a22d06888c13989b3f72db319f1d498bf69153 18-Oct-2011 John McCall <rjmccall@apple.com> Macro metaprogramming for builtin types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
ea0114313fbfba99f7067a2464c523e96a08e365 18-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Perform lvalue-to-rvalue conversions on __builtin_offsetof array argument index
before typechecking, as suggested by John.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6ec96438ede86b1a00f80dff25027f5a876613a8 17-Oct-2011 Tanya Lattner <tonic@nondot.org> The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e75ce16b4afd7f8a06f25c06bc47952b8bc1210d 17-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Add missing case to switch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5acb0c98b363400f6ade0ae7250f0102224e806b 17-Oct-2011 John McCall <rjmccall@apple.com> Teach the ARC compiler to not require __bridge casts when
passing/receiving CF objects at +0 to/from Objective-C methods
or audited C functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d82e5d30930f80a92c1270e270fdb475e3718d25 17-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Perform an lvalue-to-rvalue conversion on an array index in a __builtin_offsetof expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
909c5553afb68743cf793dd7d5d82bdf5fa0bba7 17-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Slightly simplify a constant expression check. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
28bdb141f3cf004b3fe963990b17f4cca3a8710c 16-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Check for unavailable declarations in Sema::CanUseDecl.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bb13c320fff4bc4b3536e62626c97d7b055c6113 15-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> obj-c++: allow the getter/setter to return/take parameters
by reference. // rdar://10188258


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b8e778da8545624826440366a709d555332ffc73 14-Oct-2011 Douglas Gregor <dgregor@apple.com> Don't try to diagnose anything when we're passing incomplete types
through varargs. This only happens when we're in an unevaluated
context, where we don't want to trigger an error anyway. Fixes PR11131
/ <rdar://problem/10288375>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
597cad65b8c67d930b4d8e787dd81a0ee7c1f3f6 14-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> Fix misplaced comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2e8b97c5fa0fa9070fafce1bf56eef0c35cf114f 14-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> Make value kind based on the return type of the getter, not
property type, for when getter may be a reference type.
// rdar://10188258 revised.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
64a371ff8d525880e519a43fc522cbdc79fc4a89 13-Oct-2011 Douglas Gregor <dgregor@apple.com> HasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ee697e69a2063b65bfd0534248e4848461aca3f4 13-Oct-2011 Douglas Gregor <dgregor@apple.com> Allow calling an overloaded function set by taking the address of the
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a6b8b2c09610b8bc4330e948ece8b940c2386406 10-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation refactoring:
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
44efed03b3ec16148722dfe57e0787a5b5c59741 09-Oct-2011 Douglas Gregor <dgregor@apple.com> Only allow taking the address of an expression of type 'overloaded
function type' when that expression is actually an overloaded function
reference (and not the address of an overloaded function
reference). Fixes PR11066.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a180f04c091bf3ede4fe292ba6a29d61da09e936 07-Oct-2011 John McCall <rjmccall@apple.com> Move type-checking for C-style casts in C into the now-misnamed
SemaCXXCast.cpp. Should have no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c076e37e2223cfe998fa5e657dece30da78fcdc4 07-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implicitly assume that a ObjC category to an unavailable interface is also unavailable;
only give an 'unavailable' error on the @implementation of the category. rdar://10234078

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3a387441ae339363ee5b254658f295e97bd9e913 07-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> When using an unavailable/deprecated interface Foo inside Foo's interface/implementation
don't emit unavailable errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b001de7458d17c17e6d8b8034c7cfcefd3b70c00 07-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.

Thanks to Jeffrey Yasskin for the thorough review!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
53c8167d7a007daae87f342c0fedd03f1dcf1b62 05-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> c: assignment/init of a function pointer whose function(s)
return to one which does not return (has noreturn attribute)
should warn as it is an unsafe assignment. // rdar://10095762
c++ already handles this. This is the c version.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c6ac32283ea3d769ce51407e1aa1d52de6a5a010 03-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> objc++: Accessing explicit property of reference type need
not bind to a temporary. Fixes //rdar://10188258


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
491306a83c4f0f49f95a3bcbca8580cb98a91c7a 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow getting all source locations of selector identifiers in a ObjCMethodDecl.

Instead of always storing all source locations for the selector identifiers
we check whether all the identifiers are in a "standard" position; "standard" position is

-Immediately before the arguments: -(id)first:(int)x second:(int)y;
-With a space between the arguments: -(id)first: (int)x second: (int)y;
-For nullary selectors, immediately before ';': -(void)release;

In such cases we infer the locations instead of storing them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
207180802c836fda8acbedb47a92f9d2bdca59c3 03-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow getting all source locations of selector identifiers in a ObjCMessageExpr.

Instead of always storing all source locations for the selector identifiers
we check whether all the identifiers are in a "standard" position; "standard" position is

-Immediately before the arguments: [foo first:1 second:2]
-With a space between the arguments: [foo first: 1 second: 2]
-For nullary selectors, immediately before ']': [foo release]

In such cases we infer the locations instead of storing them.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1f24076313e3c4921134db555194605c9a1ea49e 03-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: add separate diagnostics for too few/many exec config args

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
af15b4d0aa2da714ff1648ddf6db17154d9a7f26 03-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Add ConvertArgumentsForCall diagnostics for at least/at most n args

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8591a7f5215f6469603e6bc8f4fdbcc78e215ab9 03-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: diagnose unconfigured calls to global functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e82247a71a1a76e78f3b979b64d5f6412ab40266 01-Oct-2011 John McCall <rjmccall@apple.com> Hey, maybe we shouldn't silently ignore decl attributes
on declarators written as types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0f32caff4dc351719ca3362d95f859d72fdd6f1b 30-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> Minor refactoring. Enumerators may inherit the deprecated/unavailable
attributes from the enumeration type.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
97db7265ac1993e14e5877292e23d5ed2e9cf719 29-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> c - Enumerators may inherit the deprecated/unavailable
attributes from the enumeration type.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
39834ba5a9a9e998cc542f683d0e6327b406f088 28-Sep-2011 Eli Friedman <eli.friedman@gmail.com> PR11002: Make sure we emit sentinel warnings with a valid source location. (Ideally, we want to use the location returned by getLocForEndOfToken, but that is not always successful.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
c737acb8e86564becc5939d681089d1851e6be1a 27-Sep-2011 Douglas Gregor <dgregor@apple.com> Revert r139989 and r140031, which implemented the Objective-C type
system change in <rdar://problem/10109725> that allows conversion from
'self' in class methods to the root of the class's hierarchy. This
conversion rule is a hack that has non-trivial repurcussions
(particularly with overload resolution).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
615eb7c477eb0523bfc1d238c57cee9497c874e3 27-Sep-2011 Ted Kremenek <kremenek@apple.com> Fix regression of -Warray-bounds involving varargs functions [PR 11007].

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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fce1a3ab56879a7eb92c7e0b465c1f2c07e0c512 24-Sep-2011 Francois Pichet <pichet2000@gmail.com> [microsoft] In Microsoft mode, if we are inside a template class member function and we can't resolve an identifier then assume the identifier is type dependent. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes.

This fixes a few errors when parsing MFC code with clang.
BTW clang trunk is now about 5 patches away to be able the parse the default wizard-generated MFC project.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc2b91a8f682023acb6543257f7c08f68ea964ae 24-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc - fixes a crash when undefined typed property
followed by it implementation crashes when attempt
is made to access the synthesized ivar.
// rdar://10177744


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
9df05ea69b16e48f2b1cda56c2c341ce77493f4e 22-Sep-2011 Tobias Grosser <grosser@fim.uni-passau.de> In OpenCL, conversions between different vector types are disallowed

OpenCL 6.2.1 says: "Implicit conversions between built-in vector data types are
disallowed." OpenCL 6.2.2 says: "Explicit casts between vector types are not
legal." For example:

uint4 u = (uint4)(1);
int4 i = u; // invalid implicit conversion
int4 e = (int4)u; // invalid explicit conversion

Fixes PR10967. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
37c31c2e050856f87efd652958352181e72e5dea 21-Sep-2011 Tobias Grosser <grosser@fim.uni-passau.de> In the OpenCL mode, the AltiVec mode must be off and checks must be strict

OpenCL is different from AltiVec in the way it supports vector literals. OpenCL
is strict with regards to semantic checks. For example, implicit conversions
and explicit casts between vectors of different types are disallowed.

Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
47456faf29a1eba1a3de55f3c06c82019d28ffd0 21-Sep-2011 Richard Trieu <rtrieu@google.com> Change:

assert(!"error message");

To:

assert(0 && "error message");

which is more consistant across the code base.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a64ccefdf0ea4e03ec88805d71b0af74950c7472 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.

It already works (and is useful with) macro locs as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
71ac1e003b7a82ca6ac7ed76e4d0f9c6d4a1e30a 19-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc - some refactoring of my last 'self' patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1d4e8e9340c9699069a33a74562e883a305f7607 17-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objc - Treat type of 'self' in class methods as root of
class of this method. // rdar://10109725


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
481037f01b7445b42033ef652ad59ccaef3f33fd 16-Sep-2011 Richard Trieu <rtrieu@google.com> Moves calls of checkArithmeticNull() from CreateBuiltinBinOp() into the individual Check*Operands() functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c3ba24f8af1ded9ec494960061f544e953dc4abf 16-Sep-2011 Richard Trieu <rtrieu@google.com> Remove no longer needed LHSType and RHSType from checkArithmeticNull()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5e3a23585f6e2f397be6ead14fee6b9c1b110fb1 16-Sep-2011 Richard Trieu <rtrieu@google.com> Change checkArithmeticNull() to use a NonNullType, instead of checking both the
LHSType and RHSType for everything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
412a49641c9365662b34331d36bf072bc3a228ea 15-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> reverse patch in r139818 to focus on 'self'
instead of 'Class'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7d7ef8298d4711206772ff9eb51f5140536cbeab 15-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> Objective-c: Conversion from type Class to any root class type is allowed
in class methods with no warning. //rdar://10109725


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6eef9fb34c75278f2e17149d33c7957437bd9a1a 12-Sep-2011 Richard Trieu <rtrieu@google.com> Refactor CheckAdditionOperands() to use early return for pointer addition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d9f1934bd0caadf5eab8dcf19671260e13a5f7fe 12-Sep-2011 Richard Trieu <rtrieu@google.com> Fix two comments from warn to emit error to match the actual diagnostic used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cb4d7c202e74783d9c820f155ae27605aa9f5c16 12-Sep-2011 Hans Wennborg <hans@hanshq.net> Silence ?: precendence warning when parenthesis are present.

Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
3323fad09e9f2c280e0dbe767be398203bb0c6ac 09-Sep-2011 John McCall <rjmccall@apple.com> Clean up the sentinel-attribute checking code a lot. Document
what 'nullPos' is supposed to mean, at least at this one site.
Use closed forms for the arithmetic. Rip out some clever but
ultimately pointless code that was trying to use 0 or 0L depending
the size of a pointer vs. the size of int; first, it didn't work
on LLP64 systems, and second, the sentinel checking code requires
a pointer-typed value anyway, so this fixit would not have actually
removed the warning.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5e4c80b43fae03bc56b68fe08089e6cffe9ba6fc 09-Sep-2011 Richard Trieu <rtrieu@google.com> Clean up the RebuildUnknownAnyExpr visitor in SemaExpr.cpp. Mainly swapped around variable names so that this visitor be more like other visitors in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ccd891ae75e9678f1138868e50508c8083d021fa 09-Sep-2011 Richard Trieu <rtrieu@google.com> Capitialize paramater names in SemaExpr.cpp and resolve any parameter name conflicts between declarations and definitions from this and previous refactorings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5520f23edb421a1f87d8d3b1356b3919114f6d88 07-Sep-2011 Richard Trieu <rtrieu@google.com> Change diagnoseAddressOfInvalidType() to use an enum to determine what error message to display. Also, move the function call into on location instead of having it spread among many places in the if/else statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
befece14a371a963568a922fed74dbec0d4a0c11 07-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseLogicalAndInLogicalOrLHS()
DiagnoseBinOpPrecedence()
ActOnBinOp()
BuildBinOp()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
78ea78bda17d54548fc7b8afa1c9aecafc9cf622 07-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CreateBuiltinBinOp()
DiagnoseBitwisePrecedence()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
268942b22464c7364e2c6868915484cd4b7596f7 07-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckAssignmentOperands()
DiagnoseSelfAssignment()
checkArithmeticNull()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9f60dee66e76a20302aecdf677236ff030bf157b 07-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckVectorCompareOperands()
CheckBitwiseOperands()
CheckLogicalOperands()


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f1775fb1081db58015e6d9e4a2fd83bed440a296 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckCompareOperands()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba26149eb7b20bc9d4ed0581aefe7237b2a08fd8 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
checkEnumComparison()
diagnoseDistinctPointerComparison()
convertPointersToCompositeType()
diagnoseFunctionPointerToVoidComparison()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c8cfbfc8b42e47e3a3597fbb28a15042aa219ed 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseBadShiftValues()
CheckShiftOperands()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
def75847c537eb56e0f548cca5d2b60a76f58a79 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
diagnoseArithmeticOnTwoVoidPointers()
checkArithmeticBinOpPointerOperands()
diagnosePointerIncompatibility()
CheckAdditionOperands()
CheckSubtractionOperands()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
08062aaaa5e32a9a313109a53afc1e13d3689eb5 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckVectorOperands()
CheckMultiplyDivideOperands()
CheckRemainderOperands()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f8b7f7177d722d254e255a7754446148ef514789 06-Sep-2011 Douglas Gregor <dgregor@apple.com> Implement the Named Return Value Optimization (NRVO) for blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f7720da157f84cc8cd4974ad1e804fc2fd03de6f 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckTransparentUnionArgumentConstraints()
CheckSingleAssignmentConstraints()
InvalidOperands()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
facef2ef39f5468068b60da26f9f9049115a361d 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
CheckAssignmentConstraints()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1da27a1caa3c54849db0e5314dd013166a7677a7 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
checkPointerTypesForAssignment()
checkBlockPointerTypesForAssignment()
checkObjCPointerTypesForAssignment()
CheckAssignmentConstraints()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
33fc7571026084f86745df14c95b40ce46d73f43 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
DiagnoseConditionalForNull()
CheckConditionalOperands()
IsArithmeticBinaryExpr()
DiagnoseConditionalPrecedence()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5cc86807bb5510a797c75bf58ee97c416ad4a3c0 06-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Spelling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2e8a95dd3c6194f48e610104882195399fe5135e 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleIntegerConversion()
UsualArithmeticConversions()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8ef5c8ef41b8578ac754815c57728c3a3e6b422c 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleFloatConversion()
handleComplexIntConvsersion()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cafd30b4cd2f1a18baecb0ae7dc5f2351b8b8bcb 06-Sep-2011 Richard Trieu <rtrieu@google.com> Rename variables in SemaExpr.cpp to give a more consistant naming scheme.

ExprResult LHS, RHS,
Expr *LHSExpr, *RHSExpr
QualType LHSType, RHSType

Functions changed:
handleComplexFloatToComplexFloatConverstion()
handleComplexFloatConversion()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f740012171d549c02288087044073ae3fc13622b 05-Sep-2011 Francois Pichet <pichet2000@gmail.com> Pass 0 instead of a empty TemplateArgumentListInfo when creating a CXXDependentScopeMemberExpr to handle a "this->" fixit (lookup into dependent bases of class template)

Otherwise the fixit doesn't really work for subsequent lookup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fec0959f95454b4241e3060408656e8fbe4ac6c1 03-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> More unused variable removal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d77ba899b3ed39aa4bdba22aabc4bcd5ca6effdf 03-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Make helpers static, remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
43dff1bdac7b2788ccbfa0b7be85e3aa0e20ac70 02-Sep-2011 Richard Trieu <rtrieu@google.com> Fix some indenting issues in SemaExpr.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8289f49c0c094bacdac9cc0da8882042506e3fc1 02-Sep-2011 Richard Trieu <rtrieu@google.com> Refactor UsualArithmeticConversions() in SemaExpr.cpp into several functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e648ac33e52c0c28914abdf8969b01ccf892924f 02-Sep-2011 Richard Trieu <rtrieu@google.com> Move the warning for different enum comparisons and the warning for using NULL as a non-pointer in a binary operation into separate functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7be1be0d5e1395f9a05ed90379f4940d54646245 02-Sep-2011 Richard Trieu <rtrieu@google.com> Reduce code duplication for pointer comparisons in CheckCompareOperands().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
097ecd2c57916576db8c344db47d6819f89bb13e 02-Sep-2011 Richard Trieu <rtrieu@google.com> Pull out incomplete pointer type checking code, used from arithmetic checking functions, into its own function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
26f960774e411bc1e37caed6b6a51db56fa6a2ad 02-Sep-2011 Richard Trieu <rtrieu@google.com> Refactor CheckConditionalOperands() by moving chunks of code to helper functions making a slimmer function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
09a26ad31d63b3faa9f1fe0041156746da84cdf5 02-Sep-2011 Richard Trieu <rtrieu@google.com> Refactor CheckAddressOfOperand() by pulling out redundant code and moving hard coding strings from SemaExpr.cpp to DiagnosticSemaKinds.td.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
db44a6b00768a14e8a4d388d67edef61a1ae2d63 02-Sep-2011 Richard Trieu <rtrieu@google.com> Refactor CheckAdditionOperands(), CheckSubtractionOperands(), and CheckIncrementDecrementOperand() in SemaExpr.cpp to move reused code to separate functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8697d308c1bdd50e5c45757ac11be701c26e9e97 01-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: this patch (re)introduces objective-c's default property
synthesis. This new feature is currently placed under
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon.
// rdar://8843851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
819e74544a326b90d13aa73e6497b187c6545ff5 31-Aug-2011 John McCall <rjmccall@apple.com> Don't assert when diagnosing a missing cast of an unknown-anytype
message send to an unknown method.

rdar://problem/9416370, redux.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
85ea7aa961deac1d754f610af8062ae3f8b4e2a5 30-Aug-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Declare and define implicit move constructor and assignment operator.

This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
709bca84cfdd9ca41518e4ef3797abdf172b9947 30-Aug-2011 John McCall <rjmccall@apple.com> Update the comment on the default-argument conversion fix; thanks to
Johannes Schaub for talking me around to sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
96a914a50cb8c01be8a3b7481cc4791e19c4285b 28-Aug-2011 John McCall <rjmccall@apple.com> Disable the l-value to r-value conversion on C++ class types passed
to varargs functions in unevaluated contexts. AFAICT, there is no
standards justification for this, but it matches what other compilers do
and therefore preserves compatibility with certain template metaprogramming
idioms.

Should fix self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5f8d604246976a93a73549b07bbc8ee0b2061b50 27-Aug-2011 John McCall <rjmccall@apple.com> The lvalue-to-rvalue on structs in C++ is actually part
of default argument promotion and needs to happen unconditionally.
This is particularly semantically important in C++0x.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7b2f51c758a14205f4c4215d7dc04a4cf3947b8a 26-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Don't assert on taking the address of a non-type template parameter. Fixes PR10766.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
66c203051f052cb2f9c550338fd966075a5bdcee 26-Aug-2011 John McCall <rjmccall@apple.com> In -Wno-error=non-pod-varargs, initialize a temporary with
the crazy comma expression so that we get an r-value in the
varargs position.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b33c19fef2b227cd2d8f1de0bcfc157d9e264b21 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Switch this code to use the more idiomatic 'dyn_cast' pattern.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9b127f3b44e685cbe513595b7e0115b0884b0604 15-Aug-2011 Matt Beaumont-Gay <matthewbg@google.com> Add fixit notes for -Wconstant-logical-operand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
79e610a99b43b9e6df8f9b6b59dbaf5d38a682d3 12-Aug-2011 Richard Trieu <rtrieu@google.com> The current warning in -Wnull-arithmetic for comparisons between NULL and non-pointers is not very helpful. This patch will update the wording to be more helpful to users.

Old warning:

warning: use of NULL in arithmetic operation [-Wnull-arithmetic]
return 10 <= NULL;
^ ~~~~

New warning:

warning: comparison between NULL and non-pointer ('int' and NULL) [-Wnull-arithmetic]
return 10 <= NULL;
~~ ^ ~~~~


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
01a4cf11777bb34c35f5d251a9e95eb736d0842b 11-Aug-2011 Douglas Gregor <dgregor@apple.com> Encapsulate the Objective-C id/Class/SEL "redefinition" types in
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
70979d4de873382d0ba13b5bd8fb3ee797384582 11-Aug-2011 Richard Trieu <rtrieu@google.com> Refactoring of DiagnoseBitwisePrecedence() in SemaExpr.cpp to reduce code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a19950edd94c1b80e73c9f45d821b125bd0ee72f 10-Aug-2011 John McCall <rjmccall@apple.com> Change an assert into a check. I'm pretty sure there was a point
in time when this assert was valid, but it's not valid now.
Also teach this code to correctly introduce function-to-pointer
decay.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
adc7a739301d123914b7124e749b7ec74fa91397 08-Aug-2011 Kaelyn Uhrain <rikka@google.com> Make sure FunctionDecls aren't considered during overload resolution if there
are explicit template args.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
844d5728557a324fe10ad990dd537e59780873ef 05-Aug-2011 Kaelyn Uhrain <rikka@google.com> Fix a small bug where DiagnoseEmptyLookup would no longer print any messages
when performing typo correction involving any overloaded template functions.

The added test cases, while currently demontrating sub-optimal behavior, will
not trigger any messages without the 1-line change to SemaExpr.cpp.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
67e29334f2b1affe7a634d492b1db8ce0eb2f1b7 02-Aug-2011 Richard Trieu <rtrieu@google.com> Fix formatting of SemaExpr.cpp, mainly fixing lines greater than 80 characters.
No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f78c4e57122dad4430329135b966dfc241a6425b 30-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce a Fix-It for the "missing sentinel" warning, adding an
appropriate sentinel at the end of the argument list. Also, put the
sentinel warnings under -Wsentinel. Fixes <rdar://problem/8764236>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4eb7522e70a7212328089f0ef490380a9ba322a3 30-Jul-2011 Douglas Gregor <dgregor@apple.com> When complaining about a non-POD second argument to va_arg, use a
special diagnostic for ARC ownership-qualified types. We wouldn't want
to expose Objective-C programmers to the term "POD", would we? Fixes
<rdar://problem/9772982>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9aab1489866a5afe1a8a3267f9ad7124034fd644 29-Jul-2011 Peter Collingbourne <peter@pcc.me.uk> Fix an inconsistency in Sema::ConvertArgumentsForCall in that
the callee note diagnostic was not emitted in the case where
there were too few arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
2760455396abd72f0842122170dfab6126c46891 26-Jul-2011 Kaelyn Uhrain <rikka@google.com> Revert r136046 while fixing handling of e.g. &foo[index_one_past_size]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b48f7c059e74cd5395ca542c1a96be16e42f3d80 26-Jul-2011 Kaelyn Uhrain <rikka@google.com> Expand array bounds checking to work in the presence of unary & and *,
and to work with pointer arithmetic in addition to array indexing.

The new pointer arithmetic porition of the array bounds checking can be
turned on by -Warray-bounds-pointer-arithmetic (and is off by default).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
22f7bb7e7742bd65e903ef4c4a738d9e01e5d08c 26-Jul-2011 Kaelyn Uhrain <rikka@google.com> Test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
61b4bc80e943578ae855810918a1dc9697dbd15b 16-Jul-2011 Tanya Lattner <tonic@nondot.org> This handles the missing cases of opencl vector literals.
Test cases provided by Anton Lokhmot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e5adf59d3a2699752d4981f03927459a38b2df18 15-Jul-2011 Richard Trieu <rtrieu@google.com> Remove warnings of constant operands of logical operators from template instantiations. Upon instantiation of template, value-dependent parameters are replaced by equivalent literals, so code like:

template<unsigned int A, unsigned int B> struct S {
int foo() {
int x = A && B;
}
}

will not warn on A && B on every instantiation. This will still warn on other cases inside templates, which will be caught on checking the template definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
48218c60d6b53b7880917d1366ee716dec2145ca 13-Jul-2011 John McCall <rjmccall@apple.com> In debugger mode, make ObjC message sends to unknown selectors return
__unknown_anytype, and rewrite such message sends correctly.

I had to bite the bullet and actually add a debugger support mode for this
one, which is a bit unfortunate, but there really isn't anything else
I could imagine doing; this is clearly just debugger-specific behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
98a5403ecf1d2b60ae8cbf43e54194bd762cacaa 12-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a bug where a local variable named 'self' is causing
implicit ivar accesses to go through the 'self' variable
rather than the real 'self' for the method. // rdar://9730771


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d248619cd1a5e13bb8fb19e97e3e923d792bfea3 12-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Pop block scope after reading from it.

Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
701d1e77aca7e86348386fdeadcd56ca650f95ad 12-Jul-2011 Hans Wennborg <hans@hanshq.net> Fix typo correction crash on overloaded functions, pr10283.

It would be cool if we could do overload resolution to suggest
the right function, but at least this fixes the crashing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
46d37c10404097eed7c173b17e52693edcb66486 11-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Add diagnostic for constructs like "va_arg(l, float)" which have undefined behavior. PR10201.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4e7c7f2b78ac3930e45f00626ef6acf08b3f80ca 11-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc-arc: Diagnose when captured variable in block literals
require destruction and there is possibility of that without
construction. Thanks Johnm for review and suggestions offline.
// rdar://9535237.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
7a084ec568f8336ec6f10011d0118a6b19e253cb 08-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc++-arc: diagnose assignment/cast of a weak-unavailable
object to a __weak object/type. // rdar://9732636.
One item is yet todo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
04e5a2509d1eed48cc0c7115c52089bef35b36af 07-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objc-arc: diagnose assignment/cast of a weak-unavailable
object to a __weak object/type. // rdar://9732636.
This is objc side of things. objc++ side tbd.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0a85183be6930571f3af8e5a976d24c3f95e5b25 02-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [ARC] When casting from a pointer to an objective-c object with known ownership, if the
cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type
to the cast type:

id x;
(NSString**)&x; // Casting as (__strong NSString**).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
707f101d3302b76ee01e8ca29b1a61f081137b9f 02-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Remove Sema::ActOnCastOfParenListExpr and move most of its functionality to
newly introduced Sema::BuildVectorLiteral.
-Make Sema::ActOnCastExpr handle a vector initializer both when the cast'ed expression
is a ParenListExpr and when it is a ParenExpr.
-Ultimately make Sema::ActOnParenOrParenListExpr independent of what the cast type was.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d8bba9c15230d2b1b3893e272106aa79efc50251 28-Jun-2011 Douglas Gregor <dgregor@apple.com> Add support for C++ namespace-aware typo correction, e.g., correcting

vector<int>

to

std::vector<int>

Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes
PR5776/<rdar://problem/8652971>.

Thanks Kaelyn!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6628969c3e3886b68d8a0051df7e222aa50ef118 27-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Cleanup a fixme by using a specific diagnostic for subscripting
a pointer to void.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
13b21be065e9feb0759303bd51b8e8653130f0fb 27-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Factor out (some of) the checking for invalid forms of pointer
arithmetic into a couple of common routines. Use these to make the
messages more consistent in the various contexts, especially in terms of
consistently diagnosing binary operators with invalid types on both the
left- and right-hand side. Also, improve the grammar and wording of the
messages some, handling both two pointers and two (different) types.

The wording of function pointer arithmetic diagnostics still strikes me
as poorly phrased, and I worry this makes them slightly more awkward if
more consistent. I'm hoping to fix that with a follow-on patch and test
case that will also make them more helpful when a typedef or template
type parameter makes the type completely opaque.

Suggestions on better wording are very welcome, thanks to Richard Smith
for some initial help on that front.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
921c14322977253a60dcb171f45e468c95fe41f8 24-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> objc-arc: Check on a variety of unsafe assignment of retained
objects. // rdar://9495837


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
2b1ad8b42bbbe00a1845e566f52f1941b8dbc725 23-Jun-2011 Douglas Gregor <dgregor@apple.com> Move all of Sema's member-access-related checking out of SemaExpr.cpp
and into a new file, SemaExprMember.cpp, bringing SemaExpr.cpp just
under 10,000 lines of code (ugh). No functionality change, although I
intend to do some refactoring of this code to address PR8368 at some
point in the "near" future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4f0845ec62d5fb8be5d07adc09c54944ab952e5c 23-Jun-2011 Douglas Gregor <dgregor@apple.com> Check for placeholders early on in
Sema::CreateUnaryExprOrTypeTraitExpr() rather than recursing in some
cases. Fixes <rdar://problem/9659191>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d9106fc97cde979a995e26b18bcd2643f8afb55 22-Jun-2011 Manuel Klimek <klimek@google.com> Changes ParenListExpr to always require a type.
Removes dead code found in the process.
Adds a test to verify that ParenListExprs do not have NULL types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b27c7a199baaf691c724951a1bf3e6df9dcf5b6d 22-Jun-2011 Douglas Gregor <dgregor@apple.com> Fix the starting location of the Fix-It note for suspicious precedence
issues between a bitwise operator and a comparison operator. Fixes
<rdar://problem/9637759>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d5353cfb15e387a6e17da289f5da651530d827a 22-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Revert r133526 which re-orders the suggestions for -Wparentheses on ?:
operators. There is a consistent design of having the "silence the
warning" option first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1b132906ad580755e501ad0b3862e2d5a34106d1 21-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Switch the order of the notes for the parentheses suggested in the case
of: a + b ? x : y. In our testing of this flag we've yet to hit a single
case where the existing precedence was correct, so we should suggest
grouping the ?: first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
65aa6885818d4b4eea2e5a9d12085b2398148662 21-Jun-2011 Jay Foad <jay.foad@gmail.com> Make more use of llvm::StringRef in various APIs. In particular, don't
use the deprecated forms of llvm::StringMap::GetOrCreateValue().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
33f46e22b7fc3b75c34b6d892790f80869da0300 20-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn for un-parenthesized '&' inside '|' (a & b | c), rdar://9553326.

Patch by Henry Mason with tweaks by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ae0bafa229d076a0fb90b5aeccea7e3039c58751 20-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a problem with the diagnostics of invalid arithmetic with function
pointers I found while working on the NULL arithmetic warning. We here
always assuming the LHS was the pointer, instead of using the selected
pointer expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1567a8ba8daaaa91a5de3c23026c9c19de017bd1 20-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Move away from the poor "abstraction" I added to Type. John argued
effectively that this abstraction simply doesn't exist. That is
highlighted by the fact that by using it we were papering over a more
serious error in this warning: the fact that we warned for *invalid*
constructs involving member pointers and block pointers.

I've fixed the obvious issues with the warning here, but this is
confirming an original suspicion that this warning's implementation is
flawed. I'm looking into how we can implement this more reasonably. WIP
on that front.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc8d7f9fd4346cfcc285868be32b74e019a40f01 20-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Restructure the API in Type based on a conversation with Richard Smith.
This makes 'isPointerLikeType' a little less confusing, and pulls the
decay check into a separate interface that is much more clear and
concrete. Also, just implement these as logical wrappers around other
predicates. Having a switch based implementation isn't likely to be
necessary. We can try to optimize them later if they show up on
a profile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2af68e4761ed30181540dafb5572993daffa4910 19-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Add test cases for false positives on -Wnull-arithmetic from Richard
Trieu, and fix them by checking for array and function types as well as
pointer types.

I've added a predicate method on Type to bundle together the logic we're
using here: isPointerLikeType(). I'd welcome better names for this
predicate, this is the best I came up with. It's implemented as a switch
to be a touch lighter weight than all the chained isa<...> casts that
would result otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ed3b2565696098af2b05b37ad3a747a1078b9df4 17-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Add a minor hack to avoid using isNullPointerConstant on a hot path. Fixes -O0 compile-time regressions from r133196.

rdar://9629775 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
12189f573f5dafb7fa33e8dc32ff06cd6fd35963 17-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't emit 'unavailable' errors inside an unavailable function. rdar://9623855.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7acddacc921cd0b3f813443a8641eeddb82dfbd4 17-Jun-2011 John McCall <rjmccall@apple.com> Objective-C fast enumeration loop variables are not retained in ARC, but
they should still be officially __strong for the purposes of errors,
block capture, etc. Make a new bit on variables, isARCPseudoStrong(),
and set this for 'self' and these enumeration-loop variables. Change
the code that was looking for the old patterns to look for this bit,
and change IR generation to find this bit and treat the resulting
variable as __unsafe_unretained for the purposes of init/destroy in
the two places it can come up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
751ec9be961888f14342fb63b39bf8727f0dee49 17-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement proper support for generating code for compound literals in
C++, which means:
- binding the temporary as needed in Sema, so that we generate the
appropriate call to the destructor, and
- emitting the compound literal into the appropriate location for
the aggregate, rather than trying to emit it as a temporary and
memcpy() it.

Fixes PR10138 / <rdar://problem/9615901>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8d5e18c69e007f5d0f447b4a716088589a827857 17-Jun-2011 Douglas Gregor <dgregor@apple.com> Check for placeholder expressions before promoting an argument passed
through an ellipsis. Fixes <rdar://problem/9623945>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3e95ba94fd34c5f6420c57d7732f601875074681 16-Jun-2011 Richard Trieu <rtrieu@google.com> Add a new warning when a NULL constant is used in arithmetic operations. The warning will fire on cases such as:

int x = 1 + NULL;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16cd4b744ada95eedeca6d90702739f0262309d4 16-Jun-2011 Douglas Gregor <dgregor@apple.com> Allow comparison between block pointers and NULL pointer
constants. Fixes PR10145.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b1f7d2496a2916cfad17633e403151dd09118821 16-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> arc: diagnose dereferencing a __weak pointer which may be
null at any time. // rdar://9612030


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f0b60d6a945b907f890e0bbc2aa02b5aa2bc62e3 16-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Refactor parentheses suggestion notes to have less code duplication and
be more consistent in how parenthesized ranges which hit macros are
handled. Also makes the code significantly shorter, and the diagnostics
when macros are present a bit more useful.

Pair programmed w/ Matthew.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
43bc78dd447ade24e254fdb2ed5d7a2b0995818c 16-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Cleanup the parameter naming style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
cf739927f9b00c801867f620b04b79e3259c311f 15-Jun-2011 Nico Weber <nicolasweber@gmx.de> Warn on "void f(int a[10]) { sizeof(a); }"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fa821380182f00eddfa536280b5a103c59e5c1c4 15-Jun-2011 Ted Kremenek <kremenek@apple.com> Sema: show shift result in hexadecimal

Change the output for -Wshift-overflow and
-Wshift-sign-overflow to an unsigned hexadecimal. It makes
more sense for looking at bits than a signed decimal does.
Also, change the diagnostic's wording from "overrides"
to "sets".

This uses a new optional argument in APInt::toString()
that adds the '0x' prefix to hexademical numbers.

This fixes PR 9651.

Patch by nobled@dreamwidth.org!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0adde128d96a73864569516e684faa570e3c0333 14-Jun-2011 David Majnemer <david.majnemer@gmail.com> Properly diagnose using abstract and incomplete types in va_arg

- Move a test from test/SemaTemplate/instantiate-expr-3.cpp, it did not belong there
- Incomplete and abstract types are considered hard errors


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
db11b0187bafe77263036eafc3977fa5da3bcf1a 13-Jun-2011 David Majnemer <david.majnemer@gmail.com> Give a diagnostic when using non-POD types in a va_arg


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
2f072b442879b8bba8c5dea11d7c61bedb1924ae 09-Jun-2011 Hans Wennborg <hans@hanshq.net> Handle overloaded operators in ?: precedence warning

This is a follow-up to r132565, and should address the rest of PR9969:

Warn about cases such as

int foo(A a, bool b) {
return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}

also when + is an overloaded operator call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
af9cddfda10802f948e9d4b44ebded1ec749de21 08-Jun-2011 Peter Collingbourne <peter@pcc.me.uk> Modify a diagnostic introduced in r132612 to emit QualTypes directly

This fixes a memory error on FreeBSD (and is the right thing to do
in any case).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61eee0ca33b29e102f11bab77c8b74cc00e2392b 04-Jun-2011 Tanya Lattner <tonic@nondot.org> Add support for builtin astype:
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types.
Added test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9cfdae3144fc004cf203b05288f4dab49097ce7b 03-Jun-2011 Hans Wennborg <hans@hanshq.net> Warn about missing parentheses for conditional operator.

Warn in cases such as "x + someCondition ? 42 : 0;",
where the condition expression looks arithmetic, and has
a right-hand side that looks boolean.

This (partly) addresses http://llvm.org/bugs/show_bug.cgi?id=9969

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
17e37c7959d60d8bfcbc8cb5630d3101ae583be5 01-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement comparisons between nullptr and Objective-C object
pointers. Fixes PR10052.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0683a1418b28b289eca4cb602ac69780f9e0a609 31-May-2011 Chandler Carruth <chandlerc@gmail.com> Expand the coverage of the warning for constants on the RHS of logical operands:

return f() || -1;

where the user meant to write '|'.

This bootstraps without any additional warnings.

Patch by Richard Trieu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e72c55b9a11be9f00fa3f66f7ad6b73b2814e963 29-May-2011 Chandler Carruth <chandlerc@gmail.com> Fix a regression in the source locations for unary trait expressions.
I tried to use an assert to prove that I could remove each of the
arguments I did, but ended up writing my assert with inverted logic.
Doh! Reported by Xi Wang on cfe-dev. I have manually verified the source
locations and ranges for these using -ast-dump. I tried writing a test
case that would catch these, but these expressions aren't exposed in the
c-index-test's token annotation utility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e4d645cbe073042d8abc1a4eb600af4ff7a8dffb 27-May-2011 Chandler Carruth <chandlerc@gmail.com> Enhance Clang to start instantiating static data member definitions
within class templates when they are necessary to complete the type of
the member. The canonical example is code like:

template <typename T> struct S {
static const int arr[];
static const int x;
static int f();
};

template <typename T> const int S<T>::arr[] = { 1, 2, 3 };
template <typename T> const int S<T>::x = sizeof(arr) / sizeof(arr[0]);
template <typename T> int S<T>::f() { return x; }

int x = S<int>::f();

We need to instantiate S<T>::arr's definition to pick up its initializer
and complete the array type. This involves new code to specially handle
completing the type of an expression where the type alone is
insufficient. It also requires *updating* the expression with the newly
completed type. Fortunately, all the other infrastructure is already in
Clang to do the instantiation, do the completion, and prune out the
unused bits of code that result from this instantiation.

This addresses the initial bug in PR10001, and will be a step to
fleshing out other cases where we need to work harder to complete an
expression's type. Who knew we still had missing C++03 "features"?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
42ec65df778ec3faa7a7fb73caa2bca2422a0e67 26-May-2011 Chandler Carruth <chandlerc@gmail.com> Extract two more methods from the unary type trait checking. These
provide re-usable forms of the rest of the custom validation done here.
Still no functionality changed here.

With this it should be possible to have an expression-centric code path
and a type-centric code path which don't duplicate logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e2250304ca0a809693a48f84b7e886f55d004df4 26-May-2011 Chandler Carruth <chandlerc@gmail.com> Remove a no longer relevant comment. It was just repeating the
information in the previous comment which was preserved and moved with
the vec_step implementation code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
df1f377cae15c9607539cbcb5b8c9f4f0cf7d7d8 26-May-2011 Chandler Carruth <chandlerc@gmail.com> Extract the vec_step trait operand checking to a stand alone function.
It has little overlap with other traits' requirements, so the resulting
code is actually simpler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d342d0121531bcbd2410f600a751dc85993bdee 26-May-2011 Chandler Carruth <chandlerc@gmail.com> Add a convenience interface for checking expression arguments to unary
traits which uses the information embedded in the expression. Use this
to simplify several interfaces which repeated information embedded in
the expression through explicit arguments. I added an assertion that the
only extra piece of data to come in from the parser matches what is
stored in the expression. No functionality change intended here.

Also cleaned up the doxygen comments for some of these methods and some
formatting oddities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
930a9abb7eb171d706c9e17a27bbcd267f0d9b3d 21-May-2011 Douglas Gregor <dgregor@apple.com> Fix our handling of the warning when one tries to pass a
non-POD/non-trivial object throuugh a C-style varargs. The warning
itself was default-mapped to error, but can be downgraded, but we were
treating it in Sema like a hard error, silently dropping the call.

Instead, treat this problem like a warning, and do what the warning
says we do: abort at runtime. To do so, we fake up a __builtin_trap()
expression that gets evaluated as part of the argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0fd228d48bbf05d08d9b408023d7c8ddb681bc91 21-May-2011 Douglas Gregor <dgregor@apple.com> Implement C++0x semantics for passing non-POD classes through varargs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
509f048825d309ca84db136abee32da0c6acffc0 14-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Make sure we actually generate defaulted copy constructors; caught by
Howard Hinnant. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2b188085eccf741a9520ba86f1e6e32d0e0cd3f2 14-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> What I hope to be an implementation of defaulted copy assignment
operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
49634cf3b9b0c3da2aedc3bdefbf331bce167239 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Defaulting copy constructors now works reasonably well.

One more special member to go

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
1e23865d0e148a3951a9b418e57b7e0762dc3098 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Make it so that we actually generate definitions for explicitly
defaulted default constructors.

As it happens, making sure that we handle out-of-line defaulted
functions properly will involved making sure that we actually parse them
correctly, so that's coming after.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
c9366ba8fff6461a5b7f0fd2626d1bce3e98e629 05-May-2011 Matt Beaumont-Gay <matthewbg@google.com> Implement Sema::isExprCallable.

We can use this to produce nice diagnostics (and try to fixit-and-recover) in
various cases where we might see "MyFunction" instead of "MyFunction()". The
changes in SemaExpr are an example of how to use isExprCallable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f4bbbf0aaf741cc7d014e2cf059670a6756f8cbd 02-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a warning for when reinterpret_cast leads to undefined behavior, patch by Richard Trieu!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f79a71908d6f28cb2bc0c081d9a801ed14d61d82 29-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Add a decl update when a static data member of a class template is instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
642a75f883e644bcfbb82e7af0313776ad1ce33c 28-Apr-2011 John McCall <rjmccall@apple.com> When block-capturing a variable with a non-trivial destructor,
make sure to mark the destructor. This normally isn't required,
because the destructor should have been marked as part of the
declaration of the local, but it's necessary when the variable
is a parameter because it's the call sites that are responsible
for those destructors.



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
8a285ae6fc4926cc4e419025eec63e2d6696e13f 26-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses rdar://9269271.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
abdd3b3861a8a5f971ea8fbcb42a9fb179b0a57d 26-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For the warnings related to -Wparentheses, display first the note about how to silence the warning and
any other suggestion after that. Related to rdar://9300260.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
312eadb832cab4497a069409954500d8192b8f0d 24-Apr-2011 Douglas Gregor <dgregor@apple.com> Implement a new identifier-classification scheme where Sema
performs name lookup for an identifier and resolves it to a
type/expression/template/etc. in the same step. This scheme is
intended to improve both performance (by reducing the number of
redundant name lookups for a given identifier token) and error
recovery (by giving Sema a chance to correct type names before the
parser has decided that the identifier isn't a type name). For
example, this allows us to properly typo-correct type names at the
beginning of a statement:

t.c:6:3: error: use of undeclared identifier 'integer'; did you mean
'Integer'?
integer *i = 0;
^~~~~~~
Integer
t.c:1:13: note: 'Integer' declared here
typedef int Integer;
^


Previously, we wouldn't give a Fix-It because the typo correction
occurred after the parser had checked whether "integer" was a type
name (via Sema::getTypeName(), which isn't allowed to typo-correct)
and therefore decided to parse "integer * i = 0" as an expression. By
typo-correcting earlier, we typo-correct to the type name Integer and
parse this as a declaration.

Moreover, in this context, we can also typo-correct identifiers to
keywords, e.g.,

t.c:7:3: error: use of undeclared identifier 'vid'; did you mean
'void'?
vid *p = i;
^~~
void

and recover appropriately.

Note that this is very much a work-in-progress. The new
Sema::ClassifyName is only used for expression-or-declaration
disambiguation in C at the statement level. The next steps will be to
make this work for the same disambiguation in C++ (where
functional-style casts make some trouble), then push it
further into the parser to eliminate more redundant name lookups.

Fixes <rdar://problem/7963833> for C and starts us down the path of
<rdar://problem/8172000>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
89ebaed91cca7fd296ec7804e4e9fb68949c1d0e 23-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> "note" location of forward class used as receiver of
a 'deprecated' selector in the diagnostics for the
selector. // rdar://9309223



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a61aedc48efae959d951d2aadadbac3e6d49acc5 22-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For -Wlogical-op-parentheses, point at '&&', not '||'. Fixes rdar://9125333.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bb9b80c308d7d3f758886243c7145404a50c66cf 21-Apr-2011 Richard Trieu <rtrieu@google.com> Add a fixit suggest for missing case keywords inside a switch scope. For instance, in the following code, 'case ' will be suggested before the '1:'

switch (x) {
1: return 0;
default: return 1;
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b6b42aed07726178f61954ac6e51f47da00275c 19-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> We regard a function as 'unused' from the codegen perspective, so our warnings diverge from
gcc's unused warnings which don't get emitted if the function is referenced even in an unevaluated context
(e.g. in templates, sizeof, etc.). Also, saying that a function is 'unused' because it won't get codegen'ed
is somewhat misleading.

- Don't emit 'unused' warnings for functions that are referenced in any part of the user's code.
- A warning that an internal function/variable won't get emitted is useful though, so introduce
-Wunneeded-internal-declaration which will warn if a function/variable with internal linkage is not
"needed" ('used' from the codegen perspective), e.g:

static void foo() { }

template <int>
void bar() {
foo();
}

test.cpp:1:13: warning: function 'foo' is not needed and will not be emitted
static void foo() { }
^

Addresses rdar://8733476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eefa76e29e9f4a6c01e8c1e8d2f1a1d34a98817c 15-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Allow shadowin of 'self' in objc methods in
cases where stand-alone ivar can be looked up
in shadowed object. To fix gcc compatibility
breakage. // rdar://9284603


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
162e1c1b487352434552147967c3dd296ebee2f7 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Support for C++11 (non-template) alias declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5bf47f7d3469a53a1b95b255a49d3d7cc66acd9d 15-Apr-2011 Benjamin Kramer <benny.kra@googlemail.com> Fix mismatched delete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f111d935722ed488144600cea5ed03a6b5069e8f 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement generic selections

As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dde5557e87e1163ad792471e0bdbb2cd17894576 14-Apr-2011 Eli Friedman <eli.friedman@gmail.com> Re-fix r129481 and r129465 properly. Nulls fixits shouldn't be dropped in
DiagnosticBuilder::AddFixItHint: they will be dropped along with any
other (possibly valid) fixits later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d8dc460ae02e29d0b2abb4d6d093736e2f920ea 14-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> When creating an implicit member expression through a qualified-id, check that the class
named by the nested-name-specifier is same or base of the class in which the member expression appears.

It seems we also had an ill-formed test case, mon dieu! Fixes rdar://8576107.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3e2193ce5feb2feb092e5ae615e85148e06e9fd2 14-Apr-2011 Anders Carlsson <andersca@mac.com> Add a flag to StringLiteral to keep track of whether the string is a pascal string or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6027461b6c4d1567a8d7533ad97ccf81bd2b9500 14-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Issue the 2nd fixit even if fix-it hint is supressed.
// rdar://9091893


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
81ab3cfcf2f312e82c51e58a1fce8e85e9fe59c3 13-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> No fixit hint for builtin expressions which are
defined in a macro. // rdar://9091893


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b8f17abf30a9aab6382c84a758fd6679a8b5583a 13-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Redeclaration of 'self' should be flagged in
objective-c instead of crashing in IRgen.
// rdar://9154582.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
755d8497e39071aa24acc173ff07083e3256b8f8 12-Apr-2011 John McCall <rjmccall@apple.com> After some discussion with Doug, we decided that it made a lot more sense
for __unknown_anytype resolution to destructively modify the AST. So that's
what it does now, which significantly simplifies some of the implementation.
Normal member calls work pretty cleanly now, and I added support for
propagating unknown-ness through &.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
379b5155b4566f63679e1da6b0ceb5fdfa2aec6d 11-Apr-2011 John McCall <rjmccall@apple.com> More __unknown_anytype work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a5fc472b353b88be3b4981da946fb01f5a5cc0c6 10-Apr-2011 John McCall <rjmccall@apple.com> Fix a bunch of major problems with __unknown_anytype and properly test
for them. The only major missing feature is references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a49218e17bcbb1acde0245773173e2c0c42f4f19 09-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR8369: make __attribute((regparm(0))) work correctly. Original patch by
pageexec@freemail.hu, tweaks by me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
1de4d4e8cb2e9c88809fea8092bc6e835a5473d2 07-Apr-2011 John McCall <rjmccall@apple.com> Basic, untested implementation for an "unknown any" type requested by LLDB.
The idea is that you can create a VarDecl with an unknown type, or a
FunctionDecl with an unknown return type, and it will still be valid to
access that object as long as you explicitly cast it at every use. I'm
still going back and forth about how I want to test this effectively, but
I wanted to go ahead and provide a skeletal implementation for the LLDB
folks' benefit and because it also improves some diagnostic goodness for
placeholder expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
96b4adce3bd41a33e3f1d98dc4e74046585f6dce 06-Apr-2011 Anders Carlsson <andersca@mac.com> Wide Pascal strings should be of type wchar_t[] and not unsigned char[].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5862f0e1ac29c5af8089b4bf119fd4493f6ab58c 04-Apr-2011 Ted Kremenek <kremenek@apple.com> When emitting a "too many arguments to function call..." error, also include a note with a location for the function prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61750f2bed7f5c0e440318841e3be385920b22f3 30-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> de-sugared when accessing property reference type.
Add a test case for synthesize ivar. // rdar://9070460


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
170a6a229b6cb0c411be5edaa587a1b1436bd147 29-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't do the checks of Sema::DiagnoseEqualityWithExtraParens() on type-dependent expressions. Fixes rdar://9027658.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
14086764e340267e17803d0f8243070ffae2c76e 29-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Implements property of reference types. Adding
an executable test to llvm test suite.
// rdar://9070460.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6305f721247f13707d9858b17d5696c1e3428a78 28-Mar-2011 Anton Yartsev <anton.yartsev@gmail.com> refactoring

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7870b133ac7b03bd53388f51250d009325f43399 27-Mar-2011 Anton Yartsev <anton.yartsev@gmail.com> AltiVec vector comparison logic now affect only vectors of fundamental AltiVec vector types. It fixes bug 9347.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d06fea8580658470f92fb5d0d3d7ab5b475728dc 27-Mar-2011 Anton Yartsev <anton.yartsev@gmail.com> supported: AltiVec vector initialization with a single literal according to PIM section 2.5.1 - after initialization all elements have the value specified by the literal

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
077f490d0a514dcc448475f33f799934252b85a7 26-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> More coherent diagnostic attempting to assign to a member of a const object returned
from an objective-c message: // rdar://9005189


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2234873111009eb8655d63362cedc422eb9fc517 26-Mar-2011 John McCall <rjmccall@apple.com> Allow GC qualifiers to be added/removed by conversions from/to void*
without a warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
4f38f414b8676ea43439d6ad3315e32042d315cb 23-Mar-2011 John McCall <rjmccall@apple.com> Fix an error with the declaration of block parameters that depend
on previous block parameters that crept in as part of my captures
work a month or so ago.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
60b3e38d421cab497de1c62c06be6a6a5f321edf 16-Mar-2011 Douglas Gregor <dgregor@apple.com> Don't indescriminately print overload candidates when we have invalid
operands to a binary expression; it doesn't make sense in all
contexts. The right answer would be to see if the user forgot at ().

Fixes <rdar://problem/9136502>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eed5ddc25539e14de11888ec69007217e777c02a 16-Mar-2011 Douglas Gregor <dgregor@apple.com> Allow function calls to dereferenced member pointers of
pointer-to-function type. Fixes <rdar://problem/9065289>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4eb7f69515c059c64e87ed32cdbeb743ec6ec03d 15-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Don't poke into redefined 'id' type looking for a property
declaration as this results in a confusing error message,
instead of message related to missing property declaration.
// rdar://9106929


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
796aa443ab5ed036f42ef33fed629e1b4b34871b 12-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Forgotten part of previous commit.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f4f7cb814f8537606754b9eb8848094196e73214 11-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: if double precision floating point constant encountered
without cl_khr_fp64, warn and cast to single precision

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f4e3cfbe8abd124be6341ef5d714819b4fbd9082 11-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for the OpenCL vec_step operator, by generalising and
extending the existing support for sizeof and alignof. Original
patch by Guy Benyei.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
34d6f9344d6b562b4642a882519dd82431db4163 11-Mar-2011 John McCall <rjmccall@apple.com> When comparing a null pointer and something else, always cast the null
pointer instead of the other operand.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
834e3f6c77d9ac03997a3f0c56934edcf406a355 08-Mar-2011 John McCall <rjmccall@apple.com> Fix my earlier commit to work with escaped newlines and leave breadcrumbs
in case we want to make a world where we can check intermediate instantiations
for this kind of breadcrumb.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d45e4b767458104d7e842e253cd03df01ccba3f4 08-Mar-2011 John McCall <rjmccall@apple.com> Update the check for a NULL macro to use Preprocessor::getSpelling().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fbe599465021a37b2275af93466064ba08c06a68 05-Mar-2011 Matt Beaumont-Gay <matthewbg@google.com> Much to my surprise, OverloadExprs can also point to function template decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
425a31e03a619d50f5f958433fcdc533788e41b7 01-Mar-2011 Ted Kremenek <kremenek@apple.com> Don't warning about shifting by too many bits in dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
082bf7a47f78ff4a645cea358d70bf45a858b238 01-Mar-2011 Ted Kremenek <kremenek@apple.com> Don't wanr about "negative shifts" in code that is unreachable. Fixes PR 5544.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
90566c0e7b61de9bdfdf66f6dee440adb4e5b631 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement comparison of C++0x scoped enumeration types. Fixes PR9333.


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7c3179cf463c3b3b8c21dbb955f933ba50b74f28 28-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
CXXDependentScopeMemberExpr, and clean up instantiation of
nested-name-specifiers with dependent template specialization types in
the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8e10f3b9cc1db43645bbc2999eb163af8997d468 26-Feb-2011 John McCall <rjmccall@apple.com> Provide a bit saying that a builtin undergoes custom type-checking, then
don't let calls to such functions go down the normal type-checking path.
Test this out with __builtin_classify_type and __builtin_constant_p.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6c3c3f53b32288f0be38e010c96da271f264f2ad 24-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Handle value dependent LHS as well as RHS. Test both of these, they
don't seem to have been covered by our tests previously.

This should fix bootstrap failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
21206d5e3167d5e8066c005c1773afc80ff50ae6 24-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Implement a warning for known shift overflows on constant shift
expressions. Consider the code:

int64_t i = 10 << 30;

This compiles fine, but most developers expect it to produce the value
for 10 gigs, not -2 gigs. This is actually undefined behavior because
the LHS is a signed integer type.

The warning is currently gated behind -Wshift-overflow.

There is a special case where only the sign bit is overridden that gets
a custom error message and is by default ignored. This case is much less
likely to cause observed buggy behavior, it's just undefined behavior
according to the spec. This warning can be enabled with
-Wshift-sign-overflow.

Original patch by Oleg Slezberg, with style tweaks and some correctness
fixes by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0423fc6149c9f11e8892ed903a5b68133797fba5 23-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Sema: diagnose kernel calls to non-global functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
351ba91eaa6d30e523587b2d7ed676a5172c6e56 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Enhance Sema::DiagRuntimeBehavior() to delay some diagnostics to see if the related code is reachable. This suppresses some
diagnostics that occur in unreachable code (e.g., -Warray-bound).

We only pay the cost of doing the reachability analysis when we issue one of these diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3ed6fc08a9cd293d012fa49ab2a615e618d7c3fa 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Issue AnalysisBasedWarnings as part of calling Sema::PopBlockOrFunctionScope(). No real functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
762696fff298627b72b63dbb0becf57f689801ca 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Update Sema::DiagRuntimeBehavior() to take an optional Stmt* to indicate the code the diagnostic is associated with.

This Stmt* is unused, but we will use it shortly for pruning diagnostics associated
with unreachable code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
65b34d7bc314c7d4b448164e1a889311bd30b375 23-Feb-2011 Matt Beaumont-Gay <matthewbg@google.com> Clean up the error recovery at the bottom of Sema::LookupMemberExpr. This
mostly just shuffles various possibilities for recovery into a more
straightforward order, but also unifies a couple of diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
483b9f3bc05c5409e2c6643f1c9d91e21c8ff9d2 21-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Tweaks to C++0x deduced auto type support:
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
* Temporary template parameter list for auto deduction is now allocated on the stack.
* Deduced 'auto' types are now uniqued.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
77efc680156bc28d3c0d2e70f156904f91328b21 21-Feb-2011 John McCall <rjmccall@apple.com> Don't warn about static const integral data members with in-line constant
initializers just because they don't have a proper out-of-line definition.
Such code is technically ill-formed but is too common and too unlikely to be
a problem to be seriously worth worrying about.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b0c2301a40a3e54ce7195f11a59d025ef60ebffb 21-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Remove warning on future change in ivar lookup rule
when doing the property default synthesis.
// rdar://9027673.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
15e310a3b970b64a84cb30f0005bc396b4d978cb 19-Feb-2011 John McCall <rjmccall@apple.com> Warn about code that uses variables and functions with internal linkage
without defining them. This should be an error, but I'm paranoid about
"uses" that end up not actually requiring a definition. I'll revisit later.

Also, teach IR generation to not set internal linkage on variable
declarations, just for safety's sake. Doing so produces an invalid module
if the variable is not ultimately defined.

Also, fix several places in the test suite where we were using internal
functions without definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
813d8346529bf094eb2b249648906ba7fd226688 18-Feb-2011 Douglas Gregor <dgregor@apple.com> Selector::getIdentifierInfoForSlot() can return NULL values, a fact
that was ignored in a few places (most notably, code
completion). Introduce Selector::getNameForSlot() for the common case
where we only care about the name. Audit all uses of
getIdentifierInfoForSlot(), switching many over to getNameForSlot(),
fixing a few crashers.

Fixed <rdar://problem/8939352>, a code-completion crasher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16f744beaaa30bf3847740ca8e8beb6f0d3a0b93 18-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTContext::getLogicalOperationType() to return bool or int, depending on language.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f58483268995daef120529687813a6c5340ff09d 18-Feb-2011 Douglas Gregor <dgregor@apple.com> When building a qualified reference to a member of an anonymous struct
or union, place the qualifier on the outermost member reference
expression, which actually contains the entity name.

Fixes PR9188/<rdar://problem/8990184>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
337e550218128e7d922c09bb354fbc71de90c568 18-Feb-2011 Chris Lattner <sabre@nondot.org> Switch labels over to using normal name lookup, instead of their
own weird little DenseMap. Hey look, we now emit unused label
warnings deterministically, amazing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e476bdce8cf3315c8ce852480503a8acc265bd54 18-Feb-2011 Chris Lattner <sabre@nondot.org> make block bodies handle undefined labels just like functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
57ad37823e198f977cac605dbfbaefb4daf325e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
543cb655b174087f6c2d22009934c9fed6c32114 17-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Implement -Wenum-compare, which warns when comparing two enums of
different types. We omit the warning when the enum types are anonymous.
Unlike GCC, this warning does not distinguish between C++ and C/ObjC for
controling whether it is on by default, it is always on by default.

Original patch contributed by Richard Trieu (@ Google), I fixed some
style issues, and cleaned it up for submission.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
26ae5dd9cfc561527eca418571323d90589a4b92 17-Feb-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix PR9025 and add a diagnostic (and sometimes a fixit) for an overloaded
function name used as the base of a member expression. Early feedback from
Chandler Carruth, and code review from Nick Lewycky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a0125d8520f65aca581378c235384e7affefa1fc 16-Feb-2011 Ted Kremenek <kremenek@apple.com> Add trivial buffer overflow checking in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b20de817259c2bf500a88b8172347dbcc4765004 10-Feb-2011 Daniel Dunbar <daniel@zuster.org> Fix think-o I committed without testing, shameful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f2d1561d5124cabe14790091fafb68926de58df3 10-Feb-2011 Daniel Dunbar <daniel@zuster.org> Fix a gcc Wuninitialized false positive.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
76a40219ee5624d78aba167dce02bdbaa930955f 09-Feb-2011 John McCall <rjmccall@apple.com> NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.

Also, reorganize and make very explicit the logic for determining
the value kind and type of a referenced declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b5a61b6dc400027fd793dcadceeb9da944a37ea 07-Feb-2011 John McCall <rjmccall@apple.com> A few more tweaks to the blocks AST representation:
- BlockDeclRefExprs always store VarDecls
- BDREs no longer store copy expressions
- BlockDecls now store a list of captured variables, information about
how they're captured, and a copy expression if necessary

With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.

Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
683564a7a93c952f1fbe573b55c542418d29d859 07-Feb-2011 Anton Yartsev <anton.yartsev@gmail.com> pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2f9f89c6938a788a904c3be3ae7a64f4297c90a6 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Improve our handling of the current instantiation for qualified
id-expression, e.g.,

CurrentClass<T>::member

Previously, if CurrentClass<T> was dependent and not complete, we
would treat it as a dependent-scoped declaration reference expression,
even if CurrentClass<T> referred to the current instantiation.

Fixes PR8966 and improves type checking of templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fdc13a00a0077383eabf6d994de10203568415bb 04-Feb-2011 Douglas Gregor <dgregor@apple.com> When calling a bound pointer to member function, check the
cv-qualifiers on the object against the cv-qualifiers on the member
function. Fixes PR8315.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
f7275cd4b930e658930b8a319aa06c0168a4720a 02-Feb-2011 Ted Kremenek <kremenek@apple.com> Remove redundant check to not warn for warn_equality_with_extra_parens if we are in a macro. This is checked twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
40249e7487c3314f185c63302aaad9edde6dfd53 02-Feb-2011 John McCall <rjmccall@apple.com> When diagnosing address-space changes, apply array-to-pointer decay first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
006ae38a494d6b2389b7c67728705dc8da996754 01-Feb-2011 Ted Kremenek <kremenek@apple.com> Don't warn about extraneous '()' around a comparison if it occurs within a macro.

Macros frequently contain extra '()' to make instantiation less error prone.
This warning was flagging a ton of times on postgresql because of its use of macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cf1620a0ef7f6dc71f4fad5c46fbb0a2de6c6308 01-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for "if ((a == b))" if the parens came from a macro. Thanks to Fariborz for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
70f233017bd3091137dcfbc00f6b2baea56edba9 01-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For "if ((a == b))" only warn if 'a' is a modifiable l-value. Caught by John!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0e2dc3a1159806c8303b0979be1ce1526cc64ed3 01-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn for "if ((a == b))" where the equality expression is needlessly wrapped inside parentheses.
It's highly likely that the user intended an assignment used as condition.

Addresses rdar://8848646.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
86c05f3f28bcf07c97dfb1881686fc43be2f47c2 01-Feb-2011 John McCall <rjmccall@apple.com> Perform the bad-address-space conversions check as part of
CheckPointerTypesForAssignment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e4be87eb661ff12524074184f43b9d11d06ad376 01-Feb-2011 John McCall <rjmccall@apple.com> Make Check*PointerTypesForAssignment private and tell them that they're
working on canonical types already.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b6cfa24fe6c7a27e9bbaebc0cd28c857d11d6060 31-Jan-2011 John McCall <rjmccall@apple.com> Slightly reorganize CheckAssignmentConstraints and remove some redundant
logic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6ad5df132a0bcb3f6975362901270be5bf60dc56 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Error for use of field from anonymous struct or union should say "invalid use of nonstatic data member"
not "call to non-static member function without an object argument".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0413db4a26b0a1577b75c2979b0eb21f3490d17a 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Amazing that there are still issues with the fields of anonymous struct/unions..
Allow taking the address of such a field for a pointer-to-member constant. Fixes rdar://8818236.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
d0fbadd012ba0a3a23af7af56837b7ef9b0637ac 26-Jan-2011 Fariborz Jahanian <fjahanian@apple.com> Tweak the rule for deciding if a provisional ivar is needed
in default ivar synthesis. Fixes // rdar://8913053.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
df8dc5d772d23bb760aeeda374c39001d12e4497 26-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix infinite loop during error diagnostics. Fixes rdar://8875304.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5af1f066230be7571cffb408048479ad0f06f75e 25-Jan-2011 Eric Christopher <echristo@apple.com> Revert r124146 for now. It appears to be failing on a few platforms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e07ae4ee00baedcfc2c59fb2a7500dbec08371e9 24-Jan-2011 Anton Yartsev <anton.yartsev@gmail.com> pre/post increase/decrease for AltiVec vectors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
92c3a04f3ec683f279814b0eb6d6271b3fd3a219 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Warn about the use of unparenthesized |= in conditionals (which may be
a typo for !=). Fixes PR9001, from Hans Wennborg!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
6e5658dc89671a55a0d0f9514db385d752d6ac08 19-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e188933adf2cfe2821b8acba2de6d5d152bc246b 18-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Properly do a float -> _Complex double conversion, fixes rdar://8875946.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
2432320a996adcfcc5671dd0f309579a2ef2e465 12-Jan-2011 Francois Pichet <pichet2000@gmail.com> Add a comment for r123231.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a15a5eede90e41ce1bf49ecc42d54895dfd86d15 11-Jan-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, force 64 bit hex integer constants to signed type if the LL or i64 suffix is used. This MSVC behavior.

For example:

void f(long long){ printf("long long"); }
void f(unsigned long long) { printf("unsigned long long"); }
int main() {
f(0xffffffffffffffffLL);
}
Will print "long long" using MSVC.

This patch also fixes 16 compile errors related to overloading issues when parsing the MSVC 2008 C++ standard lib.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b1fa3dc2f914aaa8b5a851c6b5115ec239d20495 05-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use the proper enum as parameter, instead of unsigned. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
711c52bb20d0c69063b52a99826fb7d2835501f1 05-Jan-2011 John McCall <rjmccall@apple.com> Refactor the application of type attributes so that attributes from
the declaration-specifiers and on the declarator itself are moved
to the appropriate declarator chunk. This permits a greatly
simplified model for how to apply these attributes, as well as
allowing a much more efficient query for the GC attribute.
Now all qualifier queries follow the same basic strategy of
"local qualifiers, local qualifiers on the canonical type,
then look through arrays". This can be easily optimized by
changing the canonical qualified-array-type representation.

Do not process type attributes as decl attributes on declarations
with declarators.

When computing the type of a block, synthesize a prototype
function declarator chunk if the decl-spec type was not a
function. This simplifies the logic for building block signatures.

Change the logic which inserts an objc_read_weak on a block
literal to only fire if the block has a __weak __block variable,
rather than if the return type of the block is __weak qualified,
which is not actually a sensible thing to ask.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bb03f5dbc23fb9aa1dfdf6a1dfdb192aa56b6b1c 04-Jan-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Prefer getAs<ComplexType> rather than cast<ComplexType> on canonical type. Suggestion by Douglas Gregor!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9f7a6eeee441bcbb1b17208cb3abd65a0017525a 04-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Implement -Wself-assign, which warns on code such as:

int x = 42;
x = x; // Warns here.

The warning avoids macro expansions, templates, user-defined assignment
operators, and volatile types, so false positives are expected to be low.

The common (mis-)use of this code pattern is to silence unused variable
warnings, but a more idiomatic way of doing that is '(void)x;'.
A follow-up to this will add a note and fix-it hint suggesting this
replacement in cases where the StmtExpr consists precisely of the self
assignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e776f88430eb77ce8d58f2e6ec10da1383b71de8 03-Jan-2011 Fariborz Jahanian <fjahanian@apple.com> Guard lazy synthesis of provisional ivars under the new
-fobjc-default-synthesize-properties flag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
743b82bf3c500de45715498dbf25f0fb39e71462 02-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Unkown -> Unknown

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b0766f95883b7c5ffc1953f1d02d348f157c811 28-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Canonicalize types before possible cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
99130e5a02e93282cb393d2cba0d3dffc10abc01 22-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Complain on missing property getter method only
if property-dot expression is decidedly
an rvalue. // rdar://8155806.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8e5fc9be37c6828ad008f22730e3baac1bef1686 21-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Warn when message is sent to receiver of
unknown type and there is a possibility that
at runtime method is resolved to a deprecated or
unavailable method. Addreses // rdar://8769853


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1bc80af703ceff3e92797f33c41634d327bf067a 16-Dec-2010 John McCall <rjmccall@apple.com> Do lvalue-to-rvalue conversions on the LHS of a shift operator.
Fixes rdar://problem/8776586.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7504966cc0d07eac26baabec80a7406695efb307 16-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> ivars craeted for explicit @synthesize and those
created for auto-synthesis are @private.
Fixes: // rdar://8769582



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0827408865e32789e0ec4b8113a302ccdc531423 15-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix diagnostic pragmas.

Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
028d397c1b4082c88067efde740f1811fd557792 15-Dec-2010 John McCall <rjmccall@apple.com> Reorganize LookupMemberExpr for clarity and to make the obvious fast paths
come first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5e3c67b4bd894a926282d24b4d0cbc0e123c9f4a 15-Dec-2010 John McCall <rjmccall@apple.com> Sundry missing lvalue-to-rvalue conversions. Also leave a TODO for the vital
future task of performing contextual conversion to size_t in a VLA size
expression. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
723df245307a530da5433dfb43accf187dc3e243 14-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added missing IgnoreParens().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8786da77984e81d48e0e1b2bd339809b1efc19f3 14-Dec-2010 John McCall <rjmccall@apple.com> Rewrite ComplexExprEvaluator::VisitCastExpr to use cast kinds, and fix
the basic casting logic to insert intermediate casts and preserve the
exact complex-cast design. Fixes a crash in the test suite.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
db67e2f5b890f1fb2ad536ae5df1532f56fd8e71 10-Dec-2010 John McCall <rjmccall@apple.com> Bind the result of a property fetch to a temporary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
9f71a8f4c7a182a5236da9e747d57cc1d1bd24c2 07-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
53c374f1ac6d28b2341b3a8f3902eb51db9c50e7 07-Dec-2010 Douglas Gregor <dgregor@apple.com> Use Sema::MaybeCreateExprWithCleanups() only after we've checked for a NULL/invalid expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
409fa9ab9579de04c5d68fb6a6a8d094545b1e77 06-Dec-2010 John McCall <rjmccall@apple.com> Split out a function to do lvalue conversion on objects; this is basically
FunctionArrayLvalueConversion but without the function/array decay. Generally
this is only appropriate for use sites that know the type of the expression
and thus that it can't be subject to the decays.

Also make sure we do lvalue-to-rvalue on the bases of ivar references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
40c2913cef2c211f1fe720ffef83fdb3e4d0fabf 06-Dec-2010 John McCall <rjmccall@apple.com> Do unary conversions on vararg arguments and *then* special-case float.
Fixes PR8742.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
01b2e4e3e2fbd60e62539f7e8e8b99575fa8a5b0 06-Dec-2010 John McCall <rjmccall@apple.com> Clarify the logic for when to build an overloaded binop. In particular,
build one when either of the operands calls itself type-dependent;
previously we were building when one of the operand types was dependent,
which is not always the same thing and which can lead to unfortunate
inconsistencies later. Fixes PR8739.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
abc56c726178fc7c8a3f45185768426a6e9d584e 04-Dec-2010 John McCall <rjmccall@apple.com> When deciding whether to complain about the type of a boolean condition, use
the type of the expression *after* array/function decay.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
0982136cb748f4a842141bf199d133126d6be882 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-single-precision-constant

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
74b2756bc1f1f5f7c189996fe7e4cd3efef70263 04-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose when accessing property in a class method and
no property accessor class method to be found, instead of
crashing in IRGen. // rdar://8703553


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6c572f1b5bd00d16abe880c2b483aa0ed570b427 03-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
12f78a6741a4cb3d904340f8d3d2714568b50e7a 02-Dec-2010 John McCall <rjmccall@apple.com> Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
into the latter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
de3deea82767a2c418fa1b5828a3744326ffd9c3 02-Dec-2010 Bob Wilson <bob.wilson@apple.com> Swap order of checking for compatible vector types.
Check for compatible gcc, Altivec and Neon vectors before handling the
lax-vector-conversions case. Otherwise there is no way to avoid the
warnings from -Wvector-conversions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0ae287a498b8cec2086fe6b7e753cbb3df63e74a 01-Dec-2010 John McCall <rjmccall@apple.com> Restore the lvalue-to-rvalue conversion patch with a minimal fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
20fbe7c4772d537c1f779b1ff89cbb57d1d9afff 30-Nov-2010 John McCall <rjmccall@apple.com> L-value to r-value conversion is not ready for prime-time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
67aba816901503d9cf7ba699525fa62cc7f8e5e4 30-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Such function decls,as objc's objc_msgSend, builtins in
a specific language. We are adding such language info. by
extensing Builtins.def and via a language flag added
to LIBBUILTIN/BUILTIN and check for that when deciding
a name is builtin or not. Implements //rdar://8689273.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7e4857931bfe27bb355275bc7ec1eaa44612dfff 30-Nov-2010 John McCall <rjmccall@apple.com> Introduce an r-value to l-value cast kind. I'm not promising anything
about the reliability of this yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
15d5c83ce698a6b6ae1166f9008c6ead34ae7a5d 30-Nov-2010 Nico Weber <nicolasweber@gmx.de> Fix bug in r120299 spotted by dgregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
08e41a656575ee63f8eefc7805493055c645fa85 29-Nov-2010 Nico Weber <nicolasweber@gmx.de> Always use a function's decl context when building default arguments. Fixes http://http://llvm.org/pr8479.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7ff776eb7d874913588f55df4e6b459d15e20175 28-Nov-2010 Nico Weber <nicolasweber@gmx.de> Revert parts of r120266 that I did not mean to commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6bb4dcb412d53d05a80017df81d41e447e2aa3ea 28-Nov-2010 Nico Weber <nicolasweber@gmx.de> Minor whitespace and comment fixes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f9780007a9c31a46a025bdd3eaf5c2be31eb4c0e 26-Nov-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow access to non-static members without an object in sizeof expressions, in C++0x. Patch by Jakub Wieczorek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
dfa1edbebeda7ec3a7a9c45e4317de9241aa9883 23-Nov-2010 John McCall <rjmccall@apple.com> A few tweaks to the value-kind computation:
- Default argument expressions pick up the value kind of the incoming
expression, not the value kind of the parameter it initializes.
- When building a template argument for substitution, A::x is an rvalue
if x is an instance method.
- Anonymous struct/union paths pick up value kind the same way that
normal member accesses do; extract out a common code path for this.

Enable the value-kind assertion, now that it passes self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d98114647e16796a976b04af79975b4f0eacf22b 21-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Fix a bunch of IndirectFieldDecl-related warnings.

- Negative ChainingSize doesn't make sense, make it unsigned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
87c2e121cf0522fc266efe2922b58091cd2e0182 21-Nov-2010 Francois Pichet <pichet2000@gmail.com> Major anonymous union/struct redesign.
A new AST node is introduced:
def IndirectField : DDecl<Value>;
IndirectFields are injected into the anonymous's parent scope and chain back to
the original field. Name lookup for anonymous entities now result in an
IndirectFieldDecl instead of a FieldDecl.
There is no functionality change, the code generated should be the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0bc5c66a1c5a69d8ea067c86c63480d3feb210fa 19-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> objc_msgSend is not a builtin type in non-objc mode.
Fixes //rdar://8686888


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
aa4fe05939ffbfd746b8f0065cc0b5e06ea94fe2 18-Nov-2010 Anton Yartsev <anton.yartsev@gmail.com> comparison of AltiVec vectors now gives bool result (fix for 7533)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
de2676076ba218b5c09a88ac26dd86cc97a9d02e 17-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Warn if direct accessing synthesized ivar backing the property in
nonofragile-abi2. Fixes //rdar://8673791



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
47d512c337d06376d56beeb7eccc7c581ed5ff57 17-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't emit warn_logical_and_in_logical_or for cases like "a && b || 0".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d92ccaa76923cfa374d5d9a33e82f15412fa3daf 17-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't emit warn_logical_and_in_logical_or for macros. Fixes rdar://8678458

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
567bb71a01bcf178c6fcabb3eecf7a8c4f71e674 17-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for parentheses for the '&&' inside '||' for cases like:

assert(a || b && "bad");

since this is safe. This way we avoid a big source of such warnings which in this case are practically useless.

Note that we don't handle *all* cases where precedence wouldn't matter because of constants since
this is a bit costly to check, and IMO clarifying precedence with parentheses is good for
readability in general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bee77f75358a5aaf2e2e01ab9cfd37ffc514ed7a 16-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e220455a059d926953befe72857b9525273717ef 16-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Implements __block API for c++ objects. There is still
issue with runtime which I am discussing it with Blaine.
This is wip (so no test yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c23e91ef66688d20868b6bab3b5589a119eb603 16-Nov-2010 John McCall <rjmccall@apple.com> Kill off the remaining places which generate CK_Unknown casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0c6d28d6742de6e250560336048fcf545df4d448 15-Nov-2010 John McCall <rjmccall@apple.com> Yes, vector conversions are bitcasts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
f3ea8cfe6b1c2ef0702efe130561e9e66708d799 14-Nov-2010 John McCall <rjmccall@apple.com> Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions; the last batch was specific to promotions.
I think this is the full set we need. I do think dividing the cast
kinds into floating and integral is probably a good idea.

Annotate a *lot* more C casts with useful cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2bb5d00fcf71a7b4d478d478be778fff0494aff6 13-Nov-2010 John McCall <rjmccall@apple.com> Introduce five new cast kinds for various conversions into and
between complex types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cf33b24441798f538fb5ab089edbba2ac3ba819c 13-Nov-2010 John McCall <rjmccall@apple.com> Bring UsualArithmeticConversionsType back into Sema and cast the
operands appropriately. There are a lot of missing complex-related
cast kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e27e9d673346056e6ff7dca1d7fb1d75dfd42956 11-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Adding couple of Block API, a bug fix and
a test change, all for blocks. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7ad5d421d9f12bd287aa17fdb00e0f4d5971d76f 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Attempt to resolve overloaded functions in comma expressions and
conditional operators. Fixes PR7863.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ef9b1497908ab1684e04f244289f1ebe8d44274e 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Revert the fix for PR8013.

That bug concerned the well-formedness of code such as (&ovl)(a, b,
c). GCC rejects the code, while EDG accepts it. On further study of the
standard, I see no support for EDG's position: in particular, C++
[over.over] does not list this as a context where we can take the
address of an overloaded function, C++ [over.call.func] does not
reference the address-of operator at any point, and C++ [expr.call]
claims that the function argument in a call is either a function
lvalue or a pointer-to-function; (&ovl) is neither.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9a0f2b6d89ae16abb882cd0ec0be2222e15c3785 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Handle overload resolution when calling an overloaded function set
with, e.g., (&f)(a, b, c). Fixes PR8013.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6fe9a28bc5ceec284099c1e5bc90e2316ade3de 08-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When building a compound literal, check that the base element of the array is complete.
Fixes rdar://8620582 & http://llvm.org/PR7905

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
910f8008fea79120489a53593fe971b0b8a4a740 08-Nov-2010 Douglas Gregor <dgregor@apple.com> Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
343e6ffa70459b1afdb488c69fb651434a5016c0 05-Nov-2010 Anders Carlsson <andersca@mac.com> Expressions of type std::nullptr_t can be used as sentinels.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0c8209e40b405fd32f047e95aafdc94054406a58 04-Nov-2010 Anders Carlsson <andersca@mac.com> It's OK to use nullptr in relational operators if the other side is a null pointer constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
40749ee585abc84fbb3c8fdbd8aaac062f153062 03-Nov-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information for CXXConstructExpr nodes, by
ensuring that they cover all of their child nodes. There's still a
clang_getCursor()-related issue with CXXFunctionalCastExprs with
CXXConstructExprs as children (see FIXME in the test case); I'll look
at that separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ca45da0c6da20d9c0c903370f99af5e9a186e0da 02-Nov-2010 Douglas Gregor <dgregor@apple.com> Teach code completion to provide property results when the property
can be used to automatically synthesize an ivar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
11ab79030938209f50691acae0ddb65e72a58ca9 01-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit error when using a bound member function for something other than calling it.

Also avoids IRGen crashes due to accepting invalid code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
82aa713bcda99f388836c2a30bb868d9c9974817 01-Nov-2010 Douglas Gregor <dgregor@apple.com> Require that the types of the parameters of a block literal are complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4bdc446fd46c66068a3697ff552607bd2ef0f948 27-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Decay array/function types of a statement-expression.
// rdar: // 8600553.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
500b782d51541a5f20f3113305bc3842fba8b77a 27-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> patch to do array-to-pointer conversion in a
statement-expression. // rdar: //8600553


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0700bbfbccc639f093f0e2a9b2ae94a213f218b4 26-Oct-2010 Douglas Gregor <dgregor@apple.com> Delay complete-type checking for arguments to no-prototype functions
until after we've checked/promoted the argument. Hopefully fixes the
Emacs regression due to my recent change that expanded type-checking
in the presence of K&R function definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e946fc833d8592aa2890bfd9839f1ad839b3d284 26-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Patch for mis-compile of statement expressions with
non-trivial copy constructors. // rdar: //8540501.
A test will be added to llvm nightly tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d8f0ade43ee3f9d13d2d98b7a3d07468c2b4096e 25-Oct-2010 Douglas Gregor <dgregor@apple.com> Look through the address-of operator to find the function being
called. Fixes another aspect of PR8314.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4654241866c91fa312d7b26d5eb4afd070b5c602 25-Oct-2010 Douglas Gregor <dgregor@apple.com> When we're calling a function that we know based on its K&R-style
function definition, we should still use a prototype to type-check and
convert the function arguments, if such a prototype exists. Fixes
PR8314.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2127eccbe15fd3b1b29aa53ccedd2e0f55ad27f9 23-Oct-2010 Anders Carlsson <andersca@mac.com> Warn if a variable marked with the "unused" attribute is used. Patch by Darin Adler!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9a632eaa0ee73e4db701a8df74e92909d1fa350e 20-Oct-2010 Douglas Gregor <dgregor@apple.com> Fix handling of property and ivar lookup in typo correction; the two
kinds of lookup into Objective-C classes were tangled together, a
situation that was compounded by automatically synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
43e1b46d640e9e9c9faa784fe6a6d8252f4e776a 19-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in ivar lookup in the new objc's default
property synthesis mode, when dealing with legacy code.
Fixes //rdar: //8565343.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
102ff97bc55ba9f925a100671d49e49b3c5f7129 19-Oct-2010 Douglas Gregor <dgregor@apple.com> When marking declarations referenced within an expression (e.g.,
within a default argument), recurse into default arguments. Fixes
PR8401, a regression I introduced in r113700 while refactoring our
handling of "used" declarations in default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3d6c45d8f8df76d6a0a71d3ef36f835a0d5e515f 15-Oct-2010 Nick Lewycky <nicholas@mxc.ca> Report the location of the syntax error inside a macro. Fixes PR7944.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8ac2d449820fd0df00fcbde5bf82165c1f49854d 14-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a2c21a2ddd84a216bad48a005ccec12c7cfd1549 13-Oct-2010 Devang Patel <dpatel@apple.com> Fix anon union member assignment expression's location.
This is tested by anon-union.exp in gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cf2e5063ae7e7ed3f8d86bb426b2208e242128ab 12-Oct-2010 John McCall <rjmccall@apple.com> C's comma operator performs lvalue conversion on both its operands;
require them to have complete types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2bf6f49ffa839c966f692420491145adeac4f1e2 12-Oct-2010 John McCall <rjmccall@apple.com> I just do what the comments tell me to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2cd11fefb62c580651e4269e1488381c2d6d07ad 12-Oct-2010 John McCall <rjmccall@apple.com> Progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2a984cad5ac3fdceeff2bd99daa7b90979313475 12-Oct-2010 John McCall <rjmccall@apple.com> Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f2ad2c92720f0e25c032188783a1d6374155f03a 11-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> This patch does a few things in the area of objective-c
properties.
1. Generates the AST for lexical info. of accessing
getter/setter methods using dot-syntax notation.
This fixes //rdar: //8528170.
2. Modifes rewriter to handle the AST putout in 1.
3. Supportes in rewriter ObjCImplicitSetterGetter ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ce2d186a421526e94d9e417ced141ae6c891cf48 09-Oct-2010 Benjamin Kramer <benny.kra@googlemail.com> Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
8c4bfe52e528d6c9810cfb0c59859bca9ddc41f0 07-Oct-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed cast to union with anonymous bitfields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ed76f4474fcadacdfeeacacc44bbadb1d4faa6ac 07-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Start and end location of a property-dot syntax expression
must match start and end location of the expression
as expected by the rewriter client. Fixes // rdar: // 8520727



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c784dc1caf0df288a383700f7b57772103b3adab 07-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Patch for adding message to unavailable attribute.
And its documentation.
Finishes off // rdar: // 6734520.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
df9fb9150e9ffb4660fb02ccea1480713fb8e0fb 07-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Simplified code for deprecated attribute wih message a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c4b35cfdb977f6427fe0d5725bf104e1b425d72e 06-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Add message to attribute(deprecated).
attribute(unavailable) to do next.
// rdar:// 6734520.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4a1bb8c4d708d5594e62c9ec7e25e273cae8a1ed 05-Oct-2010 Douglas Gregor <dgregor@apple.com> Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e45bb6aefba8766cbcd86db40acca10de468149f 22-Sep-2010 Douglas Gregor <dgregor@apple.com> Fix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid result from ActOnIdExpression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6155d73ad1668be5335b1a060f6c49c03d4dca05 21-Sep-2010 Nate Begeman <natebegeman@mac.com> Check in support for OpenCL conditional operator on vector types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ea844f3aa29c1238683ac98bc1b720e49d97d1f1 20-Sep-2010 Douglas Gregor <dgregor@apple.com> Check that an overloaded function name, when used by the ! operator,
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
355a9fe26a6dec89680ddf713dd5bc7a671b298a 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -Wunused-label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
41e11a9315f7041c93e409f5d372013204e7cd04 18-Sep-2010 Daniel Dunbar <daniel@zuster.org> Sema/transparent_union: Make sure to add implicit cast when constructing
implicit union values for the transparent_union extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb17e8b9aea1f260f73f1f9dd1da951b80b46370 17-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Only assignment operator triggers property setter call.
Fixes radar 8437253.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fbcb0ebb51f4b76abaa4a7b30be08c175f723369 16-Sep-2010 Ted Kremenek <kremenek@apple.com> For self-comparison warning, check the source location of both the LHS and RHS to see if they
are expanded from macros (and if so, omit the warning). Previously we were just looking at the
location of the binary expression.

Fixes <rdar://problem/8435950>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c4e1a6815235ade1a4affe3511ca5ce2dcc64467 15-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> RHS of property expression assignment requires
copy initialization before passing it to
a setter. Fixes radar 8427922.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5833b0b831d6afae2885e6af420e2bda639652e6 15-Sep-2010 Douglas Gregor <dgregor@apple.com> When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
46358457f712a8da89d4e03a17a1d44d35c78b77 13-Sep-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Congruent diagnostic for void* arithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4fcf5b2f816347ba7a3f16557d5e2b293634d4d6 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Teach the EvaluatedExprVisitor and its client, which marks
declarations in potentially-evaluated subexpressions, about
recursion. Fixes the release-mode self-host failure I introduced in
r113700.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
be0f7bd61c7b2879d02ae75aad7a91d92f819d94 11-Sep-2010 Douglas Gregor <dgregor@apple.com> When parsing default function arguments, do not mark any declarations
used in the default function argument as "used". Instead, when we
actually use the default argument, make another pass over the
expression to mark any used declarations as "used" at that point. This
addresses two kinds of related problems:

1) We were marking some declarations "used" that shouldn't be,
because we were marking them too eagerly.
2) We were failing to mark some declarations as "used" when we
should, if the first time it was instantiated happened to be an
unevaluated context, we wouldn't mark them again at a later point.

I've also added a potentially-handy visitor class template
EvaluatedExprVisitor, which only visits the potentially-evaluated
subexpressions of an expression. I bet this would have been useful for
noexcept...

Fixes PR5810 and PR8127.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4088ec00f035cf3ced00aab7dac611ce6ec1988e 10-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> property reference expression used on lhs of assignment
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
957c094bd435c9ae367a9fcf375a5fadcc0c2bff 06-Sep-2010 Eli Friedman <eli.friedman@gmail.com> PR8023: Don't crash on invalid uses of __real__ on class types in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8c465e6494d16a19127873dc9bdc55177ac6b6fd 03-Sep-2010 John McCall <rjmccall@apple.com> Devirtualize Sema, kill off DeleteExpr and DeleteStmt, and reformat.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f9b949fecf339a2c9bd97dd11a272c4878f85ce4 31-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> AST work to support [C++] [IRgen] for ?: with missing LHS
This is also pr7726 and wip. No change in functionality
at this time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e2248be8746e0ebb01e9a3b823bc0e129283bef4 30-Aug-2010 Douglas Gregor <dgregor@apple.com> Fix an corner-case assertion introduced by the refactoring in r112258;
when we're taking the address of a unresolvable value, it might be an
implicit member access. Fixes some Boost.Spirit regressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
629f9e49d984912c408c6d0096f5fdffbd98b44f 30-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Add some braces for sanity and GCC silence. These became unbalanced in r112122,
so please review echristo and let me know if the logic is wrong now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
be9ebe3747716a916d8b69a7e7a5276919136c87 28-Aug-2010 Gabor Greif <ggreif@gmail.com> perform cheap test first

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
40181c4e587b8a988e691d7b46580b1a1212c535 28-Aug-2010 Gabor Greif <ggreif@gmail.com> fix PR8007
reordering and redefinition issues still may linger,
I plan to nail them next

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

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

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

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




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e84f9ebf8c89d5600f5930b65a0df0de890791b2 26-Aug-2010 Eric Christopher <echristo@apple.com> With lax vector conversions (the default) make sure we convert between two
vectors that are the same size. Fix up testcases accordingly and add a new one
to make sure we still error if lax vector conversions are disabled.

Fixes rdar://8328190


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
58b5259e959f42823cc93f66da1499723eae366c 25-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Recursive functions should be marked when used from another function. Fixes http://llvm.org/PR7923.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
62c78d54bee499dd87f768f48b21c9b5ec15e516 25-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
781472fe99a120098c631b0cbe33c89f8cef5e70 25-Aug-2010 John McCall <rjmccall@apple.com> Split FunctionScopeInfo and BlockScopeInfo into their own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e0054f61fd84133eb0d19c19ae9afaf117933274 25-Aug-2010 John McCall <rjmccall@apple.com> Remove AnalysisBasedWarnings.h's dependency on Type.h



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fb97e75e627599aaa7a613778134e290f9de663b 25-Aug-2010 John McCall <rjmccall@apple.com> When trying to resolve the address of an overloaded expression,
only form pointers-to-member if the expression has the appropriate
form. This avoids assertions later on on invalid code, but also
allows us to properly resolve mixed-staticity overloads.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4020f8703a8822fe0d4efe4a0dc74f0b8040bd9f 25-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> It is not error in c++ to take address of
register variable (c++03 7.1.1P3). radar 8108252.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
fb3bb31af0bdf25b869d42599133d590cdf8c2c1 24-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7971: Compute the correct type for an address-of expression containing an
UnresolvedMemberExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
4e6fbce4277fbc7c574fb2393c7dfe06f014c21a 23-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.

We add explicit code to the default initialization path to ensure the
definition is both present and valid.

Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
a7e6845660f91ec611427e1db842780e1ec12bdb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d226f65006733ed7f709c3174f22ce33391cb58f 21-Aug-2010 John McCall <rjmccall@apple.com> DeclPtrTy -> Decl *



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d9ca4ab3ed3637e97a19d716aa9fbd54c6a5f698 20-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Add a workaround for PR7947, a crash trying to recover from invalid C++ code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
57dae1a312e3f7591e957adc89776ef4bca6a097 16-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose assiging to an interface object in
non-fragile abi mode as sizes are not statically known.
Fixes radar 8315734.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f759b4dc74fe8b0cc6e1350b860676ac9b853371 13-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> When issuing warning for future conflict resolution,
(nonfragile-abi2), do not consider 'ivar' access
in class methods. Also, improve on diagnostics.
Radar 8304561.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
de7e66256b1bdfcf6526994825a8c8fced52a31c 13-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Zap unused UnaryOperator::OffsetOf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b7f4ffe073fa419613946461a2583ba2fcb72280 12-Aug-2010 John McCall <rjmccall@apple.com> Implement -Wcast-align. The initial design of this diagnostic diverges
from GCC's in that we warn on *any* increase in alignment requirements, not
just those that are enforced by hardware. Please let us know if this causes
major problems for you (which it shouldn't, since it's an optional warning).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
476d8b863cb65b2b5833235d97315cdb46e6f5aa 11-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Random temporary string cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2cad900202561cdda18ea6cc51ddbf3e20e3c23a 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to VAArgExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3fcb73dae91be42b071cf0dde9222b7ec362146d 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to TypesCompatibleExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e26f0432c20de7034f414809628d10bfd961ca04 10-Aug-2010 Douglas Gregor <dgregor@apple.com> When attempting to recover from a failed unqualified name lookup, make
sure to clear out the LookupResult structure after looking into each class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
443c21266f189ed48c32cadf72c463e9b992b3eb 07-Aug-2010 Douglas Gregor <dgregor@apple.com> Integral-to-pointer conversions are not always null -> member pointer
conversions. Fixes PR7443.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
647c8b32c2a6e38ee44dde1782a629e9c03786e2 07-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7837: For qualified id's, make sure the decl context is complete if not
dependent in ActOnIdExpression. (This issue only shows up with member
operators because an operator is never a type.)



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5a15dc1a4348338e9a026a24c8d9a59f2bdd5ecf 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Flip the switch to use OffsetOfExpr unconditionally; feel free to revert if
this breaks something.

I'll wait a few days before cleaning out UnaryOperator::OffsetOf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
19410a7e8ff6df550eb776574950d352a1de2bd8 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7769: Fix references to anonymous structs/unions in base classes in
offsetof expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c133e9ea17d61062bcfb3bd6009c300c9a78161f 05-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the warning for variables declared in the if-expression being used in
the else clause. The problem is that it's overly zealous and will respond to
uses in assignments, or after assignments. We should bring this back once we
can do it right. Fixes PR7100.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
73f666ff7cd47c334aa051aa5a778a8fa71ae9ab 30-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Tighten the rules when deciding if an ivar must be
auto-synthesized (nonfragile-abi2 specific).
Fixes radar 8251648.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b1d58e3a625d027165ff1c084d367ee4281cae7a 29-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Tigthen the condition for issung ivar shadowing
variables to those in file scope (nonfragile-abi2).
Fixes radar 8248681.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8f70ddb5576f338d409caa1404cebd40d6a05951 29-Jul-2010 Douglas Gregor <dgregor@apple.com> When taking the address of a value of Objective-C object type (e.g.,
one because we're referencing a variable of type NSString &), the
resulting type is an ObjCObjectPointerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d4bb946269303996edadffce642301bee87a62f 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Don't die when a member access refers to a non-class member via a
qualified name. Fixes <rdar://problem/8231724>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0246376203474718e0ec7e4025b1820c6e72a3da 27-Jul-2010 Eli Friedman <eli.friedman@gmail.com> Fix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
787b0946959d1203d5bb95a298ee2e7286ded995 27-Jul-2010 Eli Friedman <eli.friedman@gmail.com> PR7724: Don't try to evaluate value-dependent expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b7690b425845b636849f25074d64d30aad646473 24-Jul-2010 Chris Lattner <sabre@nondot.org> turn down the logical bitwise confusion warning to not warn
when the RHS of the ||/&& is ever 0 or 1. This handles a variety of
creative idioms for "true" used in C programs and fixes many false
positives at the expense of a few false negatives. This fixes
rdar://8230351.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb024acef8a8fef3cb5e01a2e0c3efb90372c8af 23-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.
Radar 8218839.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f60946222721d9ba3c059563935c17b84703187a 23-Jul-2010 Douglas Gregor <dgregor@apple.com> Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
69d5624644dad6b5117f8fee8fc4b09427861367 23-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Warn when property ivar lookup finds a global variable
of same name. In nonfragile-abi2, lookup accesses a synthesized
ivar. This is a transition warning. Radar 8225011.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
042411cc447f9b120086a6e4650583044f66fd12 21-Jul-2010 Ted Kremenek <kremenek@apple.com> Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior. Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent. We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.

Fixes <rdar://problem/8213093>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
84ef4b20b323e76b3eb51e436b300bc877aee5c0 19-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Categories cannot synthesize property ivars,
and a minor cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8d438087bd7120990663e4df78a9c9fdb02c5209 17-Jul-2010 Eli Friedman <eli.friedman@gmail.com> Check for casts to an incomplete type in C. Improves diagnostics for cast to
incomplete union (PR5692) and incomplete enum, and fixes obscure
accepts-invalid on cast to incomplete struct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ad51e74030a59a8aa4ef0ebca1d7a701602ef53b 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
23ef3e4f044d701d0f84980fd9816fedf17fc0cb 15-Jul-2010 Chris Lattner <sabre@nondot.org> restrict the && -> & warning to cover a case daniel noted.
Don't warn about "logically bool" expressions on the RHS,
even if they fold to a constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9ccd7251047d5177c2ef5f5dfea324d47c5d18f3 14-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Consider obective-c pointer arguments as valid sentinel args
as well. Fixes radar 7975788.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
90a8f27f144233b53cac0c88a1595f7f05105b7e 13-Jul-2010 Chris Lattner <sabre@nondot.org> Add a warning to catch a bug recently caught by code review, like this:
t2.c:2:12: warning: use of logical && with constant operand; switch to bitwise &
or remove constant [-Wlogical-bitwise-confusion]
return x && 4;
^ ~

wording improvement suggestions are welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
84ca008a462b515f63871253f494d53c9190363c 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Compute Type dependent-ness of BlockDeclRefExpr
on the fly when constructing it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
52bc56a296b11b4fc6bf5ddf4ded5262f6484bdb 12-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Move setting of Dependent Type to BlockDeclRefExpr's
constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
64d092c232bc282762430df9eb67beafffaa2fdc 12-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Fix another aspect of PR7047, macro expansions. Previously, this was hacked
around by exempting enums from the check, but this doesn't handle a lot of
cases. A better approach is to directly check if the operator comes from
a macro expansion.

I've removed a reference to the rdar that originally led to the enum
suppression when removing it's overly contrived test case. Let me know if that
number or a more reasilistic test case involving enums is still needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
999194739e3a2d35b5a1e563ba514cba8b4ab252 10-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Lay the ground work for resoving PR7047. This doesn't actually fix it because
default arguments to template parameters don't have a DeclContext when
instantiated, and so we can't detect that we're in an instantiation context as
opposed to the definition context. However, it fixes the more commonly-occuring
cases in TMP code that use devolve to this type of tautology after
substitution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
833f42e32754515bc108b9b1ccccc6e373915a6c 10-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> BlockDeclRefExpr of a dependent type must
be a dependent expression when its is built.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a729da2c29e7df26319acf2675d51e377287a139 09-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Instantiation of block literal expressions. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
24bae92f08ae098cc50a602d8cf1273b423e14da 08-Jul-2010 Douglas Gregor <dgregor@apple.com> When performing substitution of template arguments within the body of
a template, be sure to include the template arguments from the
injected-class-name. Fixes PR7587.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
06a54a38be5054c910ffc92db60edab23f9ea105 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8b5dec3002bd3e17061a8bf1fc35ba82912ec768 07-Jul-2010 Chris Lattner <sabre@nondot.org> implement PR7569, warning about assignment to null, which
people seem to write when they want a deterministic trap.
Suggest instead that they use a volatile pointer or
__builtin_trap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
03d98c5d592d74ae97aa3f93f80441b64960e4b6 06-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Fix multiple emission of the this-> fixit for each instantiation by fixing the
AST during the instantiation. Fixes PR7417!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c721ae85bac9bccd8494d43c1c1ec596030ffbd0 05-Jul-2010 Chris Lattner <sabre@nondot.org> fix a bug I introduced in r107624


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fd79a9d403943c01fd6650878a86b96a9378beaf 05-Jul-2010 Chris Lattner <sabre@nondot.org> rearrange some logic, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8bb59a828ef21d0b2ed2b0efab60e4eddcb81c62 01-Jul-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix vector literal/cast confusion - bug 6895.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25973455aed1cdc9c40b208c792b5db4f8f1297d 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix rdar://8139785 "implement warning on dead expression in comma operator"

As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:

x || test_logical_foo1();

emitted a bogus "expression result unused" for 'x'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
12eb5d6aa882eb247a6c22225b625eee04217105 29-Jun-2010 Douglas Gregor <dgregor@apple.com> When typo correction produces a result that is not of the kind we're
looking for, reset the name within the LookupResult structure in
addition to clearing out the results. Fixes PR7508.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
00619623af0b9d3271e31402ec1a95e84c2c4526 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Vector types are not arithmetic types, either. Note that we now ban
__real myvec and __imag myvec, since they aren't all that useful (it's
just an identity function) but we might want to use them in more
restricted cases in the future (e.g., "__real mycomplexvec" could
extract the real parts of a vector of complex numbers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8eee119bf4f1693dde17b8552c1f9f81bf2b681e 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Change Type::isFloatingType() to reflect the actual definition of a
"floating type" in C, which does not include vector types. Introduce
Type::hasFloatingRepresentation() for the places where we want to know
whether the underlying representation is one or more floating-point
values. Remove some hacks we had where the former behavior of
Type::isFloatingType() was at odds with the language definition of the
term.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f918b8328add31b17075def5f56e53a3c572b084 22-Jun-2010 Douglas Gregor <dgregor@apple.com> Zero out a stale pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c070cc602d6eefea881f71a60de09e05b54c3fdd 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
949bd4b611f4be575d63da36c94c3662dfa4d459 17-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Do not treat @selector as lvalue (unlike g++).
Patch by Nico Weber (pr7390).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ad00b7705f9bbee81beeac428e7c6587734ab5a6 16-Jun-2010 John McCall <rjmccall@apple.com> Fix a point of semantics with using declaration hiding: method templates
introduced by using decls are hidden even if their template parameter lists
or return types differ from the "overriding" declaration.

Propagate using shadow declarations around more effectively when looking up
template-ids. Reperform lookup for template-ids in member expressions so that
access control is properly set up.

Fix some number of latent bugs involving template-ids with totally invalid
base types. You can only actually get these with a scope specifier, since
otherwise the template-id won't parse as a template-id.

Fixes PR7384.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d3347a5887d2d25afe8b0bd35783a72ec86cce2 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.

Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
6e5122c8ce152e19355b707d952ab53fe58bd7ad 15-Jun-2010 Douglas Gregor <dgregor@apple.com> Update equality and relationship comparisons of pointers to reflect
C++ semantics, eliminating an extension diagnostic that doesn't match
C++ semantics (ordered comparison with NULL) and tightening some
extwarns to errors in C++ to match GCC and maintain conformance in
SFINAE contexts. Fixes <rdar://problem/7941392>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7dc480fa428beceaa784b8a3b35d7df0bf849a58 15-Jun-2010 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e3e210c3aa3c1b289eee669a1d235fc16df384a0 10-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dfc35e33177a433b56454f1d2b5e53734f65b288 09-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.

Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d64fdd0c056f1e50488519254f852fa8050f0470 08-Jun-2010 Douglas Gregor <dgregor@apple.com> Warn about comparisons between arrays and improve self-comparison
warnings, from Troy Straszheim! Fixes PR6163.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d7c7338dd7bf1a35179ec3521f7438c0fbd98e9c 08-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a typo which prevented proper code gen. for
copy-in of c++ class objects into blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e2a901a1883a74469bdcd22e38f52b3f877bc6ca 08-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> When using property-dot assignment syntax to call a setter method,
type of rhs need be compared to setter's argument and
not the getter type. Fixes radar 8062778


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
310b1c421665241d9b135c517d5031716d4a3221 07-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Use MaybeCreateCXXExprWithTemporaries for potential destruction of
created temporary. Use own initialized entity for copied in block
variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
59da45a1fc10a3af4f3b3152f45504b4c5ca7385 04-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Build AST for copy-construction of copied-in
class object in blocks and carry it to IRGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c71a4915ca216847599d03cab4ed1c5086b0eb43 04-Jun-2010 John McCall <rjmccall@apple.com> Preserve more information from a block's original function declarator, if one
was given. Remove some unnecessary accounting from BlockScopeInfo. Handle
typedef'ed function types until such time as we decide not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
82dc00948fe7116edd31bfa07a728fda98648be1 04-Jun-2010 John McCall <rjmccall@apple.com> Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef. Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
75f7c0f5a82689c5abe1f4c5b93bfe1fbe5feaa8 04-Jun-2010 John McCall <rjmccall@apple.com> Remove a couple of unnecessary uses of IsStandardConversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dc32cdf2a92de17901496d064db83786d552137f 02-Jun-2010 Daniel Dunbar <daniel@zuster.org> Fix unintentional method call due to false -> pointer conversion; patch by Dimitry Andric!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
88623ade9599d2a2f4e21e80bce00fb4cb9e7d5f 23-May-2010 Douglas Gregor <dgregor@apple.com> In C++, one cannot assign from an arithmetic type to an enumeration
type. Fixes PR7051.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9ba6af8bedba28d10a6906c62c19d43f81c5d386 23-May-2010 Douglas Gregor <dgregor@apple.com> Complain about sizeof(overloaded function) rather than crashing.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d6b0e94db30c0e2754d270753c6f75478e451bf 22-May-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of reference binding for subobjects of
temporaries. There are actually several interrelated fixes here:

- When converting an object to a base class, it's only an lvalue
cast when the original object was an lvalue and we aren't casting
pointer-to-derived to pointer-to-base. Previously, we were
misclassifying derived-to-base casts of class rvalues as lvalues,
causing various oddities (including problems with reference binding
not extending the lifetimes of some temporaries).

- Teach the code for emitting a reference binding how to look
through no-op casts and parentheses directly, since
Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make
sure that we properly look through multiple levels of indirection
from the temporary object, but destroy the actual temporary object;
this fixes the reference-binding issue mentioned above.

- Teach Objective-C message sends to bind the result as a temporary
when needed. This is actually John's change, but it triggered the
reference-binding problem above, so it's included here. Now John
can actually test his return-slot improvements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1fd6d44d7ca97631497551bbf98866263143d706 22-May-2010 Douglas Gregor <dgregor@apple.com> Improve parser recovery when we encounter a dependent template name
that is missing the 'template' keyword, e.g.,

t->getAs<T>()

where getAs is a member of an unknown specialization. C++ requires
that we treat "getAs" as a value, but that would fail to parse since T
is the name of a type. We would then fail at the '>', since a type
cannot be followed by a '>'.

This is a very common error for C++ programmers to make, especially
since GCC occasionally allows it when it shouldn't (as does Visual
C++). So, when we are in this case, we use tentative parsing to see if
the tokens starting at "<" can only be parsed as a template argument
list. If so, we produce a diagnostic with a fix-it that states that
the 'template' keyword is needed:

test/SemaTemplate/dependent-template-recover.cpp:5:8: error: 'template' keyword
is required to treat 'getAs' as a dependent template name
t->getAs<T>();
^
template

This is just a start of this patch; I'd like to apply the same
approach to everywhere that a template-id with dependent template name
can be parsed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc365c53606ab90537576cb48d93a54ce3fb0cb5 21-May-2010 John McCall <rjmccall@apple.com> Introduce a method to get from an anonymous struct or union record declaration
to the associated object declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d2235f60e7bbd9e690c05fced371df9da76adc2b 20-May-2010 Douglas Gregor <dgregor@apple.com> Reinstate r104117, Chandler Carruth's change that "[provides] a naming
class for UnresolvedLookupExprs, even when occuring on template
names" along with a fix for an Objective-C++ crasher it introduced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
bf1cbaf1b0ac9d967ff6abf27788cc98f0f5e7da 19-May-2010 Daniel Dunbar <daniel@zuster.org> Revert r104117, "Provide a naming class for UnresolvedLookupExprs, even when
occuring on..." which breaks some Objective-C code. Working on getting a test
case...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c3f984fa13364520f4a2c447d1d213db77db3309 19-May-2010 Chandler Carruth <chandlerc@gmail.com> Provide a naming class for UnresolvedLookupExprs, even when occuring on
template names. We were completely missing naming classes for many unqualified
lookups, but this didn't trigger code paths that need it. This removes part of
an optimization that re-uses the template name lookup done by the parser to
determine if explicit template arguments actually form a template-id.
Unfortunately the technique for avoiding the duplicate lookup lost needed data
such as the class context in which the lookup succeeded.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6cfacfe54c75baa4d67f1fbdf4f80644b662818e 17-May-2010 Douglas Gregor <dgregor@apple.com> Determine when the instantiation of a friend function defined inside a
class template conflicts with an existing (non-template)
definition. This is another part of PR6952.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9a0fcfe659b65e1e1bba4ba5f35a12ffcd088ea0 17-May-2010 Eli Friedman <eli.friedman@gmail.com> PR7117: Make sure we don't lose the calling convention for K&R-style
definitions.



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


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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b4eeaff1595b7d0a8fbc2b3c8bec7dc63f48b7fd 08-May-2010 Douglas Gregor <dgregor@apple.com> When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f3e63374ac1f711486cb541896669712847a5457 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> A correct fix for bug 6466.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0aa866f955deea1851918c2c9fbf60d7afd0ce1f 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Revert 103247, it causes lots of test failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
44094690918dec25409d1c5968c80d623fecc8b2 07-May-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Pass the correct type to BuildMemberReferenceExpr. Fixes bug 6466.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8eb662ed5e04bd0f494c7dbefacb7d45660ab9fa 07-May-2010 John McCall <rjmccall@apple.com> After some discussion, conservatively extend our sentinel check to discard
casts, but still require the (casted) type to be a pointer. Fixes PR5685.



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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
06a9f3680d22529a2fcf20c52d71cf221d99d910 01-May-2010 Douglas Gregor <dgregor@apple.com> Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

- For a class subobject, call the appropriate copy-assignment
operator, after overload resolution has determined what that is.
- For an array of scalar types or an array of class types that have
trivial copy assignment operators, construct a call to
__builtin_memcpy.
- For an array of class types with non-trivial copy assignment
operators, synthesize a (possibly nested!) for loop whose inner
statement calls the copy constructor.
- For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
39957dce3df743023906926b40108d99bc8b0ce2 01-May-2010 Douglas Gregor <dgregor@apple.com> Added an RAII object that helps set up/tear down the Sema context
information required to implicitly define a C++ special member
function. Use it rather than explicitly setting CurContext on entry
and exit, which is fragile.

Use this RAII object for the implicitly-defined default constructor,
copy constructor, copy assignment operator, and destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
77bb1aa78bcd26e42c0382043e65a2b03242be4d 01-May-2010 John McCall <rjmccall@apple.com> It turns out that basically every caller to RequireCompleteDeclContext
already knows what context it's looking in. Just pass that context in
instead of (questionably) recalculating it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cc8a5d5f90bbbbcb46f342117b851b7e07ec34f1 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1e3f5bab00661c612044675c1a9d3ec3237802da 29-Apr-2010 Sean Hunt <rideau3@gmail.com> Ensure that cv-qualifiers are correctly removed for post-inc/decrements
as well as pre- and post-inc/decrements in C (not that I think it
matters for any C code).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9d5d60ff8d7991234abcc6a9fe9903db930be0a1 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Diagnose __builtin_offsetof expressions that refer to bit-fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8ecdb65716cd7914ffb2eeee993fa9039fcd31e8 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

1) CodeGen cannot handle the case where __builtin_offsetof is not a
constant expression, so it produces an error. So, to avoid
regressing in C, we retain the old UnaryOperator-based
__builtin_offsetof implementation in C while using the shiny new
OffsetOfExpr implementation in C++. The old implementation can go
away once we have proper CodeGen support for this case, which we
expect won't cause much trouble in C++.

2) __builtin_offsetof doesn't work well with non-POD class types,
particularly when the designated field is found within a base
class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6ec5c42047c717014f7490bb9697945ae7a9d5b 28-Apr-2010 Douglas Gregor <dgregor@apple.com> When the qualifier of a id-expression is non-dependent but not
complete, return an error rather than falling back to building a
dependent declaration reference, since we might not be in a dependent
context. Fixes a fiendish crash-on-invalid in Boost.FunctionTypes that
I wasn't able to reduce to anything useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
15dedf067b65151f0fd89dd9f80cea96a0528db1 27-Apr-2010 Douglas Gregor <dgregor@apple.com> It's okay to refer to non-type template parameters anywhere they are
visible. Fixes the remaining two failures in Boost.ScopeExit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c96be1ea33cdf63d07cec48d18fe8e3afea48f8d 27-Apr-2010 Douglas Gregor <dgregor@apple.com> During template instantiation, set the naming class of
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the
naming class we computed when building the expression in the
template...

... which we didn't always do correctly. Teach
UnresolvedMemberExpr::getNamingClass() all about the new
representation of injected-class-names in templates, so that it can
return a naming class that is the current instantiation.

Also, when decomposing a template-id into its template name and its
arguments, be sure to set the naming class on the LookupResult
structure.

Fixes PR6947 the right way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
110acc1ae8d978f9b423394eaf0cace61b1339f0 27-Apr-2010 John McCall <rjmccall@apple.com> Improve the diagnostic you get when making a qualified member access
with a qualifier referencing a different type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2b147f072b118607aafafd2f05843243abfe4488 25-Apr-2010 Douglas Gregor <dgregor@apple.com> When name lookup finds a single declaration that was imported via a
using declaration, look at its underlying declaration to determine the
lookup result kind (e.g., overloaded, unresolved). Fixes at least one
issue in Boost.Bimap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
cee22421929c91b481f4d1bb85cd48c0f6b7510b 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add base paths to CK_UncheckedDerivedToBase and CK_DerivedToBaseMemberPointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
92e986e0adb79e8a47f738bd608e6c97c547641d 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement template instantiation for Objective-C++ message sends. We
support dependent receivers for class and instance messages, along
with dependent message arguments (of course), and check as much as we
can at template definition time.

This commit also deals with a subtle aspect of template instantiation
in Objective-C++, where the type 'T *' can morph from a dependent
PointerType into a non-dependent ObjCObjectPointer type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a41a8c5972c2632247ae7913cf6ce65d45f7e702 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:

t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
type 'int *' [-pedantic]
f(long_ptr);
^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
04badcf84c8d504d8491c7c7e29b58f52cb16640 21-Apr-2010 Douglas Gregor <dgregor@apple.com> Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

1) Send to a object instance described by an expression (e.g., [x method:5])
2) Send to a class described by the class name (e.g., [NSString method:5])
3) Send to a superclass class (e.g, [super method:5] in class method)
4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

1) Unchanged; the object instance is represented by an Expr*.

2) Previously stored the ObjCInterfaceDecl* referring to the class
receiving the message. Now stores a TypeSourceInfo* so that we know
how the class was spelled. This both maintains typedef information
and opens the door for more complicated C++ types (e.g., dependent
types). There was an alternative, unused representation of these
sends by naming the class via an IdentifierInfo *. In practice, we
either had an ObjCInterfaceDecl *, from which we would get the
IdentifierInfo *, or we fell into the case below...

3) Previously represented by a class message whose IdentifierInfo *
referred to "super". Sema and CodeGen would use isStr("super") to
determine if they had a send to super. Now represented as a
"class super" send, where we have both the location of the "super"
keyword and the ObjCInterfaceDecl* of the superclass we're
targetting (statically).

4) Previously represented by an instance message whose receiver is a
an ObjCSuperExpr, which Sema and CodeGen would check for via
isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
where we have both the location of the "super" keyword and the
ObjCInterfaceDecl* of the superclass we're targetting
(statically). Note that ObjCSuperExpr only has one remaining use in
the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

if (message has a receiver expression) {
// instance message
if (isa<ObjCSuperExpr>(...)) {
// send to super
} else {
// send to an object
}
} else {
// class message
if (name->isStr("super")) {
// class send to super
} else {
// send to class
}
}

with a switch

switch (E->getReceiverKind()) {
case ObjCMessageExpr::SuperInstance: ...
case ObjCMessageExpr::Instance: ...
case ObjCMessageExpr::SuperClass: ...
case ObjCMessageExpr::Class:...
}

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
ccfa9639f8d09733bcf1c2572c5bd3daba5bd632 16-Apr-2010 Eric Christopher <echristo@apple.com> Expand the argument diagnostics for too many arguments and give
both number seen and number expected.

Finishes fixing PR6501.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d77b9a29651d748f0e30a8dad8969635fc04f725 16-Apr-2010 Eric Christopher <echristo@apple.com> Expand argument diagnostic for too few arguments to give the number
of arguments both seen and expected.

Fixes PR6501.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aaf87162c5fbfbf320072da3a8e83392e1bbf041 14-Apr-2010 Douglas Gregor <dgregor@apple.com> Teach typo correction about various language keywords. We can't
generally recover from typos in keywords (since we would effectively
have to mangle the token stream). However, there are still benefits to
typo-correcting with keywords:
- We don't make stupid suggestions when the user typed something
that is similar to a keyword.
- We can suggest the keyword in a diagnostic (did you mean
"static_cast"?), even if we can't recover and therefore don't have
a fix-it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
55b38842d12ffd9f9ff3a0e16fae2cfe61ab0fe6 14-Apr-2010 Douglas Gregor <dgregor@apple.com> When diagnosing suspicious precedence or assignments, move the fix-it
that adds parentheses from the main diagnostic down to a new
note. This way, when the fix-it represents a choice between two
options, each of the options is associted with a note. There is no
default option in such cases. For example:

/Users/dgregor/t.c:2:9: warning: & has lower precedence than ==; ==
will be
evaluated first [-Wparentheses]
if (x & y == 0) {
^~~~~~~~
/Users/dgregor/t.c:2:9: note: place parentheses around the &
expression to
evaluate it first
if (x & y == 0) {
^
( )
/Users/dgregor/t.c:2:9: note: place parentheses around the ==
expression to
silence this warning
if (x & y == 0) {
^
( )



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
709210feee317b8d6690dd1d15c2b74cfe55e261 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Use ASTVector instead of std::vector for the Exprs in InitListExpr. Performance
measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance
change, but now the vector isn't leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
01e56aecb77a96dcd93fa0e901b919f2e441981d 12-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement C++ [temp.local]p4, which specifies how we eliminate
name-lookup ambiguities when there are multiple base classes that are
all specializations of the same class template. This is part of a
general cleanup for ambiguities in template-name lookup. Fixes
PR6717.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
966c78b79004061c1f64feff96818b9f1d68ea58 12-Apr-2010 Chris Lattner <sabre@nondot.org> change Scope::WithinElse to be a normal scope flag, widen the
fields to two 16-bit values instead of using bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aec43dbfd04dc5709e2aa7e23e6d1dbe0eb85ac0 12-Apr-2010 Chris Lattner <sabre@nondot.org> fix a fixme, stop evaluating getCurMethodDecl() repeatedly
in "LookupInObjCMethod".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb483eb3ee80300f15d6d13573d82493c2194461 11-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6811 by not parsing 'super' as a magic expression in
LookupInObjCMethod. Doing so allows all sorts of invalid code
to slip through to codegen. This patch does not change the
AST representation of super, though that would now be a natural
thing to do since it can only be in the receiver position and
in the base of a ObjCPropertyRefExpr.

There are still several ugly areas handling super in the parser,
but this is definitely a step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b9d4fc1f54924a7b242fb763192a40c19fa6103d 11-Apr-2010 Chris Lattner <sabre@nondot.org> actually the interface grossness in the previous patch was due to
typo correction. However, now that the code has been factored out
of LookupMemberExpr, it can recurse to itself instead of to
LookupMemberExpr! Remove grossness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7f81652f97a69ae8b514893a69c0245253687e55 11-Apr-2010 Chris Lattner <sabre@nondot.org> factor the code that handles "expr.field" when expr is a
pointer to an objc interface out to a method in SemaExprObjC.
This is *much* uglier than it should be due to grossness in
LookupMemberExpr :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
03a4bee558b63ead66e942c6b26381df9a8b1754 09-Apr-2010 Ted Kremenek <kremenek@apple.com> Remove fixit for string literal comparison. Telling the user to use 'strcmp' is bad, and
we don't have enough information to tell them how to use 'strncmp'. Instead, change the
diagnostic to indicate they should use 'strncmp'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d4eea8362605807327735727a9098abe1eb23b19 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~

Fixes <rdar://problem/7447179>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
fc2ca56874e1c8186ac30c0c3af13dc5e806cf74 07-Apr-2010 Douglas Gregor <dgregor@apple.com> Return early from Sema::MarkDeclarationReferenced when we know there
isn't any extra work to perform. Also, don't check for unused
parameters when the warnings will be suppressed anyway. Improves
performance of -fsyntax-only on 403.gcc's combine.c by ~2.5%.
<rdar://problem/7836787>



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6aae87d3839fad00b46159b5b67ef1da5f6c19e9 02-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose invalid code with -fobjc-nonfragile-abi2 when
property is being accessed without the dot-syntax notation.
(radar 7822344).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
bd63e02a0deb0fdaec708c7a4b4c7073937fd67d 31-Mar-2010 John McCall <rjmccall@apple.com> Remove silly temporary comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
23cba801e11b03929c44f8cf54578305963a3476 31-Mar-2010 John McCall <rjmccall@apple.com> Introduce a new kind of derived-to-base cast which bypasses the need for
null checks, and make sure we elide null checks when accessing base class
members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
425ef72306d4ff6b3698b744353e5f0e56b4b884 31-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.



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

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

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
528adb129faa6e8ca17be561539c7eede1fc024d 24-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Allow conversion of qualified Class type to unqualified
Class type to match gcc's. Fixes radar 7789113.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d064fdc4b7b64ca55b40b70490c79d6f569df78e 23-Mar-2010 Ted Kremenek <kremenek@apple.com> Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
053f4bddcb10bd3b17cd6a66fe52e265498603ed 22-Mar-2010 John McCall <rjmccall@apple.com> -Wshadow should only warn about parameter declarations when we're
entering a function or block definition, not on every single declaration.
Unfortunately we don't have previous-lookup results around when it's time
to make this decision, so we have to redo the lookup. The alternative is
to use delayed diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dbdbaaf34f798fa5cabec273c4b9397b3fd6a98c 20-Mar-2010 Ted Kremenek <kremenek@apple.com> Refactor CFG-based warnings in Sema to be run by a worked object called AnalysisBasedWarnings.
This object controls when the warnings are executed, allowing the client code
in Sema to selectively disable warnings as needed.

Centralizing the logic for analysis-based warnings allows us to optimize
when and how they are run.

Along the way, remove the redundant logic for the 'check fall-through' warning
for blocks; now the same logic is used for both blocks and functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d4c60909ae7ad1ab603feedf04d457d72e85fbc4 19-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose conversion of 'Class' to/from objective-c
object pointer types.
Fixes radar 7634850.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
90c71268f04369328e8f579007b8b4f1da9feea0 18-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Some cleanup, change diagnostic when assigning to
a property which is not lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
132f2a2da34f378fc675b9e174564b0f52c31d98 17-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> objective-c patch to provide type safty when blocks are passing or
returning objc objects. There will be a corresponding objective-c++
patch soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8596bbe00e3cd670652ddaf0c22d14aa84bb6fb8 17-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Issue error when a byref array is accessed in a block
literal. Fixes radar 7760213.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
453091cc2082e207ea2c2dda645a9bc01b37fb0c 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b7a834e0fecddd9eaf1f4567867c718e4eebf50 15-Mar-2010 John McCall <rjmccall@apple.com> Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
193575455e00eca03fd7177f60e3f2e6263cb661 13-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use SmallString instead of SmallVector

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
dd8f569f84a73c0b0e1449475f333d101e6c9401 10-Mar-2010 Douglas Gregor <dgregor@apple.com> Statement expressions can be used in global- or namespace-scoped blocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dbf217af72acefe7702c65dad2d5e534b3de9674 06-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Allow use of byref (__block attributed) arrays inside
the block. Fixes radar 7671883.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
9ea9bdbc14374f7bacdb50d3e52c664ff12150ff 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.

The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.

Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6d97e5e4b7abdae710c2548b51f4ed0298e86d80 01-Mar-2010 Chris Lattner <sabre@nondot.org> Implement jump checking for initialized c++ variables, implementing
a fixme and PR6451.

Only perform jump checking if the containing function has no errors,
and add the infrastructure needed to do this.

On the testcase in the PR, we produce:

t.cc:6:3: error: illegal goto into protected scope
goto later;
^
t.cc:7:5: note: jump bypasses variable initialization
X x;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
076ceb093e5e4c1d6e8f6fcd27a816277a1041e2 01-Mar-2010 Douglas Gregor <dgregor@apple.com> Start detangling the BlockSemaInfo/Sema mess. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ddeea5644367c9c153c9fee9e51bdea85ce43cbd 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2a0d7574acaa3a8d516e9ae4b720755460ebe8a8 27-Feb-2010 John McCall <rjmccall@apple.com> At sabre's request, drop the FP bounds diagnostics down to warnings and file
them under -Wbad-literal. They're still on by default.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
f316a1d40bf224f16576b9b1727003d2259399f9 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Remove some oogly code made dead by the pseudo-destructor
instantiation changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
354095c29ef10d4763ec079fde4d6f73841152f6 19-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Issue extended diagnostic when property dot-syntax is used and
there is a setter but no getter (part of radar 7664555).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba7bc5584b8d46f4e8deb3a9d363256908fa86ea 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Revert: "Change InitListExpr to allocate the array for holding references"

This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9f9269e810bfe9aea0a57b09250be215808fc1a2 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e873fb74219f48407ae0b8fa083aa7f0b6ff1427 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Introduce a new kind of failed result for isLvalue/isModifiableLvalue
which describes temporary objects of class type in C++. Use this to
provide a more-specific, remappable diagnostic when takin the address
of such a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9a66c303c7024967a48877106384bf315c84e80e 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Complain if block-literal expression's parameter name is
missing (in c/objc mode). Fixes radar 7528255.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6bbc01d1c4ec5241df36042e0a4a12a6711934b 12-Feb-2010 Tanya Lattner <tonic@nondot.org> Implementing unused function warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb3b324800598cc3d5385fbad95ae5cff2c79113 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
848fa64143fbe5ae62a601ad61277f741e54dfab 11-Feb-2010 Anders Carlsson <andersca@mac.com> More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e9ff443040cb571ae2c5c2626c4dc9a9a812d84a 11-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose when user provided getter is being used as lvalue
using property dot-syntax. Fixes radar 7628953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
952b017601f9c82b51119c3a1600f1312a833db9 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
77e2dde750c271155f35949a6d3c22f8e7d287f8 09-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Finish implementing property synthesis by default.
(radar 7381956).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
412e798941ca64e2e6b084323915fa9aa5f6bdf3 09-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Implement synthesizing properties by default.
This is a non-fragile-abi feature only. Since it
breaks existing code, it is currently placed under
-fobjc-nonfragile-abi2 option for test purposes only
until further notice. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4c72d3ec68b88868a75b3e6bbe5520dcefe86a95 08-Feb-2010 John McCall <rjmccall@apple.com> Fix the crash-on-invalid from PR6259.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
525f96c0ef39f91abd26b1b4584ba1814e7ebc28 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Default function arguments for function template specializations
always come from the primary template, so gather the instantiation
template arguments from the primary template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
136b0cd75c37895ed0e00dee5b06c55c5b1d8199 03-Feb-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6220: compute the correct type for multicharacter literals.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
093802675b1548f2a5f44c29938d65cce00d58bb 31-Jan-2010 Anders Carlsson <andersca@mac.com> Diagnose binding a non-const reference to a vector element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
86b8e0949869bb9a7af3a703e8756bad8621c9c5 29-Jan-2010 Douglas Gregor <dgregor@apple.com> When naming a function template via a qualified-id (or any other way
that ADL is suppressed), we need to build an
UnresolvedLookupExpr. Fixes PR6063, which was hitting Boost headers
pretty hard.


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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1309f9a3b225ea846e5822691c39a77423125505 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7a9813ced7455b8a33a807489ca77a4f809c8a73 22-Jan-2010 John McCall <rjmccall@apple.com> Create function, block, and template parameters in the context of the
translation unit. This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts. This gives us the nice property that everything created
in a record DC should have access in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a3899eb5e30426b00b80232a15ae557dd4caa5b8 20-Jan-2010 Mike Stump <mrs@apple.com> Implement goto inside of blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1d7d8d66eff7ed0f3e957d330930cc9ab8047add 19-Jan-2010 John McCall <rjmccall@apple.com> The type of a compound literal expression is not necessarily the same as the
type which was syntactically written. Fixes PR 6080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd0cb9097ff4a9c88cb6a3cd377245ecb260c120 19-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics (instead of crashing in code gen) when using
property dot-syntax notation to use setter/getters in objective-c.
Fixes radar 7553050.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
42f56b50062cd3b3c6b23fdb9053578ae9145664 18-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
60406bede202b66ebdd98cac0c38d20f9698aeca 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Introduce a second queue of "local" pending implicit instantiation,
which are instantiations of the member functions of local
classes. These implicit instantiations have to occur at the same time
as---and in the same local instantiation scope as---the enclosing
function, since the member functions of the local class can refer to
locals within the enclosing function. This should really, really fix PR5764.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b042fdfc9460e0018276412257e3c3226f9ea96e 15-Jan-2010 John McCall <rjmccall@apple.com> Don't lose type source information when rebuilding C-style cast expressions.
Also we don't need to recheck for altivec initializers, I think.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
c2233c5c46eafebd5529bf2bbd1f0a723b892e61 15-Jan-2010 John McCall <rjmccall@apple.com> Don't repeat lookup when instantiating resolved member expressions.
Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit
member accesses, which can arise from unqualified lookups and therefore may
reference decls from enclosing class scopes.

Fixes PR 5838.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fa6ef180c0d3609124217387618fbb51bbdd2e48 13-Jan-2010 Mike Stump <mrs@apple.com> Add an unreachable code checker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
48c2d562fbfcd5fcfc212d62d070591f27d0eafa 13-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> When in objective-c methods, do the built-in name lookup after
ivar name lookup. Fixes pr5986.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d1e4d9bfd57f643d950eb1373f582bda4dfb8dc7 13-Jan-2010 Douglas Gregor <dgregor@apple.com> Don't emit string-comparison or self-comparison warnings in
unevaluated contexts, because they only matter for code that will
actually be evaluated at runtime.

As part of this, I had to extend PartialDiagnostic to support fix-it
hints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cb329c506d0e041b9523618158ac925d620c24ac 12-Jan-2010 Chris Lattner <sabre@nondot.org> use DiagRuntimeBehavior to silence the div/rem by zero warning when
not in an evaluated context. This removes some bogus warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7ef655a78863c0a7550bfe51174b9c340ab1dce0 12-Jan-2010 Chris Lattner <sabre@nondot.org> implement PR6004, warning about divide and remainder by zero.


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

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

when we call

x.operator int*();

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e27d87ff27b26e5886cf6472271d3b5e18ec3d87 11-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make Clang complain about taking the address of an unqualified member function. Fixes PR5985.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
827feec561c8a1f23c099da56c4ac98364ecfc09 08-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve the fix-its for -Wparentheses to ensure that the fix-it
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:

t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
[-Wparentheses]
if (i & j == k) {
^~~~~~~~
( )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
if (i & j == k) {
^
( )

t.cpp:14:9: warning: using the result of an assignment as a condition
without
parentheses [-Wparentheses]
if (i = f()) {
~~^~~~~
( )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
if (i = f()) {
^
==




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
67dd1d4df1b28973e12e0981129b2517d2033b66 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2849734790738585a9726a84b263c60e3be0193f 05-Jan-2010 Mike Stump <mrs@apple.com> Disallow captured arrays in blocks as well. Radar 7438948.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d6fd570e52f5d7fc637c9f41382992a97b94b4c 05-Jan-2010 Mike Stump <mrs@apple.com> Disallow capturing vlas inside blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba26e58c64b4f6233dfc4bcd3ef6ce83aab47ffc 05-Jan-2010 John McCall <rjmccall@apple.com> Move the -Wsign-compare logic into SemaChecking.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc021702e67a1c11d72a926f995cf418bb456315 04-Jan-2010 John McCall <rjmccall@apple.com> -Wsign-compare shouldn't warn when the signed operand is a conditional operator
whose operands are non-negative integer constant expressions. This comes up
in LLVM in a few places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f06cdae9c68dfc4191fbf6b9e5ea0fd748488d88 03-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement typo correction for a variety of Objective-C-specific
constructs:

- Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
- Property name lookup ("foo.prop")
- Superclasses
- Various places where a class name is required
- Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5b088a10e106a287684bef78cd6c3a3830ac0721 03-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Fix minor oversight for increment/decrement of complex int. Add tests for
coverage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d203a162966cfc2157857f5fdfb0e30a4f669281 01-Jan-2010 Douglas Gregor <dgregor@apple.com> When typo correction for an id-expression finds a type (or Objective-C
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:

test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
mean 'NSString'?
NSstring *str = @"A string";
...
^
1 diagnostic generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2dcc01195b7850692b9e25c65f77978e6a5a69a5 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for member access into classes/structs/unions, e.g.,

s.fnd("hello")




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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e8337dff778f6386f0a2a08f5def71a8dd44f2c8 30-Dec-2009 Chris Lattner <sabre@nondot.org> fix PR5917, L'x' was getting the wrong type in c++ mode. Per
C++2.13.2p2: "A wide-character literal has type wchar_t"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
efa42f7d88a33c0c00e571fbcba8032a9baf7088 26-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Don't look through casts when looking for the underlying decl for a function
call; the standard doesn't expect us to, and the program could be doing
something crazy. Fixes PR5882.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
54d76db0aa7107597cac0b80d8e138a37e6d1de9 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8aa5f407d9e4787ff08bd66e1a2fe39be174fddc 24-Dec-2009 Douglas Gregor <dgregor@apple.com> Add test case for PR5868, and improve location information slightly for implicit "this" expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
65552c424750aaa58533ca385a90b77c033cc635 24-Dec-2009 Douglas Gregor <dgregor@apple.com> InitializationSequence handles binding to temporaries, so that
argument-passing doesn't have to. Fixes PR5867, where we were binding
a temporary twice in the AST and, therefore, calling its destructor
twice.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9f2df88757c8db3d97fa198f0ad4b6f139baa66a 24-Dec-2009 John McCall <rjmccall@apple.com> Fix the clang-on-clang build: APFloat reports underflow whenever we get a
denormal, but we only want to diagnose if we underflowed to zero. This
allows people to write constants in the denormal range.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
94c939dc1d4958b62ea5a89294dd8b2905f3191f 24-Dec-2009 John McCall <rjmccall@apple.com> Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
036aed18662e0193aafe0e8ae13d2e57efe6df25 24-Dec-2009 Douglas Gregor <dgregor@apple.com> When we see a CXXDefaultArgExpr during template instantiation, rebuild
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
65222e82d97af2120b3952d19cbd3cd923f4b43e 23-Dec-2009 Douglas Gregor <dgregor@apple.com> When using a default function argument for a function template (or
member function thereof), perform the template instantiation each time
the default argument is needed. This ensures that
(1) We get different CXXTemporary objects for each instantiation, and
(2) Any other instantiations or definitions triggered by the
instantiation of the default argument expression are guaranteed to
happen; previously, they might have been suppressed, e.g., because
they happened in an unevaluated context.

This fixes the majority of PR5810. However, it does not address the
problem where we may have multiple uses of the same CXXTemporary
within an expression when the temporary came from a non-instantiated
default argument expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a188ff2d8a18140541fcd5884deda4552dac71a7 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch parameter-passing for calls via function pointers (where we
don't have a FunctionDecl) over to InitializationSequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
aa0373107968aa7a26bf63f4a2673b8325b800af 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch initialization of parameters in a call over to
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:

- Make sure to use the adjusted parameter type for initialization of
function parameters.
- Implement transparent union calling semantics in C



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
085446216a198ced4183ec1571e1ae51c2920e98 22-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Switch compound literals over to InitializationSequence.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c7c3fb2641812fdf31b3f80f995116b02ac7863 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Centralize the emission/suppression/delay of diagnostics describing runtime before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
51874dd2eda9e160b3413873459e31d32ffb7820 21-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Allow comparison of 'void *' with function pointer
as a g++ extension (fixes radar 7481987).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
410a3f3c194a541acb5cdf3b98e96d6078685cf2 19-Dec-2009 John McCall <rjmccall@apple.com> Unresolved implicit member accesses are dependent if the object type is dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution. In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
87cf6704e2fcce63d2bb0baafe8122c09a657737 18-Dec-2009 John McCall <rjmccall@apple.com> When diagnosing that a decl ref expr is not a value, note the declaration
with "declared at" rather than "previous declaration is here".



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

The diagnostic is still iffy, though.



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




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
2514a309204341798f96912ce7a90841bea59727 16-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose attempting to assign to a sub-structure of an ivar
using objective-c property. (fixes radar 7449707)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a7fa7cd3eaa5459dfb2d1495384ece9786f8434c 15-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a code gen bug related to accessing a now
non-existing 'isa' field of a non-existing struct type
all related to legacy type definition for 'id' which we have
dropped in clang in favor of a built-in type.
(fixes radar 7470820).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
337cba4b3e17b98cfa512dfd12e57f4ccb0859be 15-Dec-2009 Anders Carlsson <andersca@mac.com> If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0479a0b9f22331da74df4ea50bce193f9bafb145 15-Dec-2009 Nate Begeman <natebegeman@mac.com> Support OpenCL 1.1 odd-length vector component accessors.

For hi/odd of an odd-length vector, the last component is undefined. Since
we shuffle with an undef vector, no CodeGen needs to change to support this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5cc07df89ab9afa9079baeec1243ee90c3f84d9d 15-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix some diagnostic-related FIXMEs, from Nicola Gigante

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ec3455fb1373091effbf1445762d1347124f4865 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix a COVTCTII (crash-on-valid-that-clang-thinks-is-invalid, duh),
note_previous_decl was used where note_previous_declaration was intended. Better
names or PR5785 might be nice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
06d33699f11277a494c1118a0d25a83dab3bbd4c 12-Dec-2009 Douglas Gregor <dgregor@apple.com> When certain diagnostics involving run-time behavior would be emitted
in a potentially potentially evaluated context, queue those
diagnostics and only emit them if the context ends up being
potentially evaluated. This completes the fix for PR5761.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
75b699a883ed02e9183cb5f4ad7086f4e3c6adf1 12-Dec-2009 Douglas Gregor <dgregor@apple.com> Suppress warnings and errors about certain uses of non-POD types (in
__builtin_offsetof, passing through an ellipsis) when we're in an
unevaluated context. This is the first part of the fix to PR5761,
which deals with the simple case of an unevaluated context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eebc4750fd66be9e395ab3fc757a067e050a9677 10-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Move composite type finding of two objective-c expressions
into its own helper method. No change in functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
83dc32594cde6bd083bd8b98b24bde2346585cad 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Codegen. support for ObjCIsaExpr AST which until now
was not needed (fixes radar 7453430).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fead20c1de136b5a199a5cc4225f64be771452e4 08-Dec-2009 John McCall <rjmccall@apple.com> Handle unresolved using decls in bare lookups. These are not being adequately
tested. Fixes PR5727.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
52efc3fdbabaf4848f47887eda130b0961508cd0 08-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Refactor objective-c pointer assignment compatibility logic. No
intended functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dbd872f273a8dbf22e089b3def6c09f0a460965d 08-Dec-2009 John McCall <rjmccall@apple.com> DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7e42cf2ca1d7058e46dbec269b9462eaa52b7d79 08-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to warn when discarding objective-c pointer type qualifiers
Still some refactoring to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
812c15476c9dddb72a8fd48deb7ca86402664b94 07-Dec-2009 John McCall <rjmccall@apple.com> Recover from dot accesses to record pointers and arrow accesses to records.
Patch by Nicola Gigante!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3cdff236e23e68fa19ed0b69f79ab7eb04593d28 07-Dec-2009 Ted Kremenek <kremenek@apple.com> Add the BlockDecl to the DeclContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6d910f07d8727c22e06cff2357bbc1bba25d0910 07-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Allow accessing 'isa' via '->' operator.
(fixes radar 7447251).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d6a637f8c8a93863509fc1bc555513ff6504957d 07-Dec-2009 Anders Carlsson <andersca@mac.com> Rework how virtual member functions are marked. If a class has no key function, we now wait until the end of the translation unit to mark its virtual member functions as references. This lays the groundwork for fixing PR5557.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
02dd4b1e279114cc51422fab8b42a7759421800e 05-Dec-2009 Chris Lattner <sabre@nondot.org> fix rdar://7446395, a crash on invalid, by fixing a broken assertion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16c5378c1e3af09a33604e096b3fe20742fc629d 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure to call PerformObjectMemberConversion where necessary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f595cc41c4d95fe323f8a2b209523de9956f874d 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make the type of the Decl referred to by a MemberExpr a bit more precise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
144238edd9349029ae845eefd082224b656359a8 02-Dec-2009 John McCall <rjmccall@apple.com> Use a more rigorous definition of 'class member'. I don't have any evidence
that this was causing a problem, but it could have.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
336e7743b8e2222d8557e2cf7c100c8f878df630 02-Dec-2009 John McCall <rjmccall@apple.com> Recognize that EnumConstantDecls can be found by lookup and are not instance
members. Fixes PR5667.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
0bd6feb9e9d40fc889fd47e899985125a43dfed8 02-Dec-2009 John McCall <rjmccall@apple.com> Push overloaded function templates through the parser using a totally different
leaked data structure than before. This kills off the last remaining
explicit uses of OverloadedFunctionDecl in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2f841ba3b3fd6babe751667470735651907b4001 02-Dec-2009 John McCall <rjmccall@apple.com> Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;
there's nothing interesting we can say now that we're correctly not requiring
the qualifier to name a known base class in dependent contexts.

Require scope specifiers on member access expressions to name complete types
if they're not dependent; delay lookup when they are dependent.

Use more appropriate diagnostics when qualified implicit member access
expressions find declarations from unrelated classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b1b425648c4968824a3ef706b8c0ca35e88e8846 01-Dec-2009 John McCall <rjmccall@apple.com> Fix IsProvablyNotDerivedFrom to always use record definitions when available.
Gets clang-on-clang passing again.



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9af2f52fbcb993350f54e57d498e7849ba29c75d 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Don't automatically assume that an id-expression refers to a
ValueDecl, because that isn't always the case in ill-formed
code. Diagnose a common mistake (forgetting to provide a template
argument list for a class template, PR5655) and dyn_cast so that we
handle the general problem of referring to a non-value declaration
gracefully.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
958aeb04f466588665c104558b1a7fe4c89161ca 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Eliminate warning in Release-Asserts mode. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e1599cee9310e523af40c3c8a5f21be6f7302981 01-Dec-2009 John McCall <rjmccall@apple.com> Fix and test for a problem caught by the clang-on-clang buildbot: qualified
IDs in dependent contexts are not dependent if the context names a namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7dafdf51176d2f52e3a27f1ef70161ea2133ff52 30-Nov-2009 John McCall <rjmccall@apple.com> Remove all of Sema's explicit uses of OverloadedFunctionDecl except for
those associated with TemplateNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
3e518bda00d710754ca077cf9be8dd821e16a854 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
369a3bd9979cf529eed529aa037de713c213e47d 26-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f88f7ab5adaa11d050270ffee6aa871e855f83b8 25-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Some fancy footwork to move the decision on how
to build casted expression-list AST to Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
e4d2bdd54c29656f2eba004d6db1e4942f2bfcd9 24-Nov-2009 Anders Carlsson <andersca@mac.com> GNUNullExpr is a valid sentinel even though it isn't of pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a4c98cd60e7151ea6eccfc677742bdbcf58d2a55 23-Nov-2009 Anders Carlsson <andersca@mac.com> Convert the && and || operands to bool using standard conversions. Fixes PR5593.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5d484e8cf710207010720589d89602233de61d01 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Intercept sizeof and alignof references before they get into ASTContext methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ac564f3e8d79c44fefa5da5ab1b58484ae781051 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve type-checking of templates by distinguishing between members
of the current instantiation and members of an unknown specialization
when type-checking a qualified-if expression.


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

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

My fingers hurt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b681b61fea36618778b8030360e90e3f4641233b 22-Nov-2009 John McCall <rjmccall@apple.com> If a C++ qualified id is followed by a postfix suffix, it is never the direct
operand of an addressof operator, and so we should not treat it as an abstract
member-pointer expression and therefore suppress the implicit member access.

This is really a well-formedness constraint on expressions: a DeclRefExpr of
a FieldDecl or a non-static CXXMethodDecl (or template thereof, or unresolved
collection thereof) should not be allowed in an arbitrary location in the AST.
Arguably it shouldn't be allowed anywhere and we should have a different expr
node type for this. But unfortunately we don't have a good way of enforcing
this kind of constraint right now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5b3f9130b95c0b73b74a8835d428b1e89397e066 22-Nov-2009 John McCall <rjmccall@apple.com> Reorganize the intermediate BuildDeclarationNameExpr routines again.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
865d447ac6a4721ab58e898d014a21f2eff74b06 19-Nov-2009 John McCall <rjmccall@apple.com> Draw a brighter line between "unresolved" expressions, where we have done the
appropriate lookup and simply can't resolve the referrent yet, and
"dependent scope" expressions, where we can't do the lookup yet because the
entity we need to look into is a dependent type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e4216e9d76635279fed9d5ee796872d9b8e5dc1e 18-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Simplify ActOnPostfixUnaryOp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7ba107a1863ddfa1664555854f0d7bdb3c491c92 18-Nov-2009 John McCall <rjmccall@apple.com> Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a14cd1111f5daf6891be4f3c9e534a75b5ce6294 18-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate some completely-redundant lookups

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
16fea9b2e5888443a6e2f96b397c92d3f6710ee8 17-Nov-2009 Eli Friedman <eli.friedman@gmail.com> PR5526: Make sure to set the right cast kinds for the inserted implicit casts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a8a1e3da7cc741ab36be18041fafbebdc9be826b 14-Nov-2009 Anders Carlsson <andersca@mac.com> Always build a builtin operator expression for the __extension__ unary operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3e42ffd3a848236413caa799f1f32a87fd6d702b 14-Nov-2009 Eli Friedman <eli.friedman@gmail.com> PR5462: Don't run off the edge of the argument array for vararg handling
when there are more parameters in the prototype than arguments to the call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b3cbeaea60a1a2d1adc73738123c24549b7ce2c 13-Nov-2009 Anders Carlsson <andersca@mac.com> Don't bind arguments to temporaries if the argument has a reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
03d8ed439f55b692634f9c71721ecfabbe347c4d 13-Nov-2009 Anders Carlsson <andersca@mac.com> Fix two bugs with temporaries:

1. For

A f() {
return A();
}

we were incorrectly calling the A destructor on the returned object.

2. For

void f(A);
void g() {
A a;
f(a);
}

we were incorrectly not calling the copy constructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a29e6b87bd53c883cb8ee62178879136a32e270e 12-Nov-2009 John McCall <rjmccall@apple.com> Note to self: don't leave debugging statements in the code for four hours.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c8d8ac5f454311d0154d2d080196cc150edbb2d6 12-Nov-2009 John McCall <rjmccall@apple.com> Add <foo> = [<bar> nextObject] to the -Widiomatic-parentheses category,
and give that category an explicit test. Generalize the internal diagnostic
name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
09b6d0e7931bf72674e4d752bd66b566cc01fe05 11-Nov-2009 John McCall <rjmccall@apple.com> Preserve source locations when building offsetof expressions featuring
anonymous members. Partial fix for PR 5390.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a52ef08b26420c8b7208c2fe7f3daf8802b22dd7 11-Nov-2009 John McCall <rjmccall@apple.com> Apparently the following idiom is specifically encouraged:
if (self = [super init])
Recognize it and only warn if -Wparentheses is explicitly enabled.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
314b97f8c564b465af605efaee23f91ec18a982b 10-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve parsing of template arguments to lay the foundation for
handling template template parameters properly. This refactoring:

- Parses template template arguments as id-expressions, representing
the result of the parse as a template name (Action::TemplateTy)
rather than as an expression (lame!).

- Represents all parsed template arguments via a new parser-specific
type, ParsedTemplateArgument, which stores the kind of template
argument (type, non-type, template) along with all of the source
information about the template argument. This replaces an ad hoc
set of 3 vectors (one for a void*, which was either a type or an
expression; one for a bit telling whether the first was a type or
an expression; and one for a single source location pointing at
the template argument).

- Moves TemplateIdAnnotation into the new Parse/Template.h. It never
belonged in the Basic library anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b76cd3d0c166b2162c4709f2ef5da8d67d9844b7 10-Nov-2009 Anders Carlsson <andersca@mac.com> When trying to assign a regular string literal to an Objective-C 'id' type or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example:

@class NSString;

@interface Test
+ (void)test:(NSString *)string;
@end

void g(NSString *a);

void f() {
NSString *a = "Foo";
g("Foo");
[Test test:"Foo"];
}

will produce

t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *'
NSString *a = "Foo";
^~~~~
@
t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *'
g("Foo");
^~~~~
@
t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *'
[Test test:"Foo"];
^~~~~
@
3 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3451e9282a72f09e834486ce6f5aab803f491e97 09-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Changed error for nested type qualifier mismatch to
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c9132b697cff37f2918f9501b8ee2262b0bc6f03 08-Nov-2009 Sean Hunt <rideau3@gmail.com> Test commit - minor terminology change to my recent patch suggested by John McCall


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
36a862f1d6810e05121d5be1b6458bd11b69e495 07-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to gives an error that at least points users in the direction of the error, rather
than an error about incompatible types. Patch by Sean Hunt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7d62a8f81f2f22e25c048edfb412b22e06c542ff 06-Nov-2009 John McCall <rjmccall@apple.com> Don't warn -Wsign-compare if we're in an unevaluated context, and fixed
a typo pointed out by Fariborz.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
48f5e63aec3f2fda7f1e75565bcbba08a9d6a14f 06-Nov-2009 John McCall <rjmccall@apple.com> compare.c also needs a target triple now, and improve some comments while we're
at it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5dbad3d46c43e8051dac0c3775bcbaf8f1a6b8fe 06-Nov-2009 John McCall <rjmccall@apple.com> Improve the -Wsign-compare heuristics:
* If the unsigned type is smaller than the signed type, never warn, because
its value will not change when zero-extended to the larger type.
* If we're testing for (in)equality, and the unsigned value is an integer
constant whose sign bit is not set, never warn, because even though the
signed value might change, it can't affect the result of the equality.

Also make the comparison test cases much more rigorous, and have them expose
the subtle differences between C and C++ here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3f0b5fd3a55baf1e3e768fe981bcc3ad5e209ec1 06-Nov-2009 Douglas Gregor <dgregor@apple.com> Rework the fix-it hint for code like

get_origin->x

where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
732429cfb1f77c1af61e239d0664e65962e488b3 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c4b838782132ec670fd7e48d1a7a7fd433fed06 05-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate some false positives due to a thinko in the "'blah' is
always zero in this context" warning logic. Also, make the diagnostic
itself more precise when referring to pointer values ("NULL" vs. "zero").


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
45aa4557fe4210034e85f4a807ff637a9dd146d6 05-Nov-2009 John McCall <rjmccall@apple.com> Implement -Wsign-compare, or at least the actual comparison part of it.
Conditional operands are next.

Fixes part of rdar://problem/7289584.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5ab75172051a6d2ea71a80a79e81c65519fd3462 04-Nov-2009 John McCall <rjmccall@apple.com> Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d00f200f64994858492558b54c6f6f2b3d4b4310 04-Nov-2009 John McCall <rjmccall@apple.com> Diagnose __builtin_offsetof on incomplete types. Fixes
rdar://problem/7222956



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
54abf7d4fa3123b8324c09d2a4dfb789fd818403 04-Nov-2009 John McCall <rjmccall@apple.com> Change our basic strategy for avoiding deprecation warnings when the decl use
appears in a deprecated context. In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C. If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ca1bdd7c269a2390d43c040a60511edd017ee130 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement support for parsing dependent template-ids that refer to
overloaded operators, e.g.,

p->template operator+<T>()




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fbf6870f5931f7a4b6632b3594cde28b48cffb9d 03-Nov-2009 Mike Stump <mrs@apple.com> We have to ensure we have the canonical type to do this. This is but
one instance of a large problem. assert for non-canoical types would
help track down these things.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
5de245058d411b166dc32622f39298716450fa1c 28-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose use of data pointer member in a function call
expression instead of crashing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
db07b3f7cdcb505329c1280d7cf70791739a7cad 28-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Type of a conditional expression with two distinct objective-c
class pointer is the most derived common class of the two.
This is <rdar://problem/7334235>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3b846b6c252972a6f142aa226c1e65aebd0feeca 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Explicit instantiation suppresses the instantiation of non-inline
function template specializations and member functions of class
template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aee3c9375f97a49edef2a36f15df6abd9748e2a1 27-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Chris's suggestions for the precendence warnings. Reformat the code a bit. Test the fixits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b169accbb182d328ad41746c4071d8e7f90a628 26-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add fixit hint to bitwise precedence warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9e1d29bb369530c15230e4c92aa67239c283ece2 26-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement a warning for mixing bitwise logical with comparison ops. Fixes PR5297.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
523382640e9b099dd64ba0875a60a9356845b068 25-Oct-2009 Chris Lattner <sabre@nondot.org> Implement rdar://6756623 - use of deprecated type in deprecated typedef should not warn


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ffb936801529d767699847f0107f6abaa99c0c26 25-Oct-2009 Chris Lattner <sabre@nondot.org> minor reorg: check both attributes before decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2207d79204559baa15fc1f342f813d1bcdb6db5b 25-Oct-2009 Nate Begeman <natebegeman@mac.com> Add support for vector shifts, pretty straight forward.


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

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



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

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

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

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

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





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
e013d685c6689ac7ae103ee88acf573422d1ed6a 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move clients to use IdentifierInfo::getNameStart() instead of getName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
82debc7d282e723e58d183bfa89ddc2500a8daaf 18-Oct-2009 Anders Carlsson <andersca@mac.com> Add some more cast kinds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2ad3289fffc95399c6e1bae36e2abbee00d3d9b9 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add another two ExtVectorComponent FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8d1c9ae5d27c5190a7793f7ac1224a70cd3df33f 18-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix a crash with qualified member access into a non-type, from Sean Hunt!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6a2b9261bf9c973c7122d9d1febce24a38fa862d 17-Oct-2009 Chris Lattner <sabre@nondot.org> teach getCorrespondingUnsignedType how to handle vectors of integers,
fixing PR4838.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16a8904f3f5ed19158657e1da95e5902fbee66f7 16-Oct-2009 Anders Carlsson <andersca@mac.com> Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c351632d489c31bb7b7e4f9370714434116a1fe4 16-Oct-2009 Anders Carlsson <andersca@mac.com> Make CheckVectorCast return a CastKind. Reduce nesting of if statements in CheckCastTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ebeaf2031c968143c531bfe232d7507f20c57347 16-Oct-2009 Anders Carlsson <andersca@mac.com> Add a ToVoid cast kind and start using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
04905014fd854979ac12fc31a2b25fca37a93eb4 16-Oct-2009 Anders Carlsson <andersca@mac.com> The result type of logical || and && is bool in C++. Fixes PR5206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8d6d90d5499d4248761251811ebed0ae77665ed7 15-Oct-2009 Anders Carlsson <andersca@mac.com> Check the return type when calling pointer to member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3a9439f3b55a018a149953074801921fc1df63b7 14-Oct-2009 Anders Carlsson <andersca@mac.com> Check the return type of operator[]() and fix a thinko that lead to a crash in SemaCXX/overloaded-operator.cpp.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3f09327b26033d0a9676d52d80cf92c48f581aff 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Unify our diagnostic printing for errors of the form, "we didn't like
what we found when we looked into <blah>", where <blah> is a
DeclContext*. We can now format DeclContext*'s in nice ways, e.g.,
"namespace N", "the global namespace", "'class Foo'".

This is part of PR3990, but we're not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d15215844eaf6391ad566c44dcf420c18c6b773 13-Oct-2009 John McCall <rjmccall@apple.com> More appropriate API usage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5a881bb09928b7ade891efc680088aaad276f8d6 12-Oct-2009 John McCall <rjmccall@apple.com> Implement -Wparentheses: warn about using assignments in contexts that require
conditions. Add a fixit to insert the parentheses. Also fix a very minor
possible memory leak in 'for' conditions.

Fixes PR 4876 and rdar://problem/7289172



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b3ae4fcd4314a9c1c46d41b200883599c32025b4 12-Oct-2009 Douglas Gregor <dgregor@apple.com> Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.


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

struct B;

B f();

void g() {
f();
}

We now get

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b5352cf949898cd42c8c5bc96a17a831b61ac2e5 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement support for -Wunused-variable, from Oscar Bonilla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
251b4ff2578e26959a4c036140ccd61c5e9292f2 08-Oct-2009 Douglas Gregor <dgregor@apple.com> For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
63e5e64a49ef936383ad93ea283b2b07f115e78c 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Only perform an implicit instantiation of a function if its template
specialization kind is TSK_ImplicitInstantiation. Previously, we would
end up implicitly instantiating functions that had explicit
specialization declarations or explicit instantiation declarations
(with no corresponding definitions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
83ccfc3cf035fae158358776910b617a188471c7 03-Oct-2009 Anders Carlsson <andersca@mac.com> Create CXXMemberCallExpr for pointer-to-member calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d789d3d985e28c9404e62157af46dcb7331920e0 02-Oct-2009 Steve Naroff <snaroff@apple.com> - Remove Sema::FindMethodInNestedImplementations().
- Add ObjCInterfaceDecl::lookupPrivateInstanceMethod().
- Convert clients.

No functionality change - One less method in Sema:-)



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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
b2ef1beb812988ce45804d655c9a72bc523d5014 22-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a regression in accessing class getter using the dot-syntax
notation. There is still an issue accessing field of a 'Class''s isa
in legacy code using dot field access notation (as noted in the test case)
but unrelated to this patch.



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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
3f180c618970d1369726b9229c0370617e05c7cb 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> Fix two crashes on value dependent expressions (shift and null-pointer check).
- Doug, please check.

- PR4940.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7e88a60d38b36695520e4f8d9279766ef111a662 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
474e102639653482328404020cfdeb9a0a44943d 15-Sep-2009 Anders Carlsson <andersca@mac.com> Use getTrueExpr/getFalseExpr as suggested by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1d524c3dde58e4402aab4165e85e9ae6f15f5023 15-Sep-2009 Anders Carlsson <andersca@mac.com> Diagnose taking the address of a bit-field inside a conditional operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0f9a5b5be561c2ec42399c1b466d1f3e792de191 14-Sep-2009 Sam Weinig <sam.weinig@gmail.com> -Wchar-subscripts should not warn for explicit signed char subscripts either. Another fix for PR4978.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b0a22903c3c45065c03ce2c904802d01fd67e170 14-Sep-2009 Sam Weinig <sam.weinig@gmail.com> -Wchar-subscripts should not warn for unsigned char subscripts. Fixes PR4978.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
76e2b710a92bceb9575a81db181109664946986e 14-Sep-2009 Sam Weinig <sam.weinig@gmail.com> Add support for -Wchar-subscripts. Fixes PR4801.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7814e6d6645d587891293d59ecf6576defcfac92 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
52604ab71a74b8ec481255dfeea7dc9dba63b1a5 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Slight improvement for extern templates, so that an explicit
instantiation definition can follow an explicit instantiation
declaration. This is as far as I want to go with extern templates now,
but they will still need quite a bit more work to get all of the C++0x
semantics right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ed90c4ee8cfed90be92741313e1715d308ed2fe3 11-Sep-2009 Anders Carlsson <andersca@mac.com> Fix PR4878 for real.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cce6ebc4edde2a9468daabc2b5d18bd2e9b6219e 11-Sep-2009 Sam Weinig <sam.weinig@gmail.com> Test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
773f3973cf5e2b6b8788e895967dcb3c1e6ffe79 11-Sep-2009 Anders Carlsson <andersca@mac.com> Instantiate PredefinedExprs correctly. Patch by Sam Weinig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0f728566b9fc1a013be3c0f3ca43a074307dc081 10-Sep-2009 Anders Carlsson <andersca@mac.com> Don't check use of a member function declaration used if the member function is virtual and the member reference expression doesn't explicitly qualify it. Fixes PR4878.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
3b6afbb99a1c44b4076f8e15fb7311405941b306 09-Sep-2009 Douglas Gregor <dgregor@apple.com> Initial stab at implement dependent member references to member
templates, e.g.,

x.template get<T>

We can now parse these, represent them within an UnresolvedMemberExpr
expression, then instantiate that expression node in simple cases.

This allows us to stumble through parsing LLVM's Casting.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3a082d81006e7a2e01a6e431a22e21c78490ff8f 08-Sep-2009 Anders Carlsson <andersca@mac.com> Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam Weinig!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25cae7f4b1155b1a6ca959ea5143ea39eae656cd 05-Sep-2009 Anders Carlsson <andersca@mac.com> Use a separate diagnostic for default function argument expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
a38c687ef5354678b9d76a7b29354159f2b83736 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Improved handling for dependent, qualified member access expressions, e.g.,

t->Base::f

where t has a dependent type. We save the nested-name-specifier in the
CXXUnresolvedMemberExpr then, during instantiation, substitute into
the nested-name-specifier with the (transformed) object type of t, so
that we get name lookup into the type of the object expression.

Note that we do not yet retain information about name lookup into the
lexical scope of the member access expression, so several regression
tests are still disabled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
16b10378a93e8644008289fd86c1caf737d1395c 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> This patch does the following.
1) Issue digsnostics in non-fragile ABI, when an expression
evaluates to an interface type (except when it is used to
access a non-fragile ivar).
2) Issue unsupported error in fragile ABI when an expression
evaluates to an interface type (except when it is used to
access a fragile ivar).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ce8827a4941fb966e3f6c32fbe97a7bbb7da5840 02-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> It is illegal to derefrercne to an interface in
objc's non-fragile ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
83f6faf37d9bf58986bedc9bc0ea897a56b4dbad 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocate
space within the MemberExpr for the nested-name-specifier and its
source range. We'll do the same thing with explicitly-specified
template arguments, assuming I don't flip-flop again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0979c805475d1ba49b5d6ef93c4d2ce6d2eab6ed 31-Aug-2009 Douglas Gregor <dgregor@apple.com> Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
also be adding explicit template arguments as an additional
"adornment". No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
f4d84b663ef7dda959cbe45561d90e59760cbb74 30-Aug-2009 Anders Carlsson <andersca@mac.com> Improve diagnostics for missing members. This renames the err_typecheck_no_member to err_typecheck_no_member_deprecated. The idea is that err_typecheck_no_member_deprecated should be phased out and any call sites that reference it should call DiagnoseMissingMember instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
598da5b01fa9e205f55db8b3b5cb20abec2d74cf 29-Aug-2009 Anders Carlsson <andersca@mac.com> CreateDeclRefExprs that point to UnresolvedUsingDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d6350aefb1396b299e199c7f1fe51bb40c12e75e 28-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for member class templates.

When performing template instantiation of the definitions of member
templates (or members thereof), we build a data structure containing
the template arguments from each "level" of template
instantiation. During template instantiation, we substitute all levels
of template arguments simultaneously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
bd4c4aebe6035e7a7125470cc9f0f92511230ee3 27-Aug-2009 Douglas Gregor <dgregor@apple.com> When a member reference expression includes a qualifier on the member
name, e.g.,

x->Base::f()

retain the qualifier (and its source range information) in a new
subclass of MemberExpr called CXXQualifiedMemberExpr. Provide
construction, transformation, profiling, printing, etc., for this new
expression type.

When a virtual function is called via a qualified name, don't emit a
virtual call. Instead, call that function directly. Mike, could you
add a CodeGen test for this, too?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
8f28f99019e86ae2841d17668811c6a94f5c44f8 26-Aug-2009 Anders Carlsson <andersca@mac.com> Add Sema::BuildMemberReferenceExpr and have Sema::ActOnMemberReferenceExpr call it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
47e1f7c68bf375cac470fdb2b599ddbb395aeb52 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Source location information for ? and : in a ConditionalOperator, from Enea Zaffanella

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
ce3ff2bd3a3386dbc209d3cba4b8769173b274c1 26-Aug-2009 John McCall <rjmccall@apple.com> Clarify the difference between substitution and instantiation by renaming
functions that don't instantiate definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
56c5e33460cb6672590075818bcc555aacb3f6bb 25-Aug-2009 Anders Carlsson <andersca@mac.com> Factor building of CXXDefaultArgExpr expressions out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9351c173cd538f7f7c28af1494ac7e68b815b0e8 25-Aug-2009 Anders Carlsson <andersca@mac.com> Basic support for default argument expressions for function templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ed961f989e7153733d352505f239f0de4e060629 25-Aug-2009 Anders Carlsson <andersca@mac.com> Factor setting default arguments out into SetParamDefaultArgument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
26ba8507089ec8ea37804c32f78e2e1f8bc2a4f2 24-Aug-2009 Anders Carlsson <andersca@mac.com> Use the right cast kind when comparing null to member pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
3075e760ceb73b6fafc2fb4977ad68552d83aef8 23-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Catch a few more cases of illegal comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
06c0f5b1bb1623a93a2bc4c345fb3be52a2b22a7 23-Aug-2009 Chris Lattner <sabre@nondot.org> Eli points out that we really must diagnose "void* > 0" as an extension.
Explicitly add it as an EXTENSION instead of an EXTWARN so that it only
comes out with -pedantic. Thanks Eli!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9ec22a37a22218c4a73430c614d3540b076baa14 23-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Type of a ?: expression whose either expression is a built-in 'id'
type is 'id' type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6365e3e22bcec4b95c5b1ed47d501134b375a75a 22-Aug-2009 Chris Lattner <sabre@nondot.org> tweak some pointer sema checking stuff (which was added to implement PR4175) to
avoid emitting a warning on "someptr > 0". This is obviously questionable (they
could use != instead) but is reasonable, and the warning "ordered comparison
between pointer and integer" didn't make a ton of sense because 0 is a valid
null pointer constant.

Just silence the warning in this case, it is unlikely to indicate a bug.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
09105f52b1f28cbb1374c27c3c70f5517e2c465d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
04e8357f6801e9ff52673e7e899a67bbabf9de93 20-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix bit-field promotion to be a bit closer to the behavior of gcc.
Patch by Enea Zaffanella, with some simplifications/corrections to
isPromotableBitField by me.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
154440e6a8fa6ac5bca395876d79b530b39a2c1c 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0f436560640a1cff5b6d96f80f540770f139453f 17-Aug-2009 David Chisnall <csdavec@swan.ac.uk> Initial patch to support definitions of id and Class from headers in Objective-C code.

This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ec74c5929c78bd1670619022f6cfd471becf65aa 16-Aug-2009 Anders Carlsson <andersca@mac.com> Make sure to call MaybeBindToTemporary when creating CallExprs.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
199ea95fd5ef9a089dbf7b2ade018d4444a65177 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Don't perform integer promotions on the operand to a cast; this
simplifies the AST, and can matter in some rare cases involving
casts to vector types. Patch by Enea Zaffanella.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2ef13e5abef0570a9f567b4671367275c05d4d34 11-Aug-2009 Nate Begeman <natebegeman@mac.com> Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1df5109f475bcbc528eb1fb9fdb179dcadbb33a6 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25b4fdb9d63095448e6cbc97b8865b36b0c8cbb6 09-Aug-2009 Nate Begeman <natebegeman@mac.com> AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8045c7393bc83060f812d0f7b1221edbc767407c 08-Aug-2009 Ryan Flynn <pizza@parseerror.com> PR4700 - remove shift by 0 warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0f44b5a85e612e1644d688be93151b22f08604a7 08-Aug-2009 Anders Carlsson <andersca@mac.com> Make sure to diagnose use of declarations in the case where we create an implicit CXXThisExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
112a0a8ddf23f6d25e0920002d5d4c1df0515f86 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add a CK_ArrayToPointerDecay cast kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4d8673b645ad86e496b886a0f80b60763f67071d 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add CK_ToUnion and use it for aggregate expression codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
d0439688fea4dedc28125d246bbdec1f5a208660 07-Aug-2009 Ryan Flynn <pizza@parseerror.com> PR3333: warn when shifting by invalid amount

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dcee1a12c83a6cbc9b5bf42df5d4efbc502664e7 06-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement transformation of nested-name-specifiers within the general
tree transformation. Template instantiation uses this general
transformation rather than implementing its own transformation.


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

this->Base::foo

from James Porter!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
96e2fa97ea929f69778c66dd42e426330d893e7a 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Some refactoring of member access for
performace sake. Also added a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f3e53d35d0ed1a156baf7ccfec65e6a38648c632 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Check accessibility when converting object to the base
class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
98a541e80848d3b7d1131237ac04e698faffd151 29-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to provide cast of objects in member access
excpression, if needed, and remove some ir-gen code
now unnencessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d99cbe66403ee39c2ee58024b9582b95649a4fc5 29-Jul-2009 Douglas Gregor <dgregor@apple.com> [llvm up]

A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c715e78618eb69674be828b46dc52604dd3af271 29-Jul-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/7100524> regression: "error: incompatible operand types ('void *' and 'NSString *')".

Remove XFAIL from 'conditional-expr-4.m' test case (which would have caught this).
Also tweaked several aspects of the test to jive with the current type checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
99b10be143e3148b9499af4c0e9ebaf46757cfe6 29-Jul-2009 Steve Naroff <snaroff@apple.com> Incorporate feedback from Chris (on r76979).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
1d2154c3590d21345d02e28f2916f7492c82bf54 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> BlockScopeInfo::hasPrototype was uninitialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5692586ae59be8d49edd7b45dd52c1ffa920ba5e 29-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn support for blocks.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7caa6825f42a0f7e97d6fc06233133c42b218e46 24-Jul-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for static data members that are defined out-of-line.

Note that this also fixes a bug that affects non-template code, where we
were not treating out-of-line static data members are "file-scope" variables,
and therefore not checking their initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f242b1b0c4e998911cb96b2ba7e27ab4a5abaed3 24-Jul-2009 Steve Naroff <snaroff@apple.com> Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).

Still need back-end CodeGen for ObjCIsaExpr.



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6016cb2d1e99960675e4c4bb97f6f4ecdff97818 23-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix test breakage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
de99a45c1295ec8e2eea20d35906178ff10722b5 23-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Slight code reorganization to allow instantiating post-inc/dec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8e1fab243ab8023b7ee3899745386b3b3a4258f8 22-Jul-2009 Mike Stump <mrs@apple.com> Use isa instead of dyn_cast for conditionals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c6a38a47bf3908ab2183d7946498138d8b07c886 22-Jul-2009 Mon P Wang <wangmp@apple.com> Preserve address space information through member accesses, e.g.,
__attribute__((address_space(1))) struct {int arr[ 3 ]; } *p1;
... = p1->arr[2]; // load from address space 1


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1cb35dd4840d21cec58648361180d5688446a9ca 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
87018775ed689d0a67357cf767747166044b3a27 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove Sema::LookupObjCImplementation and replace it with just calling ObjCInterfaceDecl::getImplementation().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
67ef8eaea8a0a2073147a8d863f0e3f30d525802 20-Jul-2009 Steve Naroff <snaroff@apple.com> 5 cleanups to ObjCObjectPointerType work:

- Remove Sema::CheckPointeeTypesForAssignment(), a temporary API I added to ease migration to ObjCObjectPointerType. Convert Sema::CheckAssignmentConstraints() to no longer depend on the temporary API.
- Sema::ConvertDeclSpecToType(): Replace a couple FIXME's with an important comment/example.
- Sema::GetTypeForDeclarator(): Get the protocol's from the interface, NOT the declspec (to support the following C typedef idiom: "typedef C<P> T; T *obj").
- Sema::ObjCQualifiedIdTypesAreCompatible(): Removed some dead code.
- ASTContext::getObjCEncodingForTypeImpl(): Some minor cleanups.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ecd1bae999a1d6196cd0882e96e637d23ce69b12 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't add a SourceLocation for 'self' if it does not actually appears in the source code.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
9f8a04f3ed589de0a2e9fec855177dc0f185bfa9 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose ++/-- op on objc pointers in
nonfragile abi, instead of crashing.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c70e8d90d192af8f4e8caca4d20c85b843f7d699 16-Jul-2009 Steve Naroff <snaroff@apple.com> Avoid crashing for the enclosed test case.

This is fallout from the recent ObjCObjectPointerType rework. I'll work on fixing this tomorrow.


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

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

This patch also adds Type::isObjCBuiltinType().

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
9deaeca2c9cd28a73914e190aa609faf0da510d8 13-Jul-2009 Steve Naroff <snaroff@apple.com> Remove superfluous call to getAsPointerType()...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
760e3c4bf4b1354688c854c91cc1e11a6e010f25 13-Jul-2009 Steve Naroff <snaroff@apple.com> Sema::CheckAdditionOperands(): Use Type::getPointeeType() and remove PTy and OPT variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f8910df57799256c1897a8610dc52685729ae90e 13-Jul-2009 Steve Naroff <snaroff@apple.com> - Improve comment for Type::getPointeeType().
- Remove a couple redundant casts/returns.
- Fix 80 column violations for all getAsStringInternal() methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
430ee5a4fd20c02e59d6a0d720401a5f21e4e5c1 13-Jul-2009 Steve Naroff <snaroff@apple.com> Fix 5 issues from Chris's feedback on http://llvm.org/viewvc/llvm-project?view=rev&revision=75314.

Still more to come...just wanted to get the no-brainers out of the way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
496e89f8d55f7a931c246e820c10f7296a246ac2 11-Jul-2009 Ted Kremenek <kremenek@apple.com> Fix warning when compiling with optimizations:

warning: ‘OPT’ may be used uninitialized in this function

Now OPT is initialized to NULL. I'm not certain if this is the correct fix;
others please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
9b31df4acdeeb61bb084a03fc37bc5bd570a659e 09-Jul-2009 Anders Carlsson <andersca@mac.com> Store the isAddressOfOperand in the UnresolvedDeclRefExpr, so that we can pass it when instantiating the expr. Fixes another member pointer bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f9e48bdea6e56404deb0776bf2d0eddedb77dce3 08-Jul-2009 Anders Carlsson <andersca@mac.com> It's not allowed to form member pointers to members that have reference type. Add a test for this and the rest of [dcl.mptr]p3.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c10fcfc3b9d2076efe701b60644a9987a93c503 08-Jul-2009 Chris Lattner <sabre@nondot.org> reimplement vector comparisons as [fi]cmp+sext instead of using v[if]cmp.
Also, enable them in sema so that they are tested, and now that the x86 backend
has stablized.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0337f21c78bdadff64bc6ae40eb9962d947e5bb0 07-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose, and not crash, when taking address of property expression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f93343764765b24f53e389c7dd35f90901925451 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix a problem with false diagnostics when comparing distinct NULL pointer types, from David Majnemer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7154a77e7c1f23418342d3b72836ab504aa7821e 01-Jul-2009 Steve Naroff <snaroff@apple.com> Rework Sema::CheckConditionalOperands(). No functionality change.

This was necessary to simplify some other changes I'm making (wrt ObjC type cleanups).

The idea is to separate the constraint checks for block pointers, ObjC pointers, and C pointers (the previous code combined them into one clause).

Note: This routine will be further simplified when I integrate the ObjC type cleanups (forthcoming).



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
edce4dd44732dfad69f28822dddcf2b8e92b4483 01-Jul-2009 Douglas Gregor <dgregor@apple.com> Preliminary parsing and ASTs for template-ids that refer to function
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b33fe2ff12676bff9db595fdf77e29014d7ba397 30-Jun-2009 Douglas Gregor <dgregor@apple.com> When recursively instantiating function templates, keep track of the
instantiation stack so that we provide a full instantiation
backtrace. Previously, we performed all of the instantiations implied
by the recursion, but each looked like a "top-level" instantiation.

The included test case tests the previous fix for the instantiation of
DeclRefExprs. Note that the "instantiated from" diagnostics still
don't tell us which template arguments we're instantiating with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
751f9a416a94fe723e6c34fc15fff2ccdf1c4be9 30-Jun-2009 Douglas Gregor <dgregor@apple.com> Refactor ActOnDeclarationNameExpr into a "parsing action" part and a
"semantic analysis" part. Use the "semantic analysis" part when
performing template instantiation on a DeclRefExpr, rather than an ad
hoc list of rules to construct DeclRefExprs from the instantiation.

A test case for this change will come in with a large commit, which
illustrates what I was actually trying to work on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
149f1386c60aa07de0f6a5d43ab524b22af68059 30-Jun-2009 Chris Lattner <sabre@nondot.org> Implement PR4175, catching some questionable comparisons. Patch by
David Majnemer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
001d64dd2947c1ce06e3eac257a9a21c65ae4ff3 29-Jun-2009 Chris Lattner <sabre@nondot.org> Fix the FloatingLiteral API to take the isexact flag by value instead of
by pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dde2598cfbaafd71e5d6926f0beb6b77599de28e 28-Jun-2009 Nate Begeman <natebegeman@mac.com> Fix incorrect AST's being produced, noticed by Eli.
The issue this was working around is no longer present in TOT clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1bd1f6e85a011fe3129dc2898857e72741d36667 28-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support:
Handle rules for ExtVector + ExtVector and ExtVector + Scalar operations.
Fix problem Eli noticed where we were allowing pointer types to be splatted to
vector elements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9b10da6f710617570e585e0504768f1e9bc6f145 28-Jun-2009 Nate Begeman <natebegeman@mac.com> Implement feedback from Eli re: the purpose of lax vector conversions


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
e2bb224dee15d07bc9843acd4f3ded8eb0f835ed 26-Jun-2009 Anders Carlsson <andersca@mac.com> An auto variable can't appear in its own initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
58d29a41271d96509f464716f79b0ab2e815b6b1 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support: explicit casts to ext-vector types


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1637be727f2a0434c1ed7aa385ea1c18328b0ccd 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Implicit instantiation for function template specializations.

For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.


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

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c75bc2d1f6f637098abc5db4caf0551f9437471e 25-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to diagnose and Mark use of implicit default assignment operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
131f4658249b2a7d2d7e30fe07e84c484f79ef99 25-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f5ed9e0442a9299a19b312fd2d6160efec43c0ea 25-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Backed out my last patch which caused a clang-test breakage. Will
look at it later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ecce1314380e740bbe303cc68bf8f6b57480b09a 24-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Added a missing else part to my previous patche(s).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e41590d2504d73453d58f22e9176088990555cc1 24-Jun-2009 Anders Carlsson <andersca@mac.com> [class.local] p1 and p3. Also, add back the xcodeproj file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
485f087407849a8989053122f52b8c07d1191b45 23-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> patch to mark use of implicit copy constructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d7f37bf8b9a211455c5037df7b7e88e5a9510119 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Implement implicit instantiation of the member functions of a class template
specialization. At present, all implicit instantiations occur at the
end of the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
05a5c45507243b88ee9e1b3f1ac2fb05b611d7d2 22-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Changes made per Doug's comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b7f4cc09ead099c1306d06db53e258d648d0f652 22-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Remove ImplicitMustBeDefined, use universal 'Used' flag
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
7d5c74ecbbd8719436c071f38657bc8e97ee4a24 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use QualType to represent block's implicit return type as
to not lose its 'const/volatile' qualifier.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bc 18-Jun-2009 Steve Naroff <snaroff@apple.com> First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9cdda0cf8528e3d595be9bfa002f0450074beb4d 17-Jun-2009 Douglas Gregor <dgregor@apple.com> Support dependent extended vector types and template instantiation
thereof. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
5e300d1a8e37f24e71f8cf204b982f20f85cf91a 12-Jun-2009 Anders Carlsson <andersca@mac.com> It's an error to use a function declared in a class definition as a default argument before the function has been declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c149412d3adfc28ce1f1c0cf6d3701f9491adaf0 11-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Make sure to calculate value-dependence correctly when deal with ICEs.
(Actually, this isn't precisely correct, but it doesn't make
sense to query whether an expression that isn't an ICE is
value-dependent anyway.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
26784c1dd1f3e395f024fd594646790421b3bbf3 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Delete method which is now trivial.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
687abffee40d0459fe5eecf3e5ee6e60be69d93c 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc4e29f307f86ddbc2f31d9530da79ad9b0c6b7b 01-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4287: allow a variadic prototype to make a subsequent K&R style
definition variadic. I'm not completely sure it's legal, but the
standard can be interpreted as making it legal, and gcc seems to think
it's legal, so I didn't add an extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
00c4486243ac0baa77a387335541c742c4dd615a 29-May-2009 Douglas Gregor <dgregor@apple.com> Some cleanups and commenting to our declaration-name handling

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7ff69269cf13583a981b265d4edee689feb4a830 27-May-2009 Douglas Gregor <dgregor@apple.com> Don't drop the computed implicit conversions when building a call to
overloaded operator[] or overloaded postfix unary operator (++,
--). Thanks to Eli for finding this bug!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b5ff6bfaf4bff6c70042600ad4070518440cec4a 22-May-2009 Fariborz Jahanian <fjahanian@apple.com> Cannot type cast @selector expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c0ca59416999129d0439c2661d137ef38e86209 22-May-2009 Douglas Gregor <dgregor@apple.com> Representation of and template instantiation for member
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.

Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
690dc7f4f2c0fe87409839b7560c19dee7832195 22-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C99 compound literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd0273078111ec7312172c456a01ff86bff83b23 20-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for __builtin_va_arg.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c9ecc57d6d1fd4a96c748e52958d70be3b3da9fb 20-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for __builtin_choose_expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c12a9c5e552825c2b7d2e4352a9f70e061ebb367 20-May-2009 Douglas Gregor <dgregor@apple.com> Ban the use of __builtin_types_compatible_p in C++; g++ doesn't support it,
and it isn't clear exactly what it's supposed to mean. Thanks Eli!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d66f22d9f8423579322a6dd16587ed52b0a58834 19-May-2009 Fariborz Jahanian <fjahanian@apple.com> Patch finishes off application of printf attribute on blocks.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3d1a7af3f09cc8f5e04f71080debc4366e5b1a37 19-May-2009 Fariborz Jahanian <fjahanian@apple.com> BlockDecl node must be complete before block attributes
can be processed. No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
725165f2846bd37d3aaf863747fa30126992085e 18-May-2009 Fariborz Jahanian <fjahanian@apple.com> more printf attribute on block declaration and
checking when block is envoked. In progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a59077d3ac38d734b4188ac91ef40a7142093ac7 17-May-2009 Anders Carlsson <andersca@mac.com> Add FIXME about not using MemberExpr nodes when the base type is a dependent type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
441cf1004620342ec8efb5b849abd4b89f0cf552 17-May-2009 Eli Friedman <eli.friedman@gmail.com> Refactor address-of-void extension a bit so that it's more obviously
correct. No functionality change, as far as I know.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
196f7d0ce9d928ecf89430e099f6c065d72ef920 16-May-2009 Anders Carlsson <andersca@mac.com> Don't return member pointer types for static member functions. Fixes 6879261.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4ef2770ee522048a19311d13ccd3b9605297ec58 16-May-2009 Anders Carlsson <andersca@mac.com> Improve checking of member expressions where the base type is a dependent type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
88d936b245978038a14b9c7acc062d12bc46096a 16-May-2009 Eli Friedman <eli.friedman@gmail.com> Avoid calling mergeTypes in C++. I think these are the correct C++
alternatives, but please correct me if I'm wrong.

I eventually plan to assert in mergeTypes that we aren't in C++ mode
because composite types are fundamentally not a part of C++. The
remaining callers for code in the regression tests are
Sema::WarnConflictingTypedMethods and CodeGenFunction::EmitFunctionProlog;
I'm not quite sure what the correct approach is for those callers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5c091bab12d2e3fc69d7580a89dd3b9520bd471c 16-May-2009 Eli Friedman <eli.friedman@gmail.com> Add stricter checking for va_arg.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
623712be8a498e0da0f5be0a77678cd2bfa35be2 16-May-2009 Eli Friedman <eli.friedman@gmail.com> Remove useless wrapper.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ffce2df6ae280d354d51371282a579df1eb86876 16-May-2009 Anders Carlsson <andersca@mac.com> Basic support for member exprs where the base expr type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3bba33d6f58844d4924ab1e221dc2ff44c521624 15-May-2009 Fariborz Jahanian <fjahanian@apple.com> improved on diagnosing misplacement of sentinel attributes.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
daf0415583e33d5d279197c65e9227c1ed92474b 15-May-2009 Fariborz Jahanian <fjahanian@apple.com> This patch finishes off the sentinel attribute handling for
blocks and function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2f7c39246a968b921a6d95c7f8037fb3429e9501 14-May-2009 Fariborz Jahanian <fjahanian@apple.com> Adds recognition of sentinel attribute on block declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
236673e8fbd391cc7827efcaa64320344900d348 14-May-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose missing sentinel argument on a funciton call
with sentinel attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
88f1ba0f0439e31ab57ffc088aa91137cadee585 14-May-2009 Fariborz Jahanian <fjahanian@apple.com> Look for and diagnose missing sentinel argument on message
dispatch arguments which have sentinel attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5b53005fb9ef24b8bdfe995f29b4662de468128a 13-May-2009 Fariborz Jahanian <fjahanian@apple.com> Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
c001e89b920504154bd0b1832e6feacd28fbfa58 08-May-2009 Fariborz Jahanian <fjahanian@apple.com> Refactoring of my last patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4c2743f0afe601b0e8ea7bd9b3cd0fb09083a181 08-May-2009 Fariborz Jahanian <fjahanian@apple.com> More type checking for properties, accessors and
use of dot-syntax expression. This is to match gcc's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
af199f32b008191341f248d7d50616a6a71ba354 07-May-2009 Mike Stump <mrs@apple.com> Tighten up relationals with blocks and ints. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd3e1664b5a0996115ef141ad2396168b3a1d288 07-May-2009 Mike Stump <mrs@apple.com> Improve semantic checking for blocks. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
53202857c60214d80950a975e6e52aebf30bd16a 04-May-2009 Eli Friedman <eli.friedman@gmail.com> PR2524: downgrade taking address of expression of type 'void' to an
extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c0d600c83a91b200616616f3982553c0ff42fcf3 03-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix/re-enable test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5992e4a9cf7e2762a746a6d355dfab4598125012 02-May-2009 Anders Carlsson <andersca@mac.com> Fix a thinko and a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f9b8bc662a84bb89a2d98530592f5d8fb6bee761 02-May-2009 Anders Carlsson <andersca@mac.com> Downgrade the invalid offsetof error to a warning.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d833e349029ba73d4a101831371515a25dbda60 02-May-2009 Douglas Gregor <dgregor@apple.com> Fix bitfield promotions in several more cases. We don't seem to work hard enough at determining whether an expression is a bitfield or not, yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6d7f149b0bff12e8f74c372e50b6e9a9ea980425 02-May-2009 Anders Carlsson <andersca@mac.com> It's an error to call offsetof on a non-POD type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fc24e44bea29dcaabd9cf2c7663fe1c1286d90c1 01-May-2009 Douglas Gregor <dgregor@apple.com> Implement bit-field promotion rules for C99. Fixes PR3500.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e9146f2e9f1c4e281544e8c080934c72d41012ca 01-May-2009 Anders Carlsson <andersca@mac.com> Replace more release+static_cast with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f1b1d59a3f0650ab97b04235a14ae4549ca1c656 01-May-2009 Anders Carlsson <andersca@mac.com> Replace a bunch of static_cast + release with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
41826bb59d2ef5e8c8a4a0cd2b06a7a011b67b4d 01-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4013 and PR4105: pointer-like types can only be cast to/from integers
and other pointer-like types.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6c92fa75e62937f9738696840efcb258560f4568 29-Apr-2009 Mike Stump <mrs@apple.com> Fixup Sema and CodeGen for block literal attributes when the return
type and argument types are missing, and let return type deduction
happen before we give errors for returning from a noreturn block.
Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
19c30c00e5e01e4608a43c7deb504f343f09e46d 29-Apr-2009 Mike Stump <mrs@apple.com> Sema and CodeGen support for attributes on blocks. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
72527137c521ad9330ecb81ccd841159719dc8cd 29-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4103: improve source location information for members of the current
class. This isn't perfect, but it's a big improvement over not having
any location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9895d88c34cb2eab65c622cddeaf721108d1af38 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix a minor edge case in C89 mode related to the definition of a
"function designator".

(This causes a minor glitch in the
diagnostics for C++ member pointers, but we weren't printing the
right diagnostic there anyway.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4eeab84b6527feba5c63b819a74417677c9977a0 28-Apr-2009 Mike Stump <mrs@apple.com> Don't allow blocks to be declared as returning an array. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e93569666e330ca66ed4b3f58d2c15f3d9b24cd1 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4079: make sure to construct the member expressions for
offsetof correctly in the presence of anonymous structs/unions.

This could definitely use some cleanup, but I don't really want to mess
with the anonymous union/struct code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7c32f8e9be486f8f8ec2e75eba36903f7cb1b73a 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4074: allow subscripting non-lvalue arrays in C90 mode.

I wasn't originally going to use this approach, but cases like
test/Sema/expr-comma.c make things difficult.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
338395d31eecbf99bc1b15ef5631d1359bb96083 26-Apr-2009 Chris Lattner <sabre@nondot.org> minor diagnostics improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3b5cccad43000e2c0bae52e6ec992a9fa1900266 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Make VerifyIntegerConstantExpr print extension warnings for non-ICEs.

Overall, I'm not particularly happy with the current situation regarding
constant expression diagnostics, but I plan to improve it at some point.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3bf6893b77c30cb774100e0fa7ae029331675ec1 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4073 by making designated initializer checking code use
VerifyIntegerConstantExpression instead of isIntegerConstantExpr.
This makes it ext-warn but tolerate things that fold to a constant
but that are not valid i-c-e's.

There must be a bug in the i-c-e computation though, because it
doesn't catch this case even with pedantic.

This also switches the later code to use EvaluateAsInt which is
simpler and handles everything that evaluate does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4a049f074117555e932a1256a3d41d8254e85866 25-Apr-2009 Chris Lattner <sabre@nondot.org> remove a fixme that is already done.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5153ee66d6d4fb37b02f85df38e48dc8b46660df 25-Apr-2009 Chris Lattner <sabre@nondot.org> Change SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to
always return a non-null QualType + error bit. This fixes a bunch of
cases that didn't check for null result (and could thus crash) and eliminates
some crappy code scattered throughout sema.

This also improves the diagnostics in the recursive struct case to eliminate
a bogus second error. It also cleans up the case added to function.c by forming
a proper function type even though the declarator is erroneous, allowing the
parameter to be added to the function. Before:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^
t.c:4:3: error: use of undeclared identifier 'P'
P+1;
^

After:
t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b5f1562d7b57a3dbe27a39b45995f59862973820 25-Apr-2009 Chris Lattner <sabre@nondot.org> reject explicit pointer arithmetic on interface pointers in 64-bit objc ABI


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5cb10d3b1ad546b232e72275eaaf56d72823901d 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix the sizeof error recovery issue (sizeof-interface.m:attributeRuns)
by correctly propagating the fact that the type was invalid up to the
attributeRuns decl, then returning an ExprError when attributeRuns is
formed (like we do for normal declrefexprs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ced1e286765b4a1c568c8bf2ca41d863bf1584dd 24-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Avoid issuing spurious errors as side-effect of diagnosing
application of sizeof on an interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1efaa9594a81709a17658fd80ae7e783e1026407 24-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6821047 - clang crashes on subscript of interface in 64-bit mode

Several changes here:
1. We change Type::isIncompleteType to realize that forward declared
interfaces are incomplete. This eliminate special case code for this
from the sizeof path, and starts us rejecting P[4] when P is a pointer
to an incomplete interface.
2. Explicitly reject P[4] when P points to an interface in non-fragile ABI
mode.
3. Switch the sizeof(interface) diagnostic back to an error instead of a
warning in non-fragile abi mode.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8fc463adf0116fdcbff86e9cca11955aad1649fe 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
653f1b1bf293a9bd96fd4dd6372e779cc7af1597 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25efa107ae8381458ffa464c5fc7d21135bbe52d 22-Apr-2009 Mike Stump <mrs@apple.com> Tighten up blocks type checking. This was discussed back in the
r56595 timeframe, but left undone. Radar 6812711


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5c59e2b5215eff79372b9498c3559da9d700588d 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6814047, a crash on invalid in blocks code I noticed when
working on the previous fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
17f3a6d0d8026238830eacd0d765267a6ced4edc 22-Apr-2009 Chris Lattner <sabre@nondot.org> fix marking of nested blocks with the "hasBlockDeclRefExprs" to
mark exactly the blocks which have references that are "live through".
This fixes a rejects valid:
rdar://6808730 - [sema] [blocks] block rejected at global scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5b54b88c4082bb81b8b341b622fda9a85cbd5fad 22-Apr-2009 Chris Lattner <sabre@nondot.org> this is a warning now, return a well formed ast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ca790923930ca8df23bc1473fe925586e27387a6 21-Apr-2009 Chris Lattner <sabre@nondot.org> reject sizeof(itf) when itf is a forward declared interface, or when
in non-fragile abi mode. rdar://6811884


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
525c9b7baeeff022127cd1b167579f3bda73b3ed 21-Apr-2009 Daniel Dunbar <daniel@zuster.org> Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
23d58ce9d103115fec4693285d0bcdbaccefea0f 20-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Some cleanup and bug-fixing for address-of checking. This causes a couple of
minor accepts-invalid regressions, but we weren't really rejecting them for
the right reason. We really need a more general solution to detect all the
cases of the promotion of arrays with a register storage class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
17a783055a41a44fda76b1747ebe6fd8ac2ba00a 19-Apr-2009 Chris Lattner <sabre@nondot.org> run the jump checker on blocks, even though they don't have gotos,
they do allow switches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ea29a3a0d6948c4a51a261d19ec1a585d2a9c779 18-Apr-2009 Chris Lattner <sabre@nondot.org> refactor some code, adding a new getLabelMap() accessor method
so that clients can't poke the function-local one when they really
want the current block label. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7297134f128423fce2e88f92421ed135bded7d4e 18-Apr-2009 Douglas Gregor <dgregor@apple.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
397195bf3077fb42789b326f69f7d417227a0588 17-Apr-2009 Mike Stump <mrs@apple.com> Fixup semantic analysis for nested blocks, and allow block literal
expressions that can be of static duration to be returned.
Radar 6786551


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
ffb4b6e299069139908540ce97be4462e16b53a4 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement support for designated initializers that refer to members of
anonymous structs or unions. Fixes PR3778.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
44e35f7b2b5da1eb338639e46bf0b5522e75c5f3 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Improve "assignment to cast" diagnostic.
- Strip off extra parens when looking for casts.
- Change the location info to point at the cast (instead of the
assignment).

For example, on

int *b;
#define a ((void*) b)
void f0() {
a = 10;
}

we now emit:

/tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
a = 10;
^ ~
/tmp/t.c:2:12: note: instantiated from:
#define a ((void*) b)
~^~~~~~~~~~

instead of:

/tmp/t.c:4:5: error: expression is not assignable
a = 10;
~ ^


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2c4463f744487e242f7c88b6daa0abf5cb24219e 12-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6770142 - Class and qualified id's are compatible, just like
Class and unqualified id's are.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9097af160e647df10829cdd548a06c84649f0231 11-Apr-2009 Chris Lattner <sabre@nondot.org> fix blocks to reject objc interfaces returned by value. Also,
a block without a prototype should still coerce a return in it to
use the declared return type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
a0c3e9cde1581b1b4d43ca89fdf413cd84eaec1f 09-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6770998> make cast of super illegal (again:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9158804749356f88be8c5a3bade75b761846273c 08-Apr-2009 Steve Naroff <snaroff@apple.com> Sema::CheckConditionalOperands(): Soften pointer/integer mismatch from error->warning.

Fixes <rdar://problem/6762239> [sema] gcc incompatibility; error on incompatible operand types in ?:.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ef79bc9b079d838ba2cc91b37760d297025eb3e6 07-Apr-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes method name lookup when method appears in
the base implementations (and not in
current implementation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fc479d793b5daa20bbf54651b83a90e77e907949 07-Apr-2009 Steve Naroff <snaroff@apple.com> Make casting 'super' a deprecated warning (instead of a hard error).

This will simplify clang adoption, and is probably better "etiquette" (since gcc has always accepted this idiom without warning). Once we are over the adoption hurdle, we can turn this into an error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a86b832906d04e9867b792128ad19af39f7cc06b 06-Apr-2009 Douglas Gregor <dgregor@apple.com> Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3f419761288f6ce8ffc284e9e241c28b536fce35 06-Apr-2009 Chris Lattner <sabre@nondot.org> Daniel convinced me that accepting "const va_list" arguments to va_arg is
a really really bad idea. Now that we emit an error about the unpromoted
type, users should be able to understand what is going on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d20b8a6d8af041edeb27cc4c68392454297e308 05-Apr-2009 Chris Lattner <sabre@nondot.org> in va_arg diagnostics, print out the unpromoted type. This makes the
diagnostic use the va_list typedef more often, see the difference in the
changed testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9dc8f19a5394c4268727f0d755623f8d56416e7c 05-Apr-2009 Chris Lattner <sabre@nondot.org> Add a warning for questionable va_args usage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f502691c86299ed23b7e121e27610ba5bb44a1ee 05-Apr-2009 Chris Lattner <sabre@nondot.org> GCC compatibility: gcc allows applying va_args to const
va_lists for some reason. This fixes rdar://6726818


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
95f49fb26637e0f271bca580e8e20ce3c08ac2e9 03-Apr-2009 Chris Lattner <sabre@nondot.org> improve the string literal comparison warning to not call @encode's "string literals".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
74734d576b1dd082f623abb76ab204d69970dadb 02-Apr-2009 Douglas Gregor <dgregor@apple.com> When calling a function without a prototype for which we have a
definition, warn if there are too many/too few function call
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a3a835149ed4b183e3b009a1f94a6123779d696b 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add some more code modification hints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a3d2524e701b40b2c0cb3688017f153fd1d36bfe 31-Mar-2009 Chris Lattner <sabre@nondot.org> reduce nesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d013aa1ee78d8ead93179c179b7c0746e8d97dbb 31-Mar-2009 Chris Lattner <sabre@nondot.org> Codegen sometimes crashes on comparisons that aren't legal, just
disable this feature for now, to err on the side of rejecting instead
of sometimes crashing. rdar://6326239


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
ab3a852ae713189444dcbf75e70accf1e8c2b7f2 28-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into
the AST which is otherwise non-obvious. Fix Sema to always come up with the
right answer for both of these types. Fix IRGen and the analyzer to
account for these changes. This fixes PR2601. The approach is inspired
by PR2601 comment 2.

Note that this changes real *= complex in CodeGen from a silent
miscompilation to an explicit error.

I'm not really sure that the analyzer changes are correct, or how to
test them... someone more familiar with the analyzer should check those
changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
214f31a347d7824eb92e6a3f5dce4d4047fd5ae0 27-Mar-2009 Douglas Gregor <dgregor@apple.com> If the user is trying to apply the -> or . member reference operator
to a function or function pointer, it's probably because the user
forgot to put in parentheses () to call the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9af5500f3f132f9a2f9abbe82113a7c7bb751472 27-Mar-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6719156 - clang should emit a better error when blocks are disabled but are used anyway
by changing blocks from being disabled in the parser to being disabled
in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3507369940bfb269551bfa1fec812481f60e3552 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Simplify CXXScopeSpec a lot. No more weird SmallVector-like hacks here

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ab452ba8323d1985e08bade2bced588cddf2cc28 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Revamp our representation of C++ nested-name-specifiers. We now have a
uniqued representation that should both save some memory and make it
far easier to properly build canonical types for types involving
dependent nested-name-specifiers, e.g., "typename T::Nested::type".

This approach will greatly simplify the representation of
CXXScopeSpec. That'll be next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8bfd1b8c36c88fd15c39185b3494dd30a001cfb3 26-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6697053> instance variable is protected.

Treat @package the same as @public. The documentation for @package says it is analogous to private_extern for variables/functions. Fully implementing this requires some kind of linker support (so access is denied to code outside the classes executable image). I don't believe GCC fully implements this semantic. Will discuss with Fariborz offline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
b1d796d587033ec2e59313ac5d87be57d5272438 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Add some FIXMEs relating to incomplete types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f05c05d2e1a2952e6cc7c3e54366fb8d99ff579c 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Partial implementation of PR3342: break out pointer sign
incompatibilities in assignments from other pointer incompatibilities.
Based off of the patch in PR3342. (This doesn't implement -Wno-pointer-sign,
but I don't know the driver code very well.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5fdeae17da443c50c62f602733d06193a71b170f 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix code to mark block variables as const to actually work. Fix
isObjCObjectPointerType to work with qualified types. Adjust test for
changes.

If the SemaExpr changes are wrong or break existing code, feel free to
delete the "ExprTy.addConst();" line and revert my changes to
test/Sema/block-literal.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e7c6f7aa7e8ee1f0acacc314dcf59d5dadff1524 22-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Check that the return/argument types of calls are complete.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5908a9293b88a3da57ae59b522275d05e1ab11e0 21-Mar-2009 Douglas Gregor <dgregor@apple.com> InitListDesignations hasn't been used (ever). Eliminate it, and
simplify the parsing and action interface for designated
initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9ecede735e6b180676846e95844a846ff7c251e0 20-Mar-2009 Ted Kremenek <kremenek@apple.com> Remove unneeded radar reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b82dcd827495592a8748692ce4bf80402f21b8d4 20-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix <rdar://problem/6703892> by not warning about self-comparisons of enum
constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2ce1be03e25eed3f5bf7762367b7cdb7221b0a51 19-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> When looking for property name (or getter method) in a
dot-syntax expression after earching the list of protocols
in the qualified-id, must keep searching the protocol list
of each of the protocols in the list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5953d8b37f92f0cf548941f617c9b0a7703df33b 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression type, UnresolvedDeclRefExpr, that describes
dependent qualified-ids such as

Fibonacci<N - 1>::value

where N is a template parameter. These references are "unresolved"
because the name is dependent and, therefore, cannot be resolved to a
declaration node (as we would do for a DeclRefExpr or
QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to
DeclRefExprs, QualifiedDeclRefExprs, etc.

Also, be a bit more careful about keeping only a single set of
specializations for a class template, and instantiating from the
definition of that template rather than a previous declaration. In
general, we need a better solution for this for all TagDecls, because
it's too easy to accidentally look at a declaration that isn't the
definition.

We can now process a simple Fibonacci computation described as a
template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bad351822117eaf280081494e3dbe4a06c0dbfcf 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Generalize printing of nested-name-specifier sequences for use in both
QualifiedNameType and QualifiedDeclRefExpr. We now keep track of the
exact nested-name-specifier spelling for a QualifiedDeclRefExpr, and
use that spelling when printing ASTs. This fixes PR3493.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a representation for types that we referred to via a
qualified name, e.g.,

foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in

::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ca5e77fefc4ac06aa787d7e777957ba6b7a03c60 18-Mar-2009 Douglas Gregor <dgregor@apple.com> The scope representation can now be either a DeclContext pointer or a
Type pointer. This allows our nested-name-specifiers to retain more
information about the actual spelling (e.g., which typedef did the
user name, or what exact template arguments were used in the
template-id?). It will also allow us to have dependent
nested-name-specifiers that don't map to any DeclContext.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
e78b809bbcd92928a63da81f2cd843faad3e4dfd 13-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.

Also changed BlockDecl API to be more consistent (wrt FunctionDecl).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d8eb456289a81728f9aac77ac0a4db0ea9cc231a 13-Mar-2009 Steve Naroff <snaroff@apple.com> Reimplement fix for <rdar://problem/6451399> problems with labels and blocks.

This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris).

The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
caaacecb2b64e6d2e402533baffda4cb540f4145 13-Mar-2009 Steve Naroff <snaroff@apple.com> Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).

Will replace with something better today...


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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
baf534875ed0a55c6342636ff3f4602b8ac22b69 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate some unused default cases in switches on the binary operator kind

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4a471aa85d9539421e5cff11a24dd01f000c760a 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Properly restore ActiveScope when we exit parsing of a block. This
should fix the largest problem in <rdar://problem/6669847>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d2e9cfdc1dbb6e4a22f8c0b1abcd30437e3795d 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXClassVarDecl. It doesn't add anything

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
335c6808aabff7cb043ea02b72754fd580ce9712 11-Mar-2009 Steve Naroff <snaroff@apple.com> Implement FIXME related to <rdar://problem/6496506> Implement class setter/getter for properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4fdf1faedbca40787fd277a6fbd5061fd69b2708 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Add basic, hackish support for instantiation of typedefs in a class
template. More importantly, start to sort out the issues regarding
complete types and nested-name-specifiers, especially the question of:
when do we instantiate a class template specialization that occurs to
the left of a '::' in a nested-name-specifier?




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f178728e8cb972a8a8923ba75b4ef7367b641626 11-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6655054> clang issues bogus error on property usage in a dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1ca6694b5b37470ac736737a26da09b088a18d5d 11-Mar-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6578665> user declared setter method should be used when using property syntx.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fdc92b7877535e6264fe43cfbdc8f01e9b224f81 10-Mar-2009 Steve Naroff <snaroff@apple.com> Simplify SelectorTable::constructSetterName() usage...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61f72cbd037e58f12cfe90cd442373f44092f030 09-Mar-2009 Steve Naroff <snaroff@apple.com> Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(

This fixes <rdar://problem/6496506> Implement class setter/getter for properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
3e87209798bcc3fe39254c1b700b0c8251623b98 09-Mar-2009 Chris Lattner <sabre@nondot.org> do not warn about -=/=- confusion with macros, thanks to rdogra for a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
55660a74897bf42111a8ae61c1f617645e5a9274 08-Mar-2009 Chris Lattner <sabre@nondot.org> implement PR3753, warning about comparisons with a string literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
399bd1bc2b801ad85e4575e2401bb43919fcbee8 08-Mar-2009 Chris Lattner <sabre@nondot.org> refine the "use of unary operator that may be intended as compound assignment (+=)"
warning to only trigger when there is whitespace or something else after the + as
suggested by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25a30d0c3337a4f7bd1fb585e2becc6736e806fa 07-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Don't discard increment/decrement on function pointers. It's kind of
difficult to come up with a testcase because the code generation for this
construct is broken.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6ee6bab61ab61eeceb3572bd5a9f85a9424eb9f 06-Mar-2009 Chris Lattner <sabre@nondot.org> add source range for type of super cast, giving something like:

SemaObjC/call-super-2.m:78:29: error: cannot cast 'super' (it isn't an expression)
return [(Object <Func> *)super instance_func0];
~~~~~~~~~~~~~~~~~^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd53eb55b2467d38ce4857b979589347d5e3732c 05-Mar-2009 Steve Naroff <snaroff@apple.com> Partial fix <rdar://problem/6301205> [irgen] dot-syntax on super isn't supported.

Tweak Sema::ActOnMemberReferenceExpr() and Sema::ActOnDeclarationNameExpr() to handle "super." notation for Class methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a6e3ac514c924879699c6b0b1201028f0091044f 04-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented access check for ivars accessed inside
c-style functions declared inside objc @implementations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b06d875594361dd384d2b08c5ab7f10cfdac0f6b 04-Mar-2009 Steve Naroff <snaroff@apple.com> Partial fix for <rdar://problem/6645157> [clang on Xcode; regression]: error: instance variable 'someField' is private.

A recent regression caused by http://llvm.org/viewvc/llvm-project?rev=65912&view=rev.

This commit isn't fully baked. Nevertheless, it should cause Xcode to compile again. Will speak with Fariborz offline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b9dfd4257b85c388a9e3cd345cf28acb7351006 04-Mar-2009 Steve Naroff <snaroff@apple.com> Finish up some fixes related to <rdar://problem/6497631> Message lookup is sometimes different than gcc's.

- Disallow casting 'super'. GCC allows this, however it doesn't make sense (super isn't an expression and the cast won't alter lookup/dispatch).
- Tighten up lookup when messaging 'self'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
935fd768f95edc21f03c6c61f8b48ee99ff8bab6 03-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Check of ivar access access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
077c1e7377edeef3438ba59cd8151177868b62d4 02-Mar-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose a variety of access of ivars when they conflict with
local or global variables in instance/class methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6393519272ce727f4d26e71bbefb5de712274d0e 02-Mar-2009 Douglas Gregor <dgregor@apple.com> Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b098c14c525894702994d5dc4b58a4283ac25c63 28-Feb-2009 Steve Naroff <snaroff@apple.com> Remove PrevFunctionScope slot (it isn't needed)...use getParent() instead.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f3cf89737965352ee02026992e2dc735824e185e 28-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6451399> problems with labels and blocks.

- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a97b6666d2e08027e89a01ed718affbf969fad19 27-Feb-2009 Ted Kremenek <kremenek@apple.com> In BuildAnonymousStructUnionMemberReference, we shouldn't invalidate OpLoc when
building nested member expressions. This location is used to determine the range
of the entire expression, and the expression itself already has its location
inherited from its Base.

This fixes <rdar://problem/6629829>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
35183aca180a2b9b2c637cd625a40a7e147d6a32 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Change the AST generated for offsetof a bit so that it looks like a
normal expression, and change Evaluate and IRGen to evaluate it like a
normal expression. This simplifies the code significantly, and fixes
PR3396.



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

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

As part of this, some types have been renamed:

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

There shouldn't be any functionality change...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dbb1ecc32ca122b07b7c98fd0a8f6f53985adacc 27-Feb-2009 Chris Lattner <sabre@nondot.org> fix some sema problems with wide strings and hook up basic codegen for them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4b2d3f7bcc4df31157df443af1b80bcaa9b58bba 26-Feb-2009 Douglas Gregor <dgregor@apple.com> Introduce code modification hints into the diagnostics system. When we
know how to recover from an error, we can attach a hint to the
diagnostic that states how to modify the code, which can be one of:

- Insert some new code (a text string) at a particular source
location
- Remove the code within a given range
- Replace the code within a given range with some new code (a text
string)

Right now, we use these hints to annotate diagnostic information. For
example, if one uses the '>>' in a template argument in C++98, as in
this code:

template<int I> class B { };
B<1000 >> 2> *b1;

we'll warn that the behavior will change in C++0x. The fix is to
insert parenthese, so we use code insertion annotations to illustrate
where the parentheses go:

test.cpp:10:10: warning: use of right-shift operator ('>>') in template
argument will require parentheses in C++0x
B<1000 >> 2> *b1;
^
( )


Use of these annotations is partially implemented for HTML
diagnostics, but it's not (yet) producing valid HTML, which may be
related to PR2386, so it has been #if 0'd out.

In this future, we could consider hooking this mechanism up to the
rewriter to actually try to fix these problems during compilation (or,
after a compilation whose only errors have fixes). For now, however, I
suggest that we use these code modification hints whenever we can, so
that we get better diagnostics now and will have better coverage when
we find better ways to use this information.

This also fixes PR3410 by placing the complaint about missing tokens
just after the previous token (rather than at the location of the next
token).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
d8f4f4330031f893b647662bd5ff1b9ae3da694f 25-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Minor cleanup for IntToBlockPointer so it applies to all callers of
Sema::CheckAssignmentConstraints; not really visible, but the right
thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
25d944af5d8d665611e09956954f10896c1071f6 24-Feb-2009 Douglas Gregor <dgregor@apple.com> In C, when we see a function declaration within a local scope, export
that declaration to global scope so that it can be found from other
scopes. This allows us to diagnose redeclaration errors for external
declarations across scopes. We also warn when name lookup finds such
an out-of-scope declaration. This is part of <rdar://problem/6127293>;
we'll also need to do the same thing for variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d461777e23204fe8c480302d8ff76f5847605da6 23-Feb-2009 Steve Naroff <snaroff@apple.com> Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.

Remove support for "Class<P>". Will be making this an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f7f52e7bf5a4dc36d45b98531e0b21e343fc19de 21-Feb-2009 Steve Naroff <snaroff@apple.com> More work to integrate newly added ObjCQualifiedClassType into the type system.

This is necessary 'plumbing' to fix <rdar://problem/6497631> Message lookup is sometimes different than gcc's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5fd659db11922fc12a58e478f7b745f9656b15a7 21-Feb-2009 Steve Naroff <snaroff@apple.com> This fixes <rdar://problem/6497650> More type mismatches issues with clang.

Move two key ObjC typechecks from Sema::CheckPointerTypesForAssignment() to ASTContext::mergeTypes().

This allows us to take advantage of the recursion in ASTContext::mergeTypes(), removing some bogus warnings.

This test case I've added includes an example where we still warn (and GCC doesn't). Need to talk with folks and decide what to do. At this point, the major bogosities should be fixed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b83d287bc7f47d36fb0751a481e2ef9308b37252 19-Feb-2009 Mike Stump <mrs@apple.com> Add enough checking to ensure that non-constant block literals don't
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b4650c178e4ece69431706ff88eb2d3daf44a661 19-Feb-2009 Chris Lattner <sabre@nondot.org> fix another typo gabor noticed


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eed9cacc7af03953c16fedc9a9d96a6ba4f36df2 19-Feb-2009 Mike Stump <mrs@apple.com> Fit 80col and fix indentation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
488e25b980800c5f6d5b9cb4345d0f0d92942889 19-Feb-2009 Mike Stump <mrs@apple.com> Fix spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1e4db7c468c002c58f07e059ff7925384f053e85 18-Feb-2009 Chris Lattner <sabre@nondot.org> rip out __builtin_overload


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
2085fd6cd22ec5c268175251db10d7c60caf7aaa 18-Feb-2009 Chris Lattner <sabre@nondot.org> privatize all of the string literal memory allocation/creation
stuff behind a private static function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c6666f8e9bbb7f31bf2e52f97137e738c4ca01d0 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Don't allow calls to functions marked "unavailable". There's more work
to do in this area, since there are other places that reference
FunctionDecls.

Don't allow "overloadable" functions (in C) to be declared without a
prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
726e168dc09fb23f53c7b004f8e919421ee91806 18-Feb-2009 Chris Lattner <sabre@nondot.org> change the StringLiteral AST node to track all of the SourceLocations of
the various PPTokens that are pasted together to make it. In the course
of working on this, I discovered ParseObjCStringLiteral which needs some
work. I'll tackle it next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a119a3b07372888a2f5b9ec693c52daae7c0f522 18-Feb-2009 Chris Lattner <sabre@nondot.org> fix rdar://6597252: two exactly identical pointer types are always
compatible, even if they are weird implicit objc pointer types like
Class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
efdc39d4f5e61df2d0b41a5de8e744f252b5aff3 18-Feb-2009 Chris Lattner <sabre@nondot.org> rename some variables, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f11284ac87daa613bc7b30db9f54bd716d123222 17-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ASQualType to ExtQualType to reflect its more
general use; as for, objc2's gc type attributes. No
change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba27e2a5c2ba49c0f3d84118508f761bf8fb762d 17-Feb-2009 Chris Lattner <sabre@nondot.org> emit:
t.c:4:9: error: invalid type 'short *' to __real operator
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)),
^
instead of:
t.c:4:9: error: invalid type 'short *' to __real or __imag operator
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)),
^

fixing a fixme. It would be even fancier to get the spelling of the token, but I
don't care *that* much :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
73525de7fd9bdd534382dc89a24f1f76db3e04b9 16-Feb-2009 Chris Lattner <sabre@nondot.org> enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f15970cff7d53cd29f7f85aa6edeec2cac0d2d59 16-Feb-2009 Chris Lattner <sabre@nondot.org> do not warn about uses of deprecated decls when in an out-of-line objc method
whose declaration was declared as deprecated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c71e28c6a5a50d7eb00bd5f703d9a09b59412d6b 16-Feb-2009 Douglas Gregor <dgregor@apple.com> When inside an Objective-C++ method, name lookup should look into the
interface for ivars before assuming that this is an unresolved
function name.

Fixes <rdar://problem/6590445>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7eba82e4be8f437120d9089f4424e2f516c6e060 16-Feb-2009 Chris Lattner <sabre@nondot.org> Add support for deprecating ObjC properties. Unlike GCC, we warn that the
property is deprecated, not the getter/setter if the attribute is on
the property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
553905db4c758883345efa3c4c07e1dba2c74a2f 16-Feb-2009 Chris Lattner <sabre@nondot.org> add support for deprecated objc ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cfdff38e8e931c0020dff10a32221d8fedb287a6 16-Feb-2009 Chris Lattner <sabre@nondot.org> Add support for deprecated members of RecordDecls (e.g. struct fields).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b104b1f6ca76cefab25c6ecb5df3bf87a0f875d3 15-Feb-2009 Nate Begeman <natebegeman@mac.com> Don't allow taking the address of an element in an ext_vector


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
76a642ff4fce7a0648c79a1f01324a8c3880e251 15-Feb-2009 Chris Lattner <sabre@nondot.org> Refactor the deprecated and unavailable checks into a new
DiagnoseUseOfDeprecatedDecl method. This ensures that they
are treated consistently. This gets us 'unavailable' support
on a few new types of decls, and makes sure we consistently
silence deprecated when the caller is also deprecated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61a0f17301f889260de739219c3e1d4c8039210e 15-Feb-2009 Chris Lattner <sabre@nondot.org> allow implementations of deprecated functions to use deprecated symbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3c385e5f8d9008fff18597ca302be19fa86e51f6 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
90e150d7f40e24ed6f8d268e7d83b2f15153c1ee 14-Feb-2009 Chris Lattner <sabre@nondot.org> reduce nesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3e41d60eb627dc227c770f1c1c87d06909cf05fd 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
56cd21bd52aed7a32f3ff11b7e480f664d0b4262 13-Feb-2009 Chris Lattner <sabre@nondot.org> If x is an invalid field decl, don't construct an expression for P->x,
just silently return an error to avoid bogus diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1fd03615dc8303ac3f03525758ef172cf88b2051 12-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6499801> clang does not detect objc type mismatch in conditional expr


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
c15cb38a4ff717097b32532fbf761c71b1376a02 10-Feb-2009 Douglas Gregor <dgregor@apple.com> Rudimentary checking of template arguments against their corresponding
template parameters when performing semantic analysis of a template-id
naming a class template specialization.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fb7413f12636cefa9ebec9abf95804f82c305b11 09-Feb-2009 Ted Kremenek <kremenek@apple.com> Allocate the subexpression array for OberloadExpr from ASTContext's allocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
7878ffde0c48a33a8fd3819be1b797d52f7b3849 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add negative test cases and fix diagnostics for member pointer dereferencing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
224605064a4ef87d1c3d35ad1cb363f8b534012b 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement dereferencing of pointers-to-member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6e94ef5696cfb005d3fc7bbac8dcf7690b64f0a5 06-Feb-2009 Ted Kremenek <kremenek@apple.com> Move StringLiteral to allocate its internal string data using the allocator in
ASTContext. This required changing all clients to pass in the ASTContext& to the
constructor of StringLiteral. I also changed all allocations of StringLiteral to
use new(ASTContext&).

Along the way, I updated a bunch of new()'s in StmtSerialization.cpp to use the
allocator from ASTContext& (not complete).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
98eb8a7a702b95183ed015706b1f1c66f5cb27a4 04-Feb-2009 Mike Stump <mrs@apple.com> Add support for blocks with explicit return types.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aaba5e346dffdbad5d1c42765a89e4a7afb0da67 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
47b9a1ca55e61e37f5a368740e29de190345acc6 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Some name-lookup-related fixes, from Piotr Rak!

- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.



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


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b0f90ccbc1079bb054071b836aa6dd265f33f3a2 31-Jan-2009 Anders Carlsson <andersca@mac.com> Turn on -flax-vector-conversions by default, issue a warning whenever one is done. Add a -fnolax-vector-conversions option. Fixes PR2862.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
4c67834407ca6ab344dcf44fc599ad4938cfa96d 28-Jan-2009 Douglas Gregor <dgregor@apple.com> Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
7216dc9cb49f47254595120cf15a737cee53f0bd 26-Jan-2009 Chris Lattner <sabre@nondot.org> rename getSpelledCharacterAt to getSpellingOfSingleCharacterNumericConstant,
optimize it to use the LiteralData when possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1d24259b5f13663d015c096d5500dcf0ea5ff568 26-Jan-2009 Eli Friedman <eli.friedman@gmail.com> PR3269: create an empty InitListExpr as a child for the
CompoundLiteralExpr so that there aren't any null pointers in the AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dca2b7314f73fbb1e897befdc4f0ddaa9905d72c 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> PR3062: statement expressions should be illegal at file scope. I don't
think this has any significant effects at the moment, but it could
matter if we start constant-folding statement expressions like gcc does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
da0274725667d1168867dc404417f2c68c8dc0c5 24-Jan-2009 Chris Lattner <sabre@nondot.org> Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
31e21e05623ce9d11b1a893fecb87ad349df6c7d 24-Jan-2009 Chris Lattner <sabre@nondot.org> Fix PR3386 by handling GCC's rules for alignof, which are substantially
different than those for sizeof. Reject alignof(bitfield) like gcc does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
694b1e4425d930c471350b10cf22a93124a698bd 24-Jan-2009 Chris Lattner <sabre@nondot.org> fix a fixme, don't leak the expr on error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0107292a2dd92aced39c7c97eec9eb0ffa4b7186 24-Jan-2009 Chris Lattner <sabre@nondot.org> minor formatting changes, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3fd56d755aa74f01fbe963195c95c963ea1fee91 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure that all NamedDecls have an identifier namespace.
Make sure that we know a call is invalid if we dropped arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0804888d9162cfd422925762c161bd80f80358b9 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Allow subtraction of function pointer types in C, as a GNU extension. Fixes rdar://problem/6520707

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c983b86514d14dd4b30147bf6791dde9487d2c3f 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Support arithmetic on pointer-to-function types as a GNU
extension. Addresses clang PR/3371.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6ece14c609723053db91b917ee97d73cf240f85b 21-Jan-2009 Steve Naroff <snaroff@apple.com> Convert expressions over to Sebastian's spiffy ASTContext::new() operator.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e91b3bc1624ec877862e5d276f1b6f5026fe71e3 20-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Provide a placement new taking an ASTContext argument.
This allows more concise syntax when allocating an object using the ASTContext's allocator.
Convert a few allocations to this operator to for test purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9e0b600dc7373ee7d2857ef5ccebca599ebb5178 20-Jan-2009 Steve Naroff <snaroff@apple.com> Convert more exprs to use ASTContext's Allocator.

When using a BumpPtrAllocator, this reduces malloc overhead from 2.2->1.9% (for Cocoa.h).

At this point, malloc() has dropped the fourth most expensive routine (behind Preprocessor::HandleIdentifier()).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0a4739305a984ef9b821cedad5f4fe235eb6ef7d 20-Jan-2009 Steve Naroff <snaroff@apple.com> Allocate expresssions through ASTContext (still more work to do).
Add debug hook to DeclContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b8a6aca87d07b22b257153ce0dfc92f78c8f8c1f 19-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert more expression actions to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
0eb23307222bda7ad95d968eac4e1ab30864b213 19-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert more expression actions to smart pointers.
Fix type of logical negation for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
59b5da6d853b4368b984700315adf7b37de05764 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Support evaluation of vector constant expressions, and codegen of same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
353417af9d254d4fd0eb7d0a3ff71c4d8594ac58 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Update support for vector component access on ExtVectors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
334a802eeb5acb959f99b8227ee995725b2624aa 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Remove outdated diagnostic. Tests are coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bbee00b6456e90a09f63c83c20233e6c5ad6000a 16-Jan-2009 Chris Lattner <sabre@nondot.org> minor cleanups to StringLiteralParser: no need to pass target info
into its ctor. Also, make it handle validity checking of pascal
strings instead of making clients do it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dce5e2cabf07ff25eb4d9e1859c0a21c69f588d2 16-Jan-2009 Anders Carlsson <andersca@mac.com> Use a single function for doing vararg argument promotion. Also, make sure to do the promotion before checking the type - fixes PR3340.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0c21e84b82191ae1c4d04444a84008c464433868 16-Jan-2009 Chris Lattner <sabre@nondot.org> rename PP::getPhysicalCharacterAt -> PP::getSpelledCharacterAt.
Slightly speed up sema of numbers like '1' by going directly to
TargetInfo instead of through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eff2cd58a897379c7fc46e83447d4619d6f6e9ca 15-Jan-2009 Seo Sanghyeon <sanxiyn@gmail.com> PR2746: Implement GCC cast to union extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7176fff961e04c4dff61efb967b1d344d41335a7 15-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of member name lookup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
fa23c1d9adc99c662c1c0e192817185809d95614 14-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Implemenent objective-c's NSObject attribute as a way of ddeclaraing c-type
objects as an objective-c object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
28396608ec20d44e9d1470e1ea51689bb504d0de 14-Jan-2009 Ted Kremenek <kremenek@apple.com> PTH:
- Use canonical FileID when using getSpelling() caching. This
addresses some cache misses we were seeing with -fsyntax-only on
Cocoa.h
- Added Preprocessor::getPhysicalCharacterAt() utility method for
clients to grab the first character at a specified sourcelocation.
This uses the PTH spelling cache.
- Modified Sema::ActOnNumericConstant() to use
Preprocessor::getPhysicalCharacterAt() instead of
SourceManager::getCharacterData() (to get PTH hits).

These changes cause -fsyntax-only to not page in any sources from
Cocoa.h. We see a speedup of 27%.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
53859912e4b5c4493e28c9ead8d634fdaac6adaf 13-Jan-2009 Anders Carlsson <andersca@mac.com> Use the unqualified type for GCCs struct/union cast extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
906fed0fb54a338961aba3aa54802b7d68de94c7 13-Jan-2009 Anders Carlsson <andersca@mac.com> Warn when someone tries to pass a variable with a non-POD type to a varargs function/method/block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d1fa6449e9dbdd667466e9e1e971aa17c9793e8a 12-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to supprt case of readonly property being
assigned to when it has user declared setter method
defined in the class implementation (but no declaration in
the class itself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b3eef68111ffc220e449be96da1747998c057790 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Revert my previous, failed attempt to pretty-print anonymous struct/union accesses well. Added a FIXME so we know to revisit this later

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
83233a4b7c2bc7b531ffa3b33fdd1cd8138373b6 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix printing of member references to avoid displaying implicitly-generated member references, e.g., for anonymous struct/unions or implicit 'this' in member functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bcbffc46f1ad3796c4582fa1e3a9113b5aa26061 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of anonymous unions (and, as a GNU extension,
structures and classes) in C++. Covers name lookup and the synthesis
and member access for the unnamed objects/fields associated with
anonymous unions.

Some C++ semantic checks are still missing (anonymous unions can't
have function members, static data members, etc.), and there is no
support for anonymous structs or unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1a49af9681c350fef58e677f85ccb9a77e8e9d0a 06-Jan-2009 Douglas Gregor <dgregor@apple.com> Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
1) The use of a qualified-id instead of an unqualified-id suppresses
argument-dependent lookup
2) If the name refers to a virtual function, the qualified-id
version will call the function determined statically while the
unqualified-id version will call the function determined dynamically
(by looking up the appropriate function in the vtable).

Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
523aa600bee6b4de874cdc9dd0269c97cb7c912e 05-Jan-2009 Daniel Dunbar <daniel@zuster.org> Remainder is only valid on integer vector operands.

Improve ext vector test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
69d1d0029311fa657dd0be16b1b5ca51ec98d621 05-Jan-2009 Daniel Dunbar <daniel@zuster.org> Use CheckVectorOperands when % is applied to a vector type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61366e9cd41a6dbde4e66416dac21269c8ac1d94 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Correct the order in which we cope with end-of-class-definition
semantics and improve our handling of default arguments. Specifically,
we follow this order:

- As soon as the see the '}' in the class definition, the class is
complete and we add any implicit declarations (default constructor,
copy constructor, etc.) to the class.
- If there are any default function arguments, parse them
- If there were any inline member function definitions, parse them

As part of this change, we now keep track of the the fact that we've
seen unparsed default function arguments within the AST. See the new
ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly
cope with calls inside default function arguments to other functions
where we're making use of the default arguments.

Made some C++ error messages regarding failed initializations more
specific.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
88a3514f36de96b19cdf50141c640df1a5f13f6c 22-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for calls to overloaded member functions. Things to note:
- Overloading has to cope with having both static and non-static
member functions in the overload set.
- The call may or may not have an implicit object argument,
depending on the syntax (x.f() vs. f()) and the context (static
vs. non-static member function).
- We now generate MemberExprs for implicit member access expression.
- We now cope with mutable whenever we're building MemberExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
86f194083504938df72135b5b66bf0c5cafd9498 21-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6d5a4a58346441c969d5fcc7aa053e029186f86 20-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement checks for bool in increment and decrement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
00165a25a9ac005aa2e6b4ac791d555226fa9a9f 19-Dec-2008 Anders Carlsson <andersca@mac.com> Fix for PR3234

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
efc4c4bdbd8fee90b93deb3b5cfaeb044ae22557 18-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Removed a slot in ObjCMemRegExpr used in
code gen which did not belong there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9103bb27f4eefa0e0d7935387750e3aca24abc49 17-Dec-2008 Douglas Gregor <dgregor@apple.com> Delay semantic analysis of the C++ names casts when the subexpression is type-dependent or the destination type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6b6609f875cc4baa97a7c7db31b86da88706dcc9 16-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> remove debug stmt, sorry..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6fea8d2e42a53a1c03e2e1ced68dda8a36e09153 16-Dec-2008 Nuno Lopes <nunoplopes@sapo.pt> fix PR 3222: allow one to get the address of a global function in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
03f332a8f4300bbaa91240f461923e7874892dd3 15-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR3212: don't descend into C++ operator overloading code for C
programs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aaa63a761c6671a08e3f4f463435b72739fa194b 13-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Patch for ObjCIvarRefExpr containing the field
matching the storage layout for this ivar


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b0da923653601191c4f60bdc284feae376d28cda 12-Dec-2008 Chris Lattner <sabre@nondot.org> fix rdar://6097892 - gcc incompat: clang rejects __func__, __FUNCTION__, and __PRETTY_FUNCTION__ outside func

Yeah, this is "useful".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
5b1f3f0b21f1ad6999b0ae9f3fa3259737c799e5 11-Dec-2008 Anders Carlsson <andersca@mac.com> Make sure to promote expressions of the form (floating point + complex integer) correctly, to (complex floating point + complex floating point)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
2988205cb3d00286fa3f32ae242f6738da9060d1 10-Dec-2008 Douglas Gregor <dgregor@apple.com> Fix PR clang/3175: CheckAddressOfOperand does not handle references to class vars

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
83f96f668d0bcc957ead2032fe6e6c475dc156e5 10-Dec-2008 Douglas Gregor <dgregor@apple.com> Some cleanups to the dependent-types commit, as suggested by Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
391d8953701ad712bb31ebe33d12ca1765758897 10-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to allow a getter call using property dot-syntax notation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5c37de788529cd9180f22069970737a7208bd625 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for calls to dependent names within templates, e.g.,

template<typename T> void f(T x) {
g(x); // g is a dependent name, so don't even bother to look it up
g(); // error: g is not a dependent name
}

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
371f258e61e1365b951b17931a3c5ac1530fd1a0 05-Dec-2008 Chris Lattner <sabre@nondot.org> change getCurFunctionDecl to skip through Block contexts to find
the containing block. Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places. This fixes rdar://6405429.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cb354721a69038ecf371c7c84fb210d2d9c70f12 03-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix typo in index operator overloading.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d26527708b2b2f3b1d747f570efd10149d48364e 01-Dec-2008 Anders Carlsson <andersca@mac.com> Revert change that made isNullPointerConstant start emitting warnings. We don't want that :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4000ea685acfb3e827040ce0e172e13243c2edae 01-Dec-2008 Anders Carlsson <andersca@mac.com> Add Sema::isNullPointerConstant which extwarns if necessary. Use it in Sema::CheckConditionalOperands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e21555e666004b9aea0c8122358bc4cd3e61c4e7 30-Nov-2008 Anders Carlsson <andersca@mac.com> Add Sema::VerifyIntegerConstantExpression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d8b273470684a9cd47f0ce24743cc1f71ef7cbc 29-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement the GNU __null extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
63a9490b27db3af7ea94b6418d38433244f90e67 27-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't complain about block pointer to void* conversions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7ffd0defb993f82449afb18bb85a734e4b1bc308 26-Nov-2008 Douglas Gregor <dgregor@apple.com> Fix a minor typo in the handling of the conditional operator for Objective-C interface pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0a39668d6adf1d709985eef149136a80372f5032 26-Nov-2008 Douglas Gregor <dgregor@apple.com> Tweak the new ResolveOverloadedCallFn to just return a FunctionDecl. It makes ActOnCallExpr simpler

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f6b89691d2fdb88b97edabbe5f390fb2919c8f0a 26-Nov-2008 Douglas Gregor <dgregor@apple.com> Move the overloading logic of Sema::ActOnCallExpr to a separate function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
08631c5fa053867146b5ee8be658c229f6bf127c 23-Nov-2008 Chris Lattner <sabre@nondot.org> Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:

Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
22caddc91d2f6186739c6b20ec58ed38cd68e595 23-Nov-2008 Chris Lattner <sabre@nondot.org> Add support for sending QualType's directly into diags and convert two
diags over to use this. QualTypes implicitly print single quotes around
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba8d2d684e74a20bef03828c21c991d222c7e9e5 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> Support for implicit property assignment. Error assigning to
'implicit' property with no 'setter'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5daf570d0ce027e18ed5f9d66e6b2a14a40b720d 22-Nov-2008 Fariborz Jahanian <fjahanian@apple.com> New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e4c452c4c7b9124fe94a96f559ff077d59cdf996 22-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2c21a073525cdfa68e4439b7af551385dc2796ab 21-Nov-2008 Chris Lattner <sabre@nondot.org> merge some simple call diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b1b4d337fafe30823b581cbfaa1641f37541fffe 21-Nov-2008 Chris Lattner <sabre@nondot.org> print a type in a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3528d3552c309c37e6724b4c4f512290c276f534 21-Nov-2008 Chris Lattner <sabre@nondot.org> Change CheckIncrementDecrementOperand to test for common cases first
and fall through better.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8ba10745f525467e91bbaec21044bf4d9017a988 20-Nov-2008 Douglas Gregor <dgregor@apple.com> Add support for overloaded operator-> when used in a member access
expression (smart_ptr->mem).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
69d27b9f2e1c678b6b8a199fa3f705f2b3ff5e0d 20-Nov-2008 Chris Lattner <sabre@nondot.org> Daniel really really likes = instead of += :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f3a41af4d5c98a72a1d6720bbbfd658e57ef2541 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove the last old-fashioned Diag method. Transition complete!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
8469265156c6344fa1100a6a7bf6349acc187d9f 20-Nov-2008 Chris Lattner <sabre@nondot.org> instead of looking up super at startup time,
just check for it when needed. It doesn't incur real cost
in any hot paths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f9eb905197e44ed5634205512074993f6f40470d 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Support for calling overloaded function call operators (operator())
with function call syntax, e.g.,

Functor f;
f(x, y);

This is the easy part of handling calls to objects of class type
(C++ [over.call.object]). The hard part (coping with conversions from
f to function pointer or reference types) will come later. Nobody uses
that stuff anyway, right? :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
337c6b9f5d502dc1c5acea628bf7bf9e828efc0e 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Support overloading of the subscript operator[], including support for
built-in operator candidates. Test overloading of '&' and ','.

In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
74253736184c0717a0649922551bf9d8b6815651 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Added operator overloading for unary operators, post-increment, and
post-decrement, including support for generating all of the built-in
operator candidates for these operators.

C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.

In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3c73c41cefcfe76f36b7bed72c9f1ec195490951 19-Nov-2008 Chris Lattner <sabre@nondot.org> stop calling II::getName() unnecesarily in sema


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
fa25bbb351f4fdd977f51254119cdfc2b525ce90 19-Nov-2008 Chris Lattner <sabre@nondot.org> Switch several more Sema Diag methods over. This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
447b69e55e1098d8df46dd99f171bfaace9ff8a0 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Built-in equality and relational operators have return type "bool" in C++,
not "int".

Fix a typo in the promotion of enumeration types that was causing some
integral promotions to look like integral conversions (leading to
extra ambiguities in overload resolution).

Check for "acceptable" overloaded operators based on the types of the
arguments. This is a somewhat odd check that is specified by the
standard, but I can't see why it actually matters: the overload
candidates it suppresses don't seem like they would ever be picked as
the best candidates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
96176b3575823ea996c6140380dd17d9240c9766 19-Nov-2008 Douglas Gregor <dgregor@apple.com> Partial expansion of C++ operator overloading (for binary operators)
to support operators defined as member functions, e.g.,

struct X {
bool operator==(X&);
};

Overloading with non-member operators is supported, and the special
rules for the implicit object parameter (e.g., the ability for a
non-const *this to bind to an rvalue) are implemented.

This change also refactors and generalizes the code for adding
overload candidates for overloaded operator calls (C++ [over.match.expr]),
both to match the rules more exactly (name lookup of non-member
operators actually ignores member operators) and to make this routine
more reusable for the other overloaded operators.

Testing for the initialization of the implicit object parameter is
very light. More tests will come when we get support for calling
member functions directly (e.g., o.m(a1, a2)).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c9c7c4e06bba5dce053162ea1ead5743d7bba35b 18-Nov-2008 Chris Lattner <sabre@nondot.org> start converting Sema over to using its canonical Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
29a1cfbec38d255dd24ba660333a2430849a2f1c 18-Nov-2008 Chris Lattner <sabre@nondot.org> minor cleanups and tidying, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
858bb6f2d6790feeb03b3c2a24f01ef24b54301b 18-Nov-2008 Chris Lattner <sabre@nondot.org> implement a fixme by making warnings for ++/-- on non-modifiable-lvalues better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f67bd9f41ce60cbb5f107e980e940ae13471016c 18-Nov-2008 Chris Lattner <sabre@nondot.org> factor some code out into a helper function


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a11f42f4bca694b9be91350d0a74815f119e3fbf 18-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement effects of 'mutable', and a few comments from Chris on its parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ca354faa7e9b99af17070c82b9662a5fca76422c 17-Nov-2008 Chris Lattner <sabre@nondot.org> Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension. We don't and
will hopefully never support this.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a8069f102f1e7b67927be2e500ee1518e25aafbb 17-Nov-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6316324> [sema] spurious warning on comparison of qualified id.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b4609806e9232593ece09ce08b630836e825865c 14-Nov-2008 Douglas Gregor <dgregor@apple.com> Add a new expression node, CXXOperatorCallExpr, which expresses a
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)

I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bf3af056289893f58d37b05a2c80970708781d61 13-Nov-2008 Douglas Gregor <dgregor@apple.com> Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb8f3063257a392f15aea48d42fb73ec51afc548 12-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

struct X {
operator int const*();
} x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0518999d3adcc289997bd974dce90cc97f5c1c44 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
ef6e647b8d3268a765c2c4dd7f8a73cad281a8e6 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement Sema support for C++ nested-name-specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eb83ecde1a822b1c38cd060a85a08c1ac9f82cf8 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eaebc75ef6ff21fbc9f25ab4175cba465e4e0e43 07-Nov-2008 Douglas Gregor <dgregor@apple.com> Initial, rudimentary implementation of operator overloading for binary
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.

The other kinds of overloadable operators in C++ will follow this same
approach.

Three major issues remain:
1) We don't find member operators
2) Since we don't have user-defined conversion operators, we can't
call any of the built-in overloaded operators in C++ [over.built].
3) Once we've done the semantic checks, we drop the overloaded
operator on the floor; it doesn't get into the AST at all.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f03d7c7af2ca8555c513ba7667acffb667445ecd 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement C++ copy-initialization for declarations. There is now some
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
cd9b46e5442a3ef17f83f75177d8545cb5b3e2b9 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Add a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove ObjCThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b2f9e516327310d95840d442416084508f80c183 04-Nov-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6339636> clang ObjC rewriter: Assertion failed: FileID-1 < FileIDs.size() && "Invalid FileID!", file c:\cygwin\home\Administrator\llvm\tools\clang\include\clang/Basic/SourceManager.h, line 513



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
15da57e66cade0c2cab752f925e838b22daadafc 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Tweak Sema::CheckReferenceInit so that it (optionally) computes an
ImplicitConversionSequence and, when doing so, following the specific
rules of [over.best.ics].

The computation of the implicit conversion sequences implements C++
[over.ics.ref], but we do not (yet) have ranking for implicit
conversion sequences that use reference binding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
6eec8e883de118b431e3ead5b1e604a6ac68ff6b 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Rename ExplicitCCastExpr to CStyleCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
a5ad8631c963c5d76df18830ac1c226b415903cf 27-Oct-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6315646> clang on xcode: error: invalid operands to binary expression ('id<NSTableViewDelegate>' and 'XCExtendedArrayController *').

There is still a bug here (as the FIXME in the test case indicates). Prior to this patch, the bug would generate an error. Now, we simply do nothing (which is less harmful until we can get it right). The complete bug fix will require changing ASTContext::mergeTypes(), which I'd like to defer for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
418f6c7d142e5ff4607f70cd8431d008442bafe9 27-Oct-2008 Chris Lattner <sabre@nondot.org> Remember whether an initlist had a designator in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
220ad7c8d1adc23799e480faf189332f1eb032e6 27-Oct-2008 Chris Lattner <sabre@nondot.org> pass designators into sema. This completes parser-level designator
support as far as I know.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7fb5e4888221cd36652d078c6b171ac55e7f406d 26-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't give a default argument to ASTContext::getFunctionType for the TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call.
-Remove the default argument.
-Update all call sites of ASTContext::getFunctionType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
971c4fae6092976338b755af1d47dac07c8f16e3 24-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.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/SemaExpr.cpp
c6cb77f1e5c4455edfa9c96bf5a8ef463d4c8d54 24-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix regression in comparison of qualified id; == operator was being
created with LHS and RHS whose types didn't match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8970feab05b96f640a554a309e06d99478ef05fe 23-Oct-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6311947> clang on xcode (regression): error: use of undeclared identifier 'expandedValue'.

Mea culpa: I introduced this regresson in the following 2 commits: r57529 (10/14), r57841 (10/20).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
90b7bc67518a408d397f2400ff6c40e5465b45e4 22-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Now that DeclRefExpr accepts a NamedDecl, use a DeclRefExpr for when a CXXFieldDecl is referenced inside a method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7692ed61098c216ca7d3ce9be744311e8eee90e4 22-Oct-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6257675> error: member reference base type ('NSUserDefaults *') is not a structure or union.

Teach Sema::ActOnMemberReferenceExpr() to look through local category implementations associated with the class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e0a5d5fe8eab573f7764bf6d2ddb02bee8dceaf9 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Move Sema::GetNonReferenceType to QualType::getNonReferenceType and make it inline

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
98cd599ee8a9b259ed7388ee2921a20d97658864 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Initial step toward supporting qualification conversions (C++ 4.4).

Changes:
- Sema::IsQualificationConversion determines whether we have a qualification
conversion.
- Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
performing an implicit conversion from the right-hand side to the type of
the left-hand side rather than checking based on the C notion of
"compatibility". We now rely on the implicit-conversion code to
determine whether the conversion can happen or
not. Sema::TryCopyInitialization has an ugly reference-related
hack to cope with the initialization of references, for now.
- When building DeclRefExprs, strip away the reference type, since
there are no expressions whose type is a reference. We'll need to
do this throughout Sema.
- Expr::isLvalue now permits functions to be lvalues in C++ (but not
in C).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
48d04ae529b023abe5ed825f52a9b96ce01d1496 21-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix use of dyn_cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8e9bebdea69c590dedfbf27374114cb76fe12fbd 21-Oct-2008 Douglas Gregor <dgregor@apple.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
18bc164e649bfc1909102e16d3d99836da65da4a 21-Oct-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6268365> Parser rejects property (dot notation) access on id<protocol>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
87f3b93423062c343a35714517517a52cc9da4a5 20-Oct-2008 Steve Naroff <snaroff@apple.com> Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
639e2d35d9881cefe167efa933e82ced3b0ed681 20-Oct-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6257721 by tightening up the block "snapshot" check, and
move it to its own predicate to make it more clear.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
395790772565002c0ac03f2c8de9b0a6c7adcaf3 15-Oct-2008 Steve Naroff <snaroff@apple.com> Downgrade incompatibilities with objc qualified types (e.g. id <P>) to warnings.
Note: One day, we should consider moving the actual diags to ObjCQualifiedIdTypesAreCompatible(), since it has more information on the actual problem. GCC currently emits slightly more instructive errors for some cases involving protocols. I added a FIXME to the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
090276f5e164d491a1bb3f541bafdb394f5e6f04 10-Oct-2008 Steve Naroff <snaroff@apple.com> Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c90bfcbd7ff5d09694acf50a32dbb716a968b61 08-Oct-2008 Steve Naroff <snaroff@apple.com> Instantiate the BlockDecl in ActOnBlockStart() so we can use it as a DeclContext.
This required changes to attach the compound statement later on (like we do for functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
56ee6896f2efebffb4a2cce5a7610cdf1eddbbbe 08-Oct-2008 Steve Naroff <snaroff@apple.com> - Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.

This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).

Still some follow-up work to finish this (forthcoming).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2a2990473fe999c3680a2342922c14412ded7ddf 30-Sep-2008 Chris Lattner <sabre@nondot.org> simplify padding, just fold it into the earlier resize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
28997ec3a493134a8642891944800ffc1c160bee 30-Sep-2008 Chris Lattner <sabre@nondot.org> fix a potential buffer overrun that Eli noticed


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
abee2d789ce799ce9a5d611e13a1713090f305f3 30-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add diagnostic for .{lo,hi,e,o} on odd-sized extended vectors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b440686eeed95c618ead89011d3814671b13ff6e 29-Sep-2008 Steve Naroff <snaroff@apple.com> Teach Sema::CheckAssignmentConstraints() to allow assignments between id and block pointer types (^{}).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aa5caa17ed34df5e1147d7b2ff447441c906f3da 28-Sep-2008 Steve Naroff <snaroff@apple.com> Change a NOTE to a FIXME based on feedback from clattner.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ae530cfaf65e36fdcecb16d072422eb3d2a4518e 28-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252108> assigning to argument passed to block should not require __block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f7037b1c3be02fdc901862641d93118ea812e5f8 28-Sep-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6251437, references to enum constant decls in a block
don't need a BlockDeclRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
59f5394648e1d86f3df09ce900658199e8bfcb96 28-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252216> compare block to NULL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
538afe30e4f9bfb338171be859d584e201dca2df 28-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252226> parser thinks block argument is undefined identifier in NSServices.m


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4f6a7d7ead09b439216c32f2de806a998aeb222a 26-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak Expr::isModifiableLvalue() and Expr::isLvalue() to better deal with BlockDeclRef exprs.

This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ba80c9abccd97d9771c1dfa1a862e66ddd4daedd 25-Sep-2008 Steve Naroff <snaroff@apple.com> Downgrade incompatible block pointer error to a warning (to be consistent with incompatible pointer warnings in general).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
33ae3afcf893ee0af25401409ba1246d9cee1774 22-Sep-2008 Steve Naroff <snaroff@apple.com> Remove unused slot/reference and update Sema::ActOnIdentifierExpr().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c3c902835ef7d37300463ad47176ec21a67dc8b 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove BlockStmtExpr.
Block literals are now represented by the concrete BlockExpr class.
This is cleanup (removes a FIXME).
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
17dab4f616db7be6800c1f0505f4888d2e8ad7a2 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove support for BlockExprExpr. For example...
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
5e155f0c9bd5916d47a7d99dd8d5b26bdb44d835 12-Sep-2008 Daniel Dunbar <daniel@zuster.org> Iterate on sema for :? in Objective-C:
- Follow C99 behavior of using other operand type when one of
operands is a null pointer constant.
- Fix overenthusiastic devolving of any Objective-C types to id:
o If either operand has an Objective-C object type then:
- If both operands are interfaces and either operand can be
assigned to the other, use that type as the composite type.
- Otherwise, if either type is id, use id as the composite type.
- Otherwise, warn about incompatible types and use id as the
composite type.
- Return handling of qualified idea to separate test following
general pointer type checking.
o Upgraded from old code to allow devolving to id (without warning,
which matches GCC).
- <rdar://problem/6212771>

Add test case for issues fixed above, XFAIL though because it exposed
a new issue in property handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c39a3d76737cce06116145c24f9821857e214e59 11-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow array-to-pointer conversion for rvalues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
61f40a2b67fc2046768e14f66b617e564cbcc3d8 10-Sep-2008 Steve Naroff <snaroff@apple.com> More semantic analysis for blocks...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1f3b0d5ccabbc47aef525baec10c15d9fd1c6236 10-Sep-2008 Steve Naroff <snaroff@apple.com> Sema::ActOnIdentifierExpr(): Lookup block arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
dd972f20dc2bd3609d833893e5c6544ac09b59a9 06-Sep-2008 Steve Naroff <snaroff@apple.com> More type checking for blocks. Still incomplete (will hopefully finish up this weekend).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
39218dfef550ad1cd7b7ece83a715996a113ffd1 04-Sep-2008 Steve Naroff <snaroff@apple.com> Touchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to check for block pointers.
Added a couple FIXME's wrt PointLikeType. If the author reads this, it would be great to get some background on this class (thanks in advance).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1c7d067550c2d9bca8997d0e67ee6b280d493202 04-Sep-2008 Steve Naroff <snaroff@apple.com> Add type checking for blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
4eb206bebcdab28ababe8df55c6185cec2cdc071 03-Sep-2008 Steve Naroff <snaroff@apple.com> Add semantic analysis for "blocks".

Highlights...

- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().

Next steps...

- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
40727a4b43d827319553620fa1183f4bcb346d2d 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Improve type-checking of ?: for Objective-C types.
- Allow any Objective-C object types to devolve to type id in a ?:
expression. This matches gcc behavior more closely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2307d312f779b204468ac36aab3b153e66a853c0 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Restore Objective-C dot-syntax access of methods.
- Now also searches for correct setter method.
- There are still some issues regarding validation of the setter
method and access of read-only properties.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f1c7b48638a3ec78129fee9672ed8e2616e63c9c 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to take the unqualified versions of the canonical types for
type-checking pointer subtraction; if the canonical types aren't used,
the qualifiers won't always get stripped off correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7f8ea5c5b3a6a4332a841eefdd86b0726722ea7b 30-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
favor of just result type and selector. Necessary so it can be
reused in situations where we don't want to cons up an
ObjCMessageExpr.
- Update aggregate binary assignment to know about special property
ref lvalues.
- Add CodeGenFunction::EmitCallArg overload which takes an already
emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a56f7460baf475151e03b1249a1343349328e39c 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> In incompatible pointer-typed ?: expressions, add implicit conversion
of RHSs to id type instead of void* if either has Objective-C object
type.
- This ensures the result can still be used in normal places an
object can be used, like a message send.

Add implicit conversions for ?: applied to qualified id types to
ensure that the RHSs are compatible.
- This prevents a codegen crash (creating invalid PHI nodes).
- Again, this relates to the fact that qualified id types have no
canonical types.
- Note that the implicit type casted to is incorrect, however this
doesn't currently cause problems because of the flexibility of the
id type.

Test cases for above.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3d815e7eb56c25d7ed812eced32e41df43039f9a 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Rewrite type compatibility testing to do type merging rather than just
testing compatibility. This is necessary for some constructs, like merging
redeclarations.

Also, there are some ObjC changes to make sure that
typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any
ObjC code beyond the testsuite, so please tell me if there are any cases
where this doesn't behave as expected.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2c15647dce6de66f673cc64236913732d6289317 21-Aug-2008 Chris Lattner <sabre@nondot.org> add a simple check to warn people who type "=+" when they probably meant
"+=".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
efbe85c8ef4090147b371f616044c72d9b254095 21-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix a regression from my fix to PR2631. Fixes PR2692.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
58d5ebbe72a5ca429c260c908fba1fbdecf32c85 20-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix subtle bug introduced in r54852.
- UsualUnaryConversions takes an Expr *& and may modify its argument,
this broke when it was refactored into Sema::CheckCastTypes. This
meant that we were missing implicit casts in some places.
- Seems pretty sad that this got through our tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0835a3cdeefe714b4959d31127ea155e56393125 19-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):

Expr
-> CastExpr
-> ExplicitCastExpr
-> ImplicitCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6c2dc4d99392042a70dff89ee8cfa9594075709e 16-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the type checking that Sema::ActOnCastExpr does into a new Sema::CheckCastTypes function so that it can be reused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
662e8b5647adbb1bc9eeceece7b64600cfa87471 15-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change Parser & Sema to use interned "super" for comparions.
- Added as private members for each because it is not clear where to
put the common definition. Perhaps the IdentifierInfos all of these
"pseudo-keywords" should be collected into one place (this would
KnownFunctionIDs and Objective-C property IDs, for example).

Remove Token::isNamedIdentifier.
- There isn't a good reason to use strcmp when we have interned
strings, and there isn't a good reason to encourage clients to do
so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ad2018f4cde3607e83d9ebb195a82cb87c98f236 14-Aug-2008 Chris Lattner <sabre@nondot.org> Make diagnostics relating to the callee hilight just the callee
and put the caret on the ()'s. e.g. produces:

t.c:13:9: error: called object is not a function or function pointer
((B)a)();
~~~~~~^

instead of:

t.c:13:3: error: called object is not a function or function pointer
((B)a)();
^~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
acc5f3e42334525bf28c86471551f83dfce222d5 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c4a1dea2dc56bd1357ec91b829a0b9e68229a13e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e4858a65a93fb36c099d8dd2ea0a98e33e77687e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
implementation .cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
76de9d7a32b16246e2acd0d1ecd7355faceb4901 10-Aug-2008 Steve Naroff <snaroff@apple.com> Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
c34bcde8d2aa7430cb2f3abb003d9248842748b8 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2631; make va_arg work correctly on x86-64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
55f4b02bc71e7347986c6a5249bef635aac1901a 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1e76ce6e5f892c89c9958657d44c323fb70f748c 04-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix several issues in checking of address-of expressions.
- clang was erroneously accepting address-of applied to lvalue
expressions involving pointer arithmetic.
- clang was erroneously rejecting address-of applied to deref
expressions of pointer-typed variables.
- Improved existing test case.
- Fixes: <rdar://problem/6113867>, <rdar://problem/6080158>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0ffb125996336fc7602b162c0a9e392f1a93060f 04-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add CodeGen support for indirect goto.
- Follows emission scheme used by llvm-gcc, i.e. invent an id for
each label whose address is taken and replace each indirect goto by
a switch to each possible target.
- Currently we emit a switch for each indirect goto instead of
merging them as llvm-gcc does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c63a1f276f7b324fd9a4be82098b1c8f7bf30733 04-Aug-2008 Chris Lattner <sabre@nondot.org> Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c36d405a02fab41f6c45cb2bc750d64949742903 27-Jul-2008 Chris Lattner <sabre@nondot.org> make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b77792eabf5882cf9af8cc810599b20432fda6c2 27-Jul-2008 Chris Lattner <sabre@nondot.org> change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
28be73f74c9e241a23ea24fe5756623de6bf1084 26-Jul-2008 Chris Lattner <sabre@nondot.org> convert more code to use ASTContext to get canonical types instead
of doing it directly. This is required for PR2189.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
611b2eccaf3869f32de51ecc02985426d1c0aaef 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix some problems handling stmtexprs with labels (PR2374), and
improve 'expression unused' diagnostics for stmtexprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
02a65146aaa1f209013415e9247771805ca2ad5d 26-Jul-2008 Chris Lattner <sabre@nondot.org> GCC supports the complex conjugate operator (an extension) on complex int
as well as complex float. rdar://6097730


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
05faf17d454998ee498bf1a4e75500e32047b19b 26-Jul-2008 Chris Lattner <sabre@nondot.org> move a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
32b62b6c68ba69799cfca560e3d255897f52887e 26-Jul-2008 Chris Lattner <sabre@nondot.org> Fix a couple bugs in aggregate cast processing: 1) fix precedecence
problem with &&/||. 2) use canonical types for comparison instead
of raw types. 3) emit an ext-warn for a gnu extension.

Also simplify the code to make it less nested.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bb280a482bcbb74a10abf1948704a7e51b5f0b4c 25-Jul-2008 Chris Lattner <sabre@nondot.org> make sizeof/alignof diagnostics highlight their operand with a sourcerange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
67d33d8535b53046760ec6c4aa440e4f91df00dd 25-Jul-2008 Chris Lattner <sabre@nondot.org> c89 does not perform array -> pointer promotion unless the array is an lvalue. This
is different than C99. This fixes the rest of rdar://6095180.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e7a2e91ac610dd475962586e41dc52e85c39f1d8 25-Jul-2008 Chris Lattner <sabre@nondot.org> move some code, no other change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
53fcaa9409734b8a41c10894d40267e52175b30a 25-Jul-2008 Chris Lattner <sabre@nondot.org> In c99 mode, comma does do function/array promotion even though
it does not do unary promotions (like short->int).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
080b332959f0a1886c8d0a515f656fe6215a9ce3 25-Jul-2008 Chris Lattner <sabre@nondot.org> Comma does not perform unary promotions, rdar://6095180


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6562fdad21432377f0cc5e0c627c28f0c85df4dd 21-Jul-2008 Chris Lattner <sabre@nondot.org> when in the context of an @implementation, look for private methods in the
@implementation to resolve nullary selector references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2a01b724b69b7998fe4e3a0a6fcc546be01f898d 21-Jul-2008 Chris Lattner <sabre@nondot.org> improve invalid member reference diagnostics to print the type and
have better source ranges. Before:

t.m:11:53: error: member reference is not to a structure or union
CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height;
^~~~~~~

after:

t.m:11:54: error: member reference base type ('id') is not a structure or union
CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9baefc21bfe1bf49ab4a234e9f267f00abe0b1b1 21-Jul-2008 Chris Lattner <sabre@nondot.org> rename getProtocols -> getProtocol, as it only returns a single
protocol. Simplify some code to use unconditional form of the
protocol access list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a38e6b1f00d6e62d7f20a63053db6f77ab39ea36 21-Jul-2008 Chris Lattner <sabre@nondot.org> Fix a bunch of crashes that occur in (attempted) handling of objc properties.
This code would previously crash on x.y where x is 'id'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
123a11f2fd40fc56333ea67b77d4476b0d9339c0 21-Jul-2008 Chris Lattner <sabre@nondot.org> use the simplified form of lookupInstanceVariable for callers who
don't care which class actually defines it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1f719747b214866535e63b0fe2f5f21da67a5387 21-Jul-2008 Chris Lattner <sabre@nondot.org> improve the diagnostic for an erroneous objc ivar reference
from:

t.m:8:7: error: member reference is not to a structure or union
pool->farm = 0;
^ ~~~~
to:

t.m:8:7: error: 'NSAutoreleasePool' has member named 'farm'
pool->farm = 0;
~~~~^ ~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
68a057b4292f5ff814ec8da53f6cda8cdcfbd2ae 21-Jul-2008 Chris Lattner <sabre@nondot.org> simplify a bunch of code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
fb173ecd2dd560f352355e263ac44da19d19ca64 21-Jul-2008 Chris Lattner <sabre@nondot.org> rearrange some code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
be2341d3b8bd34a14e921c58b53abaf79b0b0cb2 14-Jul-2008 Nate Begeman <natebegeman@mac.com> http://llvm.org/bugs/show_bug.cgi?id=2523

Add some code to handle vector comparisons, which is the language side
of the llvm vicmp/vfcmp instructions. Also make the vector-vector and
vector-scalar asign checks a bit more sane under the presence of lax vector
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp
b7cfe88e88cb4f46308de89cf3f0c81bfe624128 30-Jun-2008 Chris Lattner <sabre@nondot.org> Make a few related changes:

1) add a new ASTContext::getFloatTypeSemantics method.
2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places.
3) Change the TargetInfo.h get*Format methods to return their
fltSemantics byref instead of by pointer.
4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which
sometimes expand specially and othertimes fall back to libm.
5) Add support for __builtin_nan("") to codegen, cases that don't pass
in an empty string are currently lowered to libm calls.
6) Fix codegen of __builtin_infl.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ad74a758189180b8ab8faea648e4766c3bfd7fcb 28-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work
correctly. (The testcase in PR2501 uses a comparison between long and
unsigned int).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
53d0ea5f5bfa647ec23418bf3a3b7c183b51e4bd 28-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3cc5e5b5268d7359c818ca5a2b62a339923020c4 28-Jun-2008 Chris Lattner <sabre@nondot.org> Fix a bug where we didn't promote 'const float' (or typedefs) to
double in some places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
c250aae4f645833aed3a6321bc8598f7330dce8d 08-Jun-2008 Chris Lattner <sabre@nondot.org> capture whether a CharacterLiteral was wide or not in the AST.
Patch by Mike Stump!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8f0b10274a0091edc5e1dcec622dc6a3c97f65a8 05-Jun-2008 Steve Naroff <snaroff@apple.com> super fix submitted by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
3d2c22b1d334fa74d26a5f21841cb55df5dfdd1a 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5987482> clang on xcode: null dereference in Sema::ActOnMemberReferenceExpr.

In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>").


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0e72401c647cff2f1fe493fab75ecdccb829d1d1 04-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Make sure the types are consistent for a void conditional. No visible
difference, but it's better to be consistent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d8de725d95cb29db175f6430c5911ff092271f2e 04-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> fix type of ?: operator. If one of the operator is void, the type should be void as well.
Please confirm this is safe

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0a8b4e3f7d246a637fea77327020fbeebf2bab30 03-Jun-2008 Steve Naroff <snaroff@apple.com> Implement another property related FIXME:

Fix <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
053d71c233e54b5199672c068bad7ba3f6ee85bb 03-Jun-2008 Steve Naroff <snaroff@apple.com> Fixup recent "super" regression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
20373221ce82022b7a0d31858af51bebf87e4af1 03-Jun-2008 Steve Naroff <snaroff@apple.com> Allow implicit pointer/int conversions on ObjCQualifiedIdTypes in Sema::CheckCompareOperands() and Sema::CheckAssignmentConstraints().

Fixes <rdar://problem/5980804> clang on xcode: error: incompatible type sending 'id<XDUMLType>', expected 'NSCellType'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0326e045fe143856d1b2fb75ae54689e891bbc0d 03-Jun-2008 Steve Naroff <snaroff@apple.com> Finish up r51900.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
63564b8f8bbe83c236ddf74c257a63fa1341a274 03-Jun-2008 Steve Naroff <snaroff@apple.com> Allow for a GCC cast extension.
Fixes part of <rdar://problem/5980829> clang on xcode: used type 'NSRange' where arithmetic or pointer type is required.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e3e9add4fd788927df6f545570e7838db59c01d7 03-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared identifier 'super'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
aa73eec076a2545671f78cb4e82536ec39f040eb 01-Jun-2008 Steve Naroff <snaroff@apple.com> Teach Sema::CheckConditionalOperands() to check for ObjCQualifiedIdType's. This fixes a bogus error.

<rdar://problem/5967036> clang on xcode: error: incompatible operand types ('id<DTOutputStreams>' and 'DTFilterOutputStream *')


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f8f873deef78de611dd793a1e1201bef0d5a54a3 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to allow assigning a pointer to a bool.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
ae7840776d6cd31b4d7a4a345b61bcbb3744df6c 30-May-2008 Steve Naroff <snaroff@apple.com> Add basic support for properties references (a missing feature).

While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f494b579b22f9950f5af021f0bf9879a91bb8b41 29-May-2008 Steve Naroff <snaroff@apple.com> - Move ObjC Expresssion AST's from Expr.h => ExprObjC.h
- #include ExprObjC.h in many places


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8ef1f26775cae95d202d8d90d92d39add685af3e 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Get the type right for wide string literals; it's wchar_t, not char.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
6223c2237052dc99cc5263d4cf20cb0bff7650cd 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Add some more checking for compound literals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d72d16e6f105deb6fe890225a6251dd0e9001ce7 18-May-2008 Eli Friedman <eli.friedman@gmail.com> Add proper type-checking for pointer additiion; before, we were accepting
addition with a pointer and an integer even when it didn't make sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5835ea2118560258ab7ee6c6dbbca30b57c58b10 16-May-2008 Eli Friedman <eli.friedman@gmail.com> Sema-based fix for PR2334. The issue is that even if the two sides of
the condidtional have compatible types, they are not necessarily the
same type. Therefore, we cast to the composite type. As a hack, for
the moment we assume that the composite type is the type of the
left-hand expression; this isn't correct, but it's good enough for most
purposes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d38617c8a50f9729c254ab76cd359af797c6739b 14-May-2008 Eli Friedman <eli.friedman@gmail.com> Implementation of __builtin_shufflevector, a portable builtin capable of
expressing the full flexibility of the LLVM shufflevector instruction.
The expected immediate usage is in *mmintrin.h, so that they don't
depend on the mess of gcc-inherited (and not completely implemented)
shuffle builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
5773a6c4ab5a3a7aa9f089bfde3ca1c99ea674ac 13-May-2008 Eli Friedman <eli.friedman@gmail.com> Both operands to && have to be scalars, not just one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e701c0a953d05c3403a74fdb449a8f4a1e4e6594 12-May-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8a99764f9b778a54e7440b1ee06a1e48f25d76d8 09-May-2008 Nate Begeman <natebegeman@mac.com> Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.

Remove some unnecessary methods/types in the ExtVectorElementExpr class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8cbcb0ed56b307339f27c6e7daf3444294d332f2 09-May-2008 Chris Lattner <sabre@nondot.org> simplify some code, don't assume that sizeof(long) < sizeof(long long).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
2d1c5d313cd0c229cc614e74baa4c5756a4b46f4 27-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parsing of namespaces:

-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d6595fa87cd031dab36c6dbb723ae19e822ab2aa 19-Apr-2008 Nate Begeman <natebegeman@mac.com> Ignore qualifiers when attempting to match arguments to parameter types for
__builtin_overload



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
213541a68a3e137d11d2cefb612c6cdb410d7e8e 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8123a95c33b792d35c2e4992ba6e27882748fb0d 10-Apr-2008 Chris Lattner <sabre@nondot.org> Several improvements from Doug Gregor related to default
argument handling. I'll fix up the c89 (void) thing next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
04421087832a031c90bd58f128c7c0e741db8dd2 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8f8fc7bdb6f42ce31d46596d4c0660625773cbef 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify reference handling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
78eca286b0898e98bb2cee943b4ecbea9cc07dd6 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify compatibility testing for tag types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
eca7be6b7ebd93682eeaab2c71d59f2995dacdcc 07-Apr-2008 Chris Lattner <sabre@nondot.org> move ObjCQualifiedIdTypesAreCompatible out of ASTContext into Sema.
While it is similar to the other compatibility predicates in ASTContext,
it is not used by them and is different.

In addition, greatly simplify ObjCQualifiedIdTypesAreCompatible and
fix some canonical type bugs. Also, simplify my Type::getAsObjC* methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
7cfeb08f2466d6263ec6ff1402298f93f6d6991f 07-Apr-2008 Chris Lattner <sabre@nondot.org> simplify max type computation by making it return an integer (like
getFloatingTypeOrder) instead of a type. Fix a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
a75cea3f6be0daa8054d36af81a6ffda1713f82d 07-Apr-2008 Chris Lattner <sabre@nondot.org> minor simplifications/cleanups to type comparisons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
1330b0e6e4a6ad2d586c4a45d6cece5611829a16 04-Apr-2008 Nate Begeman <natebegeman@mac.com> Ignore qualifiers when checking vector operands, just like scalar operands.
This prevents things like
a += b[0]; where a is a float4 and b is a float4 * (address_space 1)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
bc896f58c714e765bedb8cf1390321128c011f17 03-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a bug where we didn't check the RHS for null, we checked
the LHS for null twice.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
423a3c9c2719fb75133673e72ac881719df45daf 02-Apr-2008 Chris Lattner <sabre@nondot.org> simplify some code by using PointerLikeType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
b327ce02959d4e6224732e1c362e7f8e0688581f 02-Apr-2008 Steve Naroff <snaroff@apple.com> Two changes to Sema::LookupDecl() interface.
(1) Remove IdLoc (it's never used).
(2) Add a bool to enable/disable lazy builtin creaation (defaults to true).

This enables us to use LookupDecl() in Sema::isTypeName(), which is also part of this commit.

To make this work, I changed isTypeName() to be a non-const member function. I'm not happy with this, however I fiddled with making LookupDecl() and friends const and it got ugly pretty quickly. We can certainly add it back if/when someone has time to fiddle with it. For now, I thought this simplification was more important than retaining the const-ness.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
d805bec0fbb98aa10abbb41bfdcb2e2fab1bac96 02-Apr-2008 Chris Lattner <sabre@nondot.org> Various parts of the standard require something to be an "incomplete or
object type". Add a predicate that checks exactly this, as it is equivalent
to checking ot see if the type is *not* a function type, which is faster
to check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e6327747b72bb687c948270f702ff53c30f411a6 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix several bugs in array -> pointer decomposition.

First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.

Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.

Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").

This adds an ASTContext::getArrayDecayedType member that handles the
non-trivial logic for this seemingly simple operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
f0467b39b516b389bf078cc4530f2683f16a42ef 02-Apr-2008 Chris Lattner <sabre@nondot.org> rename some variables, fix 80 col violation. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
e8043c39176e7f253fbd92982b077eca6bf2fd59 02-Apr-2008 Steve Naroff <snaroff@apple.com> Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).

- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.

Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
8a934233d1582b5bde9d270bc0705aa81e471a79 31-Mar-2008 Chris Lattner <sabre@nondot.org> rename Decl::CompatibleAlias -> ObjCCompatibleAlias.

Fix objc ivar lookup. Ivar lookup should occur between lookup
of method-local values and lookup of globals. Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.

Two todo's left:
1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
in the AST. This is a hack.
2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
not correctly handle typedefs and enum constants yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
0d755ad7d8650dc52eeff25cc3f5bb1a2c93483d 20-Mar-2008 Steve Naroff <snaroff@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.cpp
9c167115e9089d46266ba2eacf79693b1ca1c036 17-Mar-2008 Nate Begeman <natebegeman@mac.com> Check in a couple fixes for vector extensions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaExpr.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/SemaExpr.cpp