History log of /external/clang/lib/Sema/SemaInit.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
33337ca4d89605025818daf83390ab4271d598d9 06-May-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r235153

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

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

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

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

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

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

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

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
2ca3db4876207a0f2d9ed683b0d3b6f3193f39bc 22-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195384:
------------------------------------------------------------------------
r195384 | rsmith | 2013-11-21 15:30:57 -0800 (Thu, 21 Nov 2013) | 2 lines

PR18013: Don't assert diagnosing a bad std::initializer_list construction.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3347b497157d36cf280d1d9f52956faa6e702f34 12-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Rather than duplicating extension diagnostics to allow them to cause a
substitution failure, allow a flag to be set on the Diagnostic object,
to mark it as 'causes substitution failure'.

Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior
rather than a bunch of flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2f8b0cc5fa808368a4f84806a60a1254b772caea 08-Nov-2013 Douglas Gregor <dgregor@apple.com> s/DebugPrint/dump/g

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4e49952712ff9b1b1696cb07580b2b24a3ca99e1 03-Oct-2013 Matthew Curtis <mcurtis@codeaurora.org> Gracefully (and correctly) handle init of multiple union members

We now emit warnings when doing so and code generation is consistent
with GCC. Note that the C99 spec is unclear as to the precise
behavior.

See also ...
Bug:
http://llvm.org/bugs/show_bug.cgi?id=16644 and

cfe-dev discussion:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b390e49da4f140fab12732a1c99f4074f5f351a2 21-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17295: Do not allow explicit conversion functions to be used in cases where
an additional conversion (other than a qualification conversion) would be
required after the explicit conversion.

Conversely, do allow explicit conversion functions to be used when initializing
a temporary for a reference binding in direct-list-initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
867521c64254727a37bc9e50fa1045ef3c3b647d 21-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Some comment updates and tweaks for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
13b228dacb6154d8b48d2f3a51e4e078fa7a7b9e 21-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Rearrange narrowing checks in initialization to be a different form of step
rather than a post-processing action, so we can support inserting these checks
at stages other than the end of the initialization. No functionality change
intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b9bf312dabcc6ba29a9dd92f17bc0130ee12cb62 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor: CheckExplicitInitList is only called to check an entire InitListExpr,
so the Index in/out parameters are pointless (always passed in as 0, always
ignored by the caller).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
08f0bbc4d46daf1b66035b66f6ef497aedf59a42 17-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Don't build extra init lists.

AssignConvertType::IncompatibleVectors means the two types are in fact
compatible. :)

No testcase; I don't think the extra init list has any actual visible effect
other than making the resulting AST dump look a bit strange.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
14dcaa92eeff0fb1de5a36f90c8c0f2d01d126a3 07-Sep-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed bug in call to CXXTemporaryObjectExpr ctor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1245a54ca6e9c5b14196461dc3f84b24ea6594b1 07-Sep-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fix missing source location in CXXTemporaryObjectExpr nodes.
For clarity, renamed (get/set)ParenRange as (get/set)ParenOrBraceRange
in CXXConstructExpr nodes.
Added testcase.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
48a2a3a6ec7a168abdb1e0116bceeac578c132ea 20-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Handle init lists and _Atomic fields.

Fixes PR16931.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
4c7736ec76fb35fe83eb4144137cf14df1c6d056 24-Jul-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Minor const fixups and control flow tidying.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f5200d6865fc5867ee022f876d2cdee94b48b1ee 11-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> Restore warning to its original text when
certain familiy of methods have the wrong type.
// rdar://14408244


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f92a509d870f05a0e26babd8072171957770649e 11-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC arc[qoi]: When due to change of certain methods'
result type, a diagnostic being issued, issue a 'note'
mentioning reason behind the unexpected warning.
// rdar://14121570.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
3c3af140263c3761665aa2c0aac4266115f5caf1 01-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16502: Fix a dumb bug where we might look past the last initializer in an
InitListExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
5771aab8027e317de1e3f2f67b5dae67b3d895f8 28-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix nested lifetime extension when a std::initializer_list member is
initialized during aggregate initialization of the surrounding structure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
288f76ad86d5de6433eef097a1a5caff0c922e85 27-Jun-2013 Larisse Voufo <lvoufo@google.com> A bit of program simplification from r185056

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7419d013fd2c4dda596066f4864d5c40e85ba330 27-Jun-2013 Larisse Voufo <lvoufo@google.com> Fix a conversion to incomplete type bug -- The error message now specifically states that the type is incomplete and points to the forward declaration of the incomplete type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
87c29321c4b819d8a10f362f42fb7f7226820041 20-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add a workaround for a libstdc++-4.2 <tr1/hashtable> bug. This header uses

return false;

in a function returning a pointer. 'false' was a null pointer constant in C++98
but is not in C++11. Punch a very small hole in the initialization rules in
C++11 mode to allow this specific case in system headers.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d6b698739ab157348acafcec5b06a05d3d35377d 15-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16263: Implement current direction of core issue 1376. Binding a reference to
the result of a cast-to-reference-type lifetime-extends the object to which the
reference inside the cast binds.

This requires us to look for subobject adjustments on both the inside and the
outside of the MaterializeTemporaryExpr when looking for a temporary to
lifetime-extend (which we also need for core issue 616, and possibly 1213).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4e47ecb6b2e399d2a7cc3a91d1eab9e501c5580f 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> When copy-initializing a temporary for a reference binding, don't allow use of
explicit constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7c3e615f01e8f9f587315800fdaf2305ed824568 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR12086, PR15117

Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).

This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a4bb99cd0055ba0e1f3107890e5b6cbe31e6d1cc 12-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Move detection of reference members binding to temporaries from building of
CXXCtorInitializers to the point where we perform the questionable lifetime
extension. This exposed a selection of false negatives in the warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8a07cd3f59a0ede54906bdc8ed21724815db27ad 12-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Reapply r183721, reverted in r183776, with a fix for a bug in the former (we
were lacking ExprWithCleanups nodes in some cases where the new approach to
lifetime extension needed them).

Original commit message:

Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
81359b0a88510087a873de771f9a2f5ee7ed97d9 12-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Tweak r183791 so we don't print a note without a source location.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
188ddb14a82792f2d9405706ae38fccb79a066fd 11-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Correctly handle designated initializers which modify an array initialized
with a string. This case is sort of tricky because we can't modify the
StringLiteral used to represent such initializers.
We are forced to decompose the string into individual characters.

Fixes <rdar://problem/10465114>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a57be5617a0735a654d4c8145be1fd752f776772 11-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r183721. It caused cleanups to be delayed too long in some cases.
Testcase to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
85af7cecadbf5d4b905d6b3b4b1b6fa684183aff 11-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b6e3808bfe385da8d90bb431e41e30d721d5433f 08-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Recursively lifetime-extend into array temporaries. These can get implicitly
created through binding a reference-to-array to an initializer list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
40cba90626044ff28b58c33e743366e94c898227 06-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1270: braces can be elided in all aggregate initialization, not
just copy-list-initialization in a variable declaration. This effectively
reverts r142147.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6f773e87eeb2ca04f86b1dcb98683887dfbe1ffa 05-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Silence GCC warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
6242a45ca50586ed3f363d4ac7422e07092e4d96 31-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix handling of braced-init-list as reference initializer within aggregate
initialization. Previously we would incorrectly require an extra set of braces
around such initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2c2f09ec4842be9933f803b1ec9488b62afc9f5c 24-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash-on-invalid if list-initialization works, but we bail out when
building the resulting expression because it invokes a deleted constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c1fb1e0b79cf2762896e57e43f51da5fedd88d77 16-May-2013 Hans Wennborg <hans@hanshq.net> SemaInit.cpp: give both IsStringInit() functions the same return type.

This addresses Richard's comment on r181880.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0ff5074f37a66bca244a9d5d0da050ff68693ce2 15-May-2013 Hans Wennborg <hans@hanshq.net> Better diagnostics for string initialization.

This commit improves Clang's diagnostics for string initialization.
Where it would previously say:

/tmp/a.c:3:9: error: array initializer must be an initializer list
wchar_t s[] = "Hi";
^
/tmp/a.c:4:6: error: array initializer must be an initializer list or string literal
char t[] = L"Hi";
^

It will now say

/tmp/a.c:3:9: error: initializing wide char array with non-wide string literal
wchar_t s[] = "Hi";
^
/tmp/a.c:4:6: error: initializing char array with wide string literal
char t[] = L"Hi";
^

As a bonus, it also fixes the fact that Clang would previously reject
this valid C11 code:

char16_t s[] = u"hi";
char32_t t[] = U"hi";

because it would only recognize the built-in types for char16_t and
char32_t, which do not exist in C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
27f9cf3a5a92f70f043b6cfbc5f3f2ac3a38f182 06-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert if __extension__ or _Generic is used when initializing a char array from a string literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
30ae1ed71dc99a396b7ddba9cabe9846a0c4449d 05-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Handle parens properly when initializing a char array from a string literal.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
bebf5b1bcfbf591dd3cd80c4aebd6486bb34f41c 26-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: support simple variable assignments in constexpr functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c3bf52ced9652f555aa0767bb822ec4c64546212 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Allow aggregates to have default initializers.

Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in
CXXCtorInitializers and in InitListExprs to represent a default initializer.

There's an additional complication here: because the default initializer can
refer to the initialized object via its 'this' pointer, we need to make sure
that 'this' points to the right thing within the evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
1fd1e288d0f45b86d191d8f53f569e5143f3a18a 11-Apr-2013 Jordan Rose <jordan_rose@apple.com> Force a load when creating a reference to a temporary copied from a bitfield.

For this source:
const int &ref = someStruct.bitfield;

We used to generate this AST:

DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'const int' lvalue <NoOp>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Notice the lvalue inside the MaterializeTemporaryExpr, which is very
confusing (and caused an assertion to fire in the analyzer - PR15694).

We now generate this:

DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'int' <LValueToRValue>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Which makes a lot more sense. This allows us to remove code in both
CodeGen and AST that hacked around this special case.

The commit also makes Clang accept this (legal) C++11 code:

int &&ref = std::move(someStruct).bitfield

PR15694 / <rdar://problem/13600396>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
defa32ef4fdc166d39d2d0859e5edbd78da2ddd0 27-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13278115> Improve diagnostic when failing to bind an rvalue reference to an lvalue of compatible type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6c5aaed0d4faf9ab8793423529306e7116e9f0fd 26-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13395022> Strip references when extracting an initializer_list's element type during application of an initialization sequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
a574c8909748fc0d2fd723a48334d6d2c72c8227 15-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Make helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
21f18c4fda167dc5f72feddbd6a7ac1b63200a0d 07-Feb-2013 Guy Benyei <guy.benyei@intel.com> Add OpenCL samplers as Clang builtin types and check sampler related restrictions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
802e22682c17c4a9df3f747abd224db38e382e39 02-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't forget to run destructors when we create an array temporary of class type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
25cf8abf30189323199b1424848b105940267c1b 26-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add a
testcase for a situation it caused us to miss.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e6b9d802fb7b16d93474c4f1c179ab36202e8a8b 20-Jan-2013 Guy Benyei <guy.benyei@intel.com> Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
02d65ee373feb1cb029185aa0de04d0c214eda3d 15-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash when binding a reference to a temporary pointer created from
resolving an overloaded function reference within an initializer list.
Previously we would try to resolve the overloaded function reference without
first stripping off the InitListExpr wrapper.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
193649c2a3ff0616777de934a2bf47eaeb4f1076 12-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Only produce one -Wc++98-compat warning when initializing a reference from an init list with multiple elements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
774d8b4679ce1317da0f18336c3d27bdb11e5f63 08-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14838: When a member reference is bound to a temporary, don't forget to
perform the semantic checks associated with the destruction of that temporary.
It'll be destroyed at the end of the constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
65d78312ce026092cb6e7b1d4d06f05e18d02aa0 25-Dec-2012 Erik Verbruggen <erikjv@me.com> Fix for PR12222.

Changed getLocStart() and getLocEnd() to be required for Stmts, and make
getSourceRange() optional. The default implementation for getSourceRange()
is build the range by calling getLocStart() and getLocEnd().



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

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


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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d5bc867f6597ee8d4eb31ea217934e436fc7c7e3 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++03 [dcl.init]p5's checking for value-initialization of references
properly, rather than faking it up by pretending that a reference member makes
the default constructor non-trivial. That leads to rejects-valids when putting
such types inside unions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
e5411b7c9af683dab6b035825b71c284bfec364d 01-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
8682b93b3491facc9a42eb87b78bb9d8c18a0739 13-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Copy the decls returned by DeclContext::lookup_result to a
new container so we can safely iterate over them.

The container holding the lookup decls can under certain conditions
be changed while iterating (e.g. because of deserialization).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3d5cf5e0483f538c27016ef3e064536058d5605e 18-Oct-2012 David Blaikie <dblaikie@gmail.com> PR14021: Copy lookup results to ensure safe iteration.

Within the body of the loop the underlying map may be modified via

Sema::AddOverloadCandidate
-> Sema::CompareReferenceRelationship
-> Sema::RequireCompleteType

to avoid the use of invalid iterators the sequence is copied first.

A reliable, though large, test case is available - it will be reduced and
committed shortly.

Patch by Robert Muth. Review by myself, Nico Weber, and Rafael Espindola.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6678a05ba19c40d60ed68b37262942eb887be217 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Tests for DR1507.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
bd2f1f0dd5ea823e929d334130eb214f802489a5 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update comment to match DR1502.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
568f785a76e0a21de20932abf09ce7653e651f92 01-Oct-2012 Richard Trieu <rtrieu@google.com> Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it.
-Remove the special conditions in HandleExpr()
-Move the code so that only one call site is needed.
-Removed the function from Sema and only call it locally.
-Warn on potentially evaluated reference variables, not just casts to r-values.
-Update tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
72ab27732ea7a42d756a1e79727f86fbe391b42b 28-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> When processing an InitListExpr and skipping the initialization of an invalid
record, skip at least one element from the InitListExpr to avoid an infinite
loop if we're initializing an array of unknown bound.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b22b0a53849dbb79da221fcc4671125ad49cb848 11-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the null check outside of the loop, no functionality change.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
70517ca5c07c4b41ff8662b94ee22047b0299f8c 23-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix a bunch of -Wdocumentation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
65263b4ec184212155c92740ab0bd363bb85c49e 04-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify code, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
5121781d756e7814168b4255a57545d5ca497ec3 01-Aug-2012 Aaron Ballman <aaron@aaronballman.com> Explicitly defaulted constructors cannot be used for default initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3c394c54511b27be0ff6968f159bba3521ab3c3e 01-Aug-2012 Douglas Gregor <dgregor@apple.com> When testing whether we can perform copy or move initialization, be
sure to supply an initialization location. Fixes <rdar://problem/11951661>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
20599392a99956eaac4cf351a0935574090cb6c3 07-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12670: Support for initializing an array of non-aggregate class type from an
initializer list. Patch by Olivier Goffart, with extra testcases by Meador Inge
and Daniel Lunow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f4bb8d06c4f1665f89a9e9ddd61f2a2d26904da0 05-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13273: When performing list-initialization with an empty initializer list,
actually perform value initialization rather than trying to fake it with a call
to the default constructor. Fixes various bugs related to the previously-missing
zero-initialization in this case.

I've also moved this and the other list initialization 'special case' from
TryConstructorInitialization into TryListInitialization where they belong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1dfbd92c83699820bfaa352e83083124e34fc9dc 14-Jun-2012 James Dennett <jdennett@google.com> Still more Doxygen documentation fixes:
* Escape #, < and @ symbols where Doxygen would try to interpret them;
* Fix several function param documentation where names had got out of sync;
* Delete param documentation referring to parameters that no longer exist.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
d079abfb5eefaf7da232e39a6564f561402cf4fe 07-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> A union can have a constexpr defaulted default constructor, if it has an
in-class initializer for one of its fields. Value-initialization of such
a type should use the in-class initializer!

The former was just a bug, the latter is a (reported) standard defect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
03544fccd1782418c1bf2528111683e18f43b913 19-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add missing -Wc++98-compat warnings for initializer list initializations which
initialize references, create std::initializer_list objects, or call constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
69a30b838c723cb1850de55cfa48a402cfeeb6e0 10-Apr-2012 Douglas Gregor <dgregor@apple.com> When we determine that an initialization sequence failed due to an
incomplete type, keep track of the actual type that was
incomplete. Otherwise, we might fail to produce a diagnostic. Fixes
PR12498.


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a9b55a499a8b5ae0c4b373f751ef62af74ec494e 04-Apr-2012 Douglas Gregor <dgregor@apple.com> Dependent-sequence initialization of a single element can be direct
list-initialization. Loosen an over-eager assertion to fix PR12453.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e7d0bbfa101d0f0b955c04c417b5e3283497a7ed 02-Apr-2012 Matt Beaumont-Gay <matthewbg@google.com> Silence -Wunused-variable in -Asserts build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
70e24fccc8ef4aa8be03a778e9655bfcfa79dd14 01-Apr-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Properly handle explicit constructors in list-initialization. Fixes PR12120.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
f602806965531ee06fd8664b9d7a8912c4af2870 24-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Teach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix up
some calling code to actually pass in a non-null type, to avoid a crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
188158db29f50443b6e412f2a40c800b2669c957 08-Mar-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Turn explicit construction of temporaries using initializer list syntax into CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cbf82092cdb9e3a2e8528384c878f2084a14981c 07-Mar-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Be smarter in discovering list-initialization of temporaries. Fixes PR12182.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
51ad9cd0644c9acf442f049aed98b66f7b1041a2 29-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Tentatively fix PR12117. The test case from the bug now passes, and all existing tests still pass, but there may still be corner cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
28e4702a1f978213ff945fe4369e3be7444bf320 24-Feb-2012 Matt Beaumont-Gay <matthewbg@google.com> Sink variable into assert

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
5d86f61b9c54429fc3f9149fc0f7009010a644a1 24-Feb-2012 Douglas Gregor <dgregor@apple.com> Kill a spurious use of hasTrivialDefaultConstructor()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a789416a497b2e14e7c2fd721d03e541120bac8d 23-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace the std::map in the init list checker with a DenseMap to reduce malloc thrashing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
5c89c399ba0a171e3312a74e008d61d174d961f3 23-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Try to handle qualifiers more consistently for array InitListExprs. Fixes <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent.

(I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
bac5cf4110c1c9ba0992fad4fd9f66cedc27f3da 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Add a testcase for using objects with list-constructors, and fix a Sema crash by repeating an old hack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d2231c9424d6cbbcecb6f89cc2de5b987327aeaa 19-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a crash for nested initializer list initialization. Still does the wrong thing in CodeGen, in that it never destructs anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
32cf1f27ae8620e7b79bb4e81a067187c0aab7ae 17-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Basic code generation support for std::initializer_list.

We now generate temporary arrays to back std::initializer_list objects
initialized with braces. The initializer_list is then made to point at
the array. We support both ptr+size and start+end forms, although
the latter is untested.

Array lifetime is correct for temporary std::initializer_lists (e.g.
call arguments) and local variables. It is untested for new expressions
and member initializers.

Things left to do:
Massively increase the amount of testing. I need to write tests for
start+end init lists, temporary objects created as a side effect of
initializing init list objects, new expressions, member initialization,
creation of temporary objects (e.g. std::vector) for initializer lists,
and probably more.
Get lifetime "right" for member initializers and new expressions. Not
that either are very useful.
Implement list-initialization of array new expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0f163e964289bc18e9bc1ec37a6a01018ba62640 15-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support GCC's bug^Wextension allowing class array members to be initalized by a
parenthesized braced-init-list in the base/member initialization list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e4e68d45f89ff4899d30cbd196603d09b7fbc150 15-Feb-2012 Douglas Gregor <dgregor@apple.com> When overload resolution picks an implicitly-deleted special member
function, provide a specialized diagnostic that indicates the kind of
special member function (default constructor, copy assignment
operator, etc.) and that it was implicitly deleted. Add a hook where
we can provide more detailed information later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
1d0c9a8d0573d1f670f484cc17aa94f06be971a5 14-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11650: Implement resolution of core issue 1301. Value initialization can't be
used to construct an object of union type with a deleted default constructor
(plus fixes for some related value-initialization corner cases).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
168319c81b8f4e7addf36ad15ef24919faf23504 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Employ DirectList initialized entities to properly sort through some initialization edge cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
f2e4dfcd325db2c1a960697be2c750f277dcafce 11-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement core issue 5: a temporary created for copy-initialization has a
cv-unqualified type. This is essential in order to allow move-only objects of
const-qualified types to be copy-initialized via a converting constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3e78b19e51034dd27c6e0d811522148345e299e4 09-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Switching to using dyn_cast_or_null, and fixing line endings in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0ca7e8bf904d1c2cf70d271f3a06c1d71ff7e4fb 09-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Attempting to initialize a union member that does not exist no longer crashes.

Patch by Remi Gacogne

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
6cd03dbb310f472b14b8d6d69d8c9b5b7f1200e2 04-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> A useful approximation of initializer list constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
96715b288060c8e168cbca62f366c12e88c5483d 04-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Factor out the actual overload resolution from TryConstructorInitialization, since it needs to be used again for list constructor resolution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
08ae369fbe870cfb5077fbd1c652836b8dbeab8b 04-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Don't unwrap initializer lists before calling TryConstructorInitialization, instead doing a little more work inside. This should make finding initializer list constructors easier, as well as fix one place where the ({}) vs {} issue was probably poorly handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8fe83e1df954d72c0f4ffc15d20a5222ec151c21 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move a method from IdentifierTable.h out of line and remove the SmallString include.

Fix all the transitive include users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
f3c82c5f5c0321babf054983c29ad84cc90244f7 23-Jan-2012 Douglas Gregor <dgregor@apple.com> Downgrade C++11 narrowing conversion errors to warnings default-mapped
to an error, so that users can turn them off if necessary. Note that
this does *not* change the behavior of in a SFINAE context, where we
still flag an error even if the warning is disabled. This matches
GCC's behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8ef7b203332b0c8d65876a1f5e6d1db4e6f40e4b 19-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: converted constant expression handling for enumerator values, case
values and non-type template arguments of integral and enumeration types.

This change causes some legal C++98 code to no longer compile in C++11 mode, by
enforcing the C++11 rule that narrowing integral conversions are not permitted
in the final implicit conversion sequence for the above cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4c3fc9b38d3723f73e4ded594cebf38c76f91d93 18-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Move narrowing conversion detection code from SemaInit to SemaOverload, ready
for it to be used in converted constant expression checking, and fix a couple
of issues:
- Conversion operators implicitly invoked prior to the narrowing conversion
were not being correctly handled when determining whether a constant value
was narrowed.
- For conversions from floating-point to integral types, the diagnostic text
incorrectly always claimed that the source expression was not a constant
expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2b916b8b55aaf0152ab9ad630c8454bf6373b085 17-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Sema support for initialization of std::initializer_list from initializer lists.

This does not yet support CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9fdefb338ead088dd7a5dd4ff3df807586b26d41 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Re-add an over-zealously removed break.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
425d631082699b37624a7b1d6abb87c7abd5abe6 12-Jan-2012 Kaelyn Uhrain <rikka@google.com> Convert SemaInit.cpp to pass a callback object to CorrectTypo.

And once again improve the typo correction results in certain
situations just by moving the existing checks on the correction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
73076431605556fdbf28d287d084a73a24a8b8d4 05-Jan-2012 John McCall <rjmccall@apple.com> The value of a const weak variable is not an integer constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d7c56e1114bfe7d461786903bb720d2c6efc05a1 29-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b0c6c33c3479d2cb4c3b9f5a6e58c58d07c731e7 22-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Fix build under -Wswitch by adding support for FK_ListConstructorOverloadFailed
to initialization sequence dumping.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cf15cef8447e8b3ae08e81ad25ae9eb443038acf 22-Dec-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Overloading for initializer list construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
10f04a6267eb07d3be00db1fd0369e1398f5d0a8 22-Dec-2011 Sebastian Redl <sebastian.redl@getdesigned.at> List-initialization via constructor part 1. Still needs: pretty-printing, overloading, initializer_list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b6f8d28411955bc5349217a657ad5f274f72293a 20-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Revert r146766, and add a testcase for which it introduced a wrong-code bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8a93d27a507d9c455eb802a29dc572aa8577393a 16-Dec-2011 Nicola Gigante <nicola.gigante@gmail.com> Fix an inconsistency in the syntactic form of InitListExpr in case of initialization that involves a ConstructorConversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
08d6e032a2a0a8656d12b3b7b93942987bb12eb7 16-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


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

Original commit message:

Removed useless ImplicitCast nodes in explicit cstyle and static casts


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
13dc8f98f6108dca8aaa9721567ed5a2d9911e0f 27-Nov-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reference initialization with initializer lists.

This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
22c107b2b99887b5aec6d1fd38210031e944e31f 19-Nov-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed HadMultipleCandidates loading.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
65bfd682010f599a9a04fc7523e95e28c27508ba 13-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> When reference binding array rvalues, such as those created by compound
literals of array type, materialise a temporary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
21f77cd0c3da8a1dbaf6245cae43baf4c0b80ea4 22-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try to set the "array filler" in a InitListExpr twice.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
83da2e711902c4c54f5601c9000d646dfff06aea 19-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> -Wc++98-compat: diagnose if a reference is bound to a prvalue which does not
have an unambiguous accessible copying constructor; this is ill-formed in C++98.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
c223518ebf72e1709dc8938cd9384161ea5ec0bb 16-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Diagnose when omitting braces in direct list-initialization in C++0x.

This also applies to C99-style aggregate literals, should they be used in C++11, since they are effectively identical to constructor call list-initialization syntax.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3ff5c86d409a55d0e64a28c07197ee3e791166c2 16-Oct-2011 Sebastian Redl <sebastian.redl@getdesigned.at> In the verify-only pass, check that items that don't have an initializer in an init list can be value-initialized, at least when designated initializers are not involved. No test case yet, since early failures cannot be distinguished from late failures until overload resolution works.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
d61db33331c264d6361283602b248a7423040597 10-Oct-2011 Douglas Gregor <dgregor@apple.com> Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
85035647bc4e6cc38cc399a7d30f9a8857f345fa 09-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Initialize the HadMultipleCandidates flag.

Found by valgrind.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
118c6c0dd659d34af2ab17a126f45c1e3e02e94a 04-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Remove a nonsensical bit of code from InitListChecker::getStructuredSubobjectInit which was increasing the reserved size for an init list past its maximum possible size. Fixes PR11056, a case where we were reserving a bunch of memory for arrays that was never actually used.

(No testcase because I don't think we have any way to actually write a testcase for this; the chosen value of NumElements has no effects on anything other than performance and memory usage.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
104be6fc8de206c9b79b241b36ebaf9407b3be08 27-Sep-2011 Eli Friedman <eli.friedman@gmail.com> PR11009: Fix a FIXME which was leading to an assertion failure with rvalue references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8a5d929268beeb69b654120fb0b4f8893ad230eb 26-Sep-2011 Eli Friedman <eli.friedman@gmail.com> CheckStringInit has side effects; make sure we don't run it in VerifyOnly mode, at least for the moment. <rdar://problem/10185490>.

Sebastian, please take a look at this; I'm not entirely sure it is the right thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a4e20e1e43df39e39328035c84c46fdcbbf3a01e 26-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Fix a typo in the new VerifyOnly handling in SemaInit. No visible difference at the moment, as far as I can tell.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a41ee4921f0b42861cbb795752919ee3eddaf143 25-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Add a missing increment to avoid infinite looping in the regression test.

Also make sure we set the error flag when correcting a typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cea8d966f826554f0679595e9371e314e8dbc1cf 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Treat list-initialization of scalars as a first-class citizen in C++11.
Allow empty initializer lists for scalars, which mean value-initialization.
Constant evaluation for single-element and empty initializer lists for scalars.
Codegen for empty initializer lists for scalars.
Test case comes in next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
8713d4e874f2adc2928ebfb86c845574a14e3b3e 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> In Initialization, add step kind SK_ListConstructorCall (list-initialization
resolves to a constructor call in C++11) and failure kind
FK_ListInitializationFailed (early InitListChecker run failed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b0edea9f03cf81227fa35513802f8f146f65c528 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Inline Sema::CheckInitList into its only user.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
5d3d41d0873d51b405972baf38e1f3a7ef5b49e0 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Fix typos and non-doxygen-ness in a few comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
0c706c29f20b6fa36759fa41333b9c3ec0bd2969 20-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Add list initialization for complex numbers in C. Essentially, this allows "_Complex float x = {1.0f, 2.0f};". See changes to docs/LanguageExtensions.html for a longer description.

<rdar://problem/9397672>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
898267f67b8131c4bed4430e2cfaf69ccf4c2de1 01-Sep-2011 Richard Trieu <rtrieu@google.com> Extend the self-reference warning to catch when a constructor references itself upon initialization, such as using itself within its own copy constructor.

struct S {};
S s(s);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b89d5ed785e2eb7dd64aa38d481d939155f62c41 31-Aug-2011 Jeffrey Yasskin <jyasskin@google.com> Fix PR10694: Boolean conversions can be from pointers, and those conversions
aren't considered narrowing conversions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9906149972906e340f512a60f72a8676748f24d8 29-Aug-2011 Jeffrey Yasskin <jyasskin@google.com> Print 'int' instead of 'const int' in the narrowing conversion error, since the
qualification of a type doesn't affect whether a conversion is a narrowing
conversion.
This doesn't work in template cases because SubstTemplateTypeParmType gets in
the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f40fd6bbb2684db5efb18627ea355613c235d23f 24-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Refactor and fix checking for initialization of flexible array members. The old version had the checks scattered across the code, missed some checks, and had a couple nasty bugs in existing checks.

Fixes PR10648 and another similar accepts-invalid bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
629f118e6928f69178fab8fad6ff755b33a69f42 23-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Remove function parameter which always used the default value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b0a58cd0d69d213b6cd1e6a7bb7319f4f270944b 18-Aug-2011 Francois Pichet <pichet2000@gmail.com> Downgrade "err_init_list_variable_narrowing" into a warning in Microsoft mode even if c++0x is enabled. This necessary to parse MSVC code in C++0x mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6d0ee8d77b6d37fa0dec1d55aa13429a6608e7a9 12-Aug-2011 Jeffrey Yasskin <jyasskin@google.com> Conversions to bool count as integer conversions for the purposes of
the C++0x narrowing error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
191591336f639dad1504e863733fb831645c1644 27-Jul-2011 Jeffrey Yasskin <jyasskin@google.com> This patch implements as much of the narrowing conversion error specified by
[dcl.init.list] as is possible without generalized initializer lists or full
constant expression support, and adds a c++0x-compat warning in C++98 mode.

The FixIt currently uses a typedef's basename without qualification, which is
likely to be incorrect on some code. If it's incorrect on too much code, we
should write a function to get the string that refers to a type from a
particular context.

The warning is currently off by default. I'll fix LLVM and clang before turning
it on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
12ce0a085f89f07c76bf034aa6b838ef50542241 15-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 135177 to fix PR10363.

Revert "For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either."

This reverts commit ac420c5053d6aa41d59f782caad9e46e5baaf2c2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
ac420c5053d6aa41d59f782caad9e46e5baaf2c2 14-Jul-2011 Sebastian Redl <sebastian.redl@getdesigned.at> For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either.
This is a first baby step towards supporting generalized initializer lists. This also removes an aggregate
test case that was just plain wrong, assuming that non-aggregates couldn't be initialized with initializer lists
in C++11 mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3b80232b50c29b245e674f5aa02047b408e41018 14-Jul-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Remove InitializationSequence::ReferenceBinding, the last redundant sequence kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
54001c1e6a87b792b0711b822def2b1bfe1ad4a1 29-Jun-2011 Douglas Gregor <dgregor@apple.com> Check for deprecated/unavailable/etc attributes on fields that are
initialized via initializer lists. Fixes <rdar://problem/9694686>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
c03fa498b9598fe88ef8fb97315f27d09e56aa50 28-Jun-2011 John McCall <rjmccall@apple.com> ARC writeback isn't supposed to apply to local indirect pointers,
only to pointers to locals. But it should work inside blocks, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
d7b23167763f43d3e76b0de26141b1e52613ee3c 22-Jun-2011 Douglas Gregor <dgregor@apple.com> When binding a reference to an Automatic Reference Counting temporary,
retain/release the temporary object appropriately. Previously, we
would only perform the retain/release operations when the reference
would extend the lifetime of the temporary, but this does the wrong
thing across calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b4b7b5034bb8304ed03416635bf64c75c39889fc 22-Jun-2011 Douglas Gregor <dgregor@apple.com> Give MaterializeTemporaryExpr the exact type of the lvalue it binds
to, including cv-qualifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
03e80030515c800d1ab44125b9052dfffd1bd04c 21-Jun-2011 Douglas Gregor <dgregor@apple.com> Introduce a new AST node describing reference binding to temporaries.

MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given

const int& r = 1.0;

The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value.

IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
856d3798af7c2f7251e4a295f3da7a09ce4c62ab 17-Jun-2011 John McCall <rjmccall@apple.com> Be sure to try a final ARC-production even in Objective-C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
7491c499e826682e128a400038361ebcbde30eec 05-Jun-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Drop most of InitializationSequence::SequenceKind's values. They didn't really contain any information that the step array didn't contain too. This makes debugging dumps a bit less informative, but probably not significantly so. The advantage is that the redundancy is gone, so the code is easier to understand.
ReferenceBinding is still there, because it is used in some unclear code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d695d6bb7323672e29dbb1556a3dafde3d3b2732 05-Jun-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Remove more references to FailedSequence.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
d49bd5515b89bedc57c3d1d3be457e4340dbdb1d 03-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fix delegating constructors stylistic issues.

Material bugfixes to come this afternoon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
059ce0d92eb5a7da900ae735dc0a2ea3d64f4b0b 01-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fully implement delegating constructors!

As far as I know, this implementation is complete but might be missing a
few optimizations. Exceptions and virtual bases are handled correctly.

Because I'm an optimist, the web page has appropriately been updated. If
I'm wrong, feel free to downgrade its support categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f8b1771677743d24c7391305cad8853c513ec0f8 28-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't waste memory if the initializer expression is empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a47317bbeef839ef86323e3feacd9962ca9c383a 25-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR4304: Add warning for designators in strict c89 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3e8dc2ac8926dfbebd8f2f6b74ceba4befccd4d2 21-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use the ArrayFiller to fill out "holes" in the array initializer due to designated initializers,
avoiding to create separate Exprs for each one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4423ac0282acb8ba801eb05b38712438dc0c1e3e 21-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For

double data[20000000] = {0};

we would blow out the memory by creating 20M Exprs to fill out the initializer.

To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.

Fixes rdar://9275920.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b8fc45f8d0fdcc7908590115942d425bf4a924f1 14-Apr-2011 Anders Carlsson <andersca@mac.com> In C++, when initializing an array from a pascal string, it's OK if the array
is 1 element smaller than the string, because we can just strip off the last
null character. This matches GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
bc34b1d7f4f371bfdebf68d66086f54586d68abe 11-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR9669: implement correct checking for [dcl.init.string]p2.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
4171766318a2564fbc9a739be0a2851f441c0d29 26-Feb-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement delegating constructors partially.

This successfully performs constructor lookup and verifies that a
delegating initializer is the only initializer present.

This does not perform loop detection in the initialization, but it also
doesn't codegen delegating constructors at all, so this won't cause
runtime infinite loops yet.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cd9ec3b4fb3d042f89aa5b572de7df3ef9ee4a80 22-Feb-2011 Douglas Gregor <dgregor@apple.com> Implement the GNU C extension which permits the initialization of an
array from a constant array compound literal. Fixes PR9261.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
fef8b344ea299a1717cc94486f5df6facf3e337c 21-Feb-2011 John McCall <rjmccall@apple.com> Reorganize subelement initialization checking, no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
ce6c9b7da219c8640a0559f75770cfc6622de083 21-Feb-2011 John McCall <rjmccall@apple.com> Small optimization: avoid redundant checks of whether a type is an array
when checking an initialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e0fd832b076eb5a1e4a4549687af0dbf2ad57181 19-Feb-2011 Chris Lattner <sabre@nondot.org> implement a tiny amount of codegen support for gnu array range
designators: allowing codegen when the element initializer is a
constant or something else without a side effect. This unblocks
enough to let process.c in the linux kernel build, PR9257.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
65e7a9e0597fdd68caa23d49991f3891e724e5c6 01-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> When initializing struct members, the important thing is that the "initializing" expression is
compatible, not having the same type.

Fix rdar://8183908 in which compatible vector types weren't initialized properly leading to a crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
63e7d25d2e6036616b42f744fd4a39cd5f911960 27-Jan-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed parameter names.

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

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

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

Fixes <rdar://problem/8913298>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cc15f010672a13b38104a32e3cefc7adc07ffbf7 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.



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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
fb5d7efc279335bde2cdc0a73da525d6b28201e9 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Improve the diagnostic that complains about binding an rvalue
reference to an lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b2855ad68d93824faf47c09bbef90ba74157f0f4 21-Jan-2011 Douglas Gregor <dgregor@apple.com> More work to bring reference binding up to the latest C++0x
specification. In particular, an rvalue reference can bind to an
initializer expression that is an lvalue if the referent type and the
initializer expression type are not reference-related. This is a newer
formulation to the previous "rvalue references can never bind to
lvalues" rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
564cb06b1f010ab3c5e316ac79ba6cfdd72e9c1d 21-Jan-2011 Douglas Gregor <dgregor@apple.com> When performing reference binding via a conversion function, perform
type checking based on the actual reference type we're trying to bind
the result to, rather than stripping the reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c5db24dfbc860a9fd1501c72f398bf6b6d5b6e0e 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Start refactoring reference binding to more closely match the C++0x
working paper's structure. The only functional change here is that we
now handling binding to array rvalues, which we would previously reject.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
69d831645f429d3b806d2ae220aee45ca44f8c6c 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Add some tests for reference-collapsing and referencing binding
involving rvalue references, to start scoping out what is and what
isn't implemented. In the process, tweak some standards citations,
type desugaring, and teach the tentative parser about && in
ptr-operator.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2d75bbd36e273f7b958aefc766424220ad158bd9 16-Jan-2011 Douglas Gregor <dgregor@apple.com> Emit an extension diagnostic for C99 designated initializers that appear in C++ code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f57258bb96799957085080027a9c9eefe36c3417 31-Dec-2010 Francois Pichet <pichet2000@gmail.com> MSVC doesn't require an accessible copy-constructor when binding a temporary class object to a const-reference.
Note: this is not a C++0x behavior change, it was already like that in MSVC 2003.

This fixes a compile error when parsing MSVC header files with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a0e27f00158c9306d53b0003b94182e415380ea9 22-Dec-2010 Francois Pichet <pichet2000@gmail.com> Redesign the way anonymous fields are handled in designated-initializers.
Previously designated anonymous fields were found via name lookup. This redesign uses the fact that an IndirectFieldDecl declaration will always follow an anonymous implicit field to remove the special case of name lookup.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
74e40b70306b39d65fed16d474017df036ff3960 04-Dec-2010 John McCall <rjmccall@apple.com> Don't crash when initializing a subaggregate in C from a property r-value.



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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
8ff338bfd8abd9ac5d0c1d89c1b05e2c02727174 12-Nov-2010 Douglas Gregor <dgregor@apple.com> When performing initialization of a copy of a temporary object, use
direct-initialization (rather than copy-initialization) to initialize
the temporary, allowing explicit constructors. Fixes PR8342.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
15d7d12226f83de24f96f4bf4e27ebba30fef51e 11-Nov-2010 John McCall <rjmccall@apple.com> Extend the bitfield-truncation warning to initializations.
rdar://problem/8652606



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b934c2d77144471f35c5ebae9e925b056dac8112 11-Nov-2010 John McCall <rjmccall@apple.com> Unnest; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e86d78cf4754a6aef2cf9a33d847aa15338e276f 10-Nov-2010 Bob Wilson <bob.wilson@apple.com> Add a variant of GCC-style vector types for ARM NEON.
NEON vector types need to be mangled in a special way to comply with ARM's ABI,
similar to some of the AltiVec-specific vector types. This patch is mostly
just renaming a bunch of "AltiVecSpecific" things, since they will no longer
be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3afb97700200f629d6036e437267af9c1fd37c90 08-Nov-2010 Douglas Gregor <dgregor@apple.com> When attempting reference binding to an overloaded function, also
consider that we might be trying to bind a reference to a class type,
which involves a constructor call. Fixes PR7425.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d86132d52c1dd99ad5519abaad92533712692a8b 30-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't remove the init expression from the initializer list if it had a semantic error.

We already flag the error with InitListChecker's hadError and we mess up the AST unnecessarily.
Fixes rdar://8605381.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
20e047abc5f19dc948436c0fb891450d9cd40667 30-Oct-2010 John McCall <rjmccall@apple.com> When list-initializing a vector, try to copy-initialize from vectors instead
of descending into the subelements.

rdar://problem/8345836



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



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

Patch originally by Samuel Benzaquen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
9046c224f16be3cef84f03b96a6c00a621c8383e 10-Oct-2010 Chris Lattner <sabre@nondot.org> Allow a string literal to initialize a tail array (PR8217), patch
by Pierre Habouzit!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
022d13de47a5f02d1e4089fa3360fae8bcb17666 08-Oct-2010 Douglas Gregor <dgregor@apple.com> This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:

* Indexed anonymous member initializers should not be expanded. Doing so makes
little sense and would cause unresolvable semantic ambiguity in valid code
(regression introduced by r69153).

* Subobject initialization of (possibly nested) anonymous members are now
referred to with paths relative to the naming record context, eliminating the
synthesis of incorrect implicit InitListExprs that caused CodeGen to assert.

* Field lookup was missing a null check in IdentifierInfo comparison which
caused lookup for a known (already resolved) field to match the first unnamed
data member it encountered leading to silent miscompilation.

* Subobject paths are no longer built using the general purpose
Sema::BuildAnonymousStructUnionMemberPath(). If any corner cases crop up, we
will now assert earlier in Sema instead of passing invalid InitListExprs
through to CodeGen.

Fixes PR6955, from Alp Toker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b72db8977ed032d6425045d7e9d36e49d9b2d3f8 05-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
558d2abc7f9fd6801cc7677200992313ae90b5d8 15-Sep-2010 John McCall <rjmccall@apple.com> one piece of code is responsible for the lifetime of every aggregate
slot. The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision. The main obstacle here is that
IR-generation must be much more careful about making sure that exactly



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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7a126a474fdde06382b315b4e3d8ef0a21d4dc31 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
38a4ffe5244e6be46f1b1f8394342a77836be776 26-Aug-2010 John McCall <rjmccall@apple.com> Work around a gcc warning.



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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
572fc62b52b5b113cbaf528bd3ec00fcde19a46e 17-Aug-2010 John McCall <rjmccall@apple.com> Don't try to initialize a reference with a constructed temporary if either
of the classes is invalid. A class is invalid if a base is invalid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
09865a903affa9c08687859d8de65470064c7bc2 14-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR3344: Downgrade "too many braces around scalar initializer" to a warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
569c3166874324c24011f8ade6978421f0d39b3c 07-Aug-2010 Douglas Gregor <dgregor@apple.com> Allow reference binding of a reference of Objective-C object type to
an lvalue of another, compatible Objective-C object type (e.g., a
subclass). Introduce a new initialization sequence step kind to
describe this binding, along with a new cast kind. Fixes PR7741.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
66d0acd5f1010625df9987a89b8cc4df3d378d5e 26-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make sure that implicit qualification and derived-to-base conversions of xvalues preserve xvalue-ness. Unfortunately I have no idea how to test this property; there doesn't seem to be a syntactical construct that triggers such a conversion and still allows the distinction between prvalues and xvalues to be made.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0a2eb5685aaef78ce33e84dd8c70ad3ff31b0e11 21-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Added extra check when looking for location of '=' in
a copy initialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
10f8e319569c8b8b4603d8a72ce01a7a01502c85 21-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Fix source location of the initializer in
a copy initialization. Back out hack in objc rewriter.
fixes radar 8213998.


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


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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3e31552aed7c6e9c915bbc8d457ec84bb4a8d7e9 08-Jul-2010 Nate Begeman <natebegeman@mac.com> Fix an issue with opencl init list checking.


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


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4712c02c1550a72612c07f5aaee455dcd8273b96 01-Jul-2010 Douglas Gregor <dgregor@apple.com> When performing copy initialization via user-defined conversions,
don't allow two user-defined conversions. Fixes PR6595 (again).


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
36c28db83d2141ca4e74c4d2e92be5a3a772e2c3 30-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8e19890c329279c5ac35ab71a35423d429d80165 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Don't complain about missing field initializers when the initializer
list is completely empty, from Lasse Kärkkäinen! Fixes PR7413.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
57d12fd4a2bc739c4a4d62a364b7f08cd483c59e 07-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> PR7245: Make binding a reference to a temporary without a usable copy
constructor into an extension warning into the error that C++98 requires.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
369371ce0c2b0d8051a8089e620eb41513fce9a2 04-Jun-2010 John McCall <rjmccall@apple.com> More refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
72a43bbf6802c8fcfd04dcb2be8eafcb0b8fe29c 21-May-2010 Douglas Gregor <dgregor@apple.com> Add a new failure kind, FK_Incomplete, to InitializationSequence, to
capture failures when we try to initialize an incomplete
type. Previously, we would (ab)use FK_ConversionFailed, then
occasionally dereference a null pointer when trying to diagnose the
failure. Fixes <rdar://problem/7959007>.


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

This is just a baby step toward NRVO.


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

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

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

Re-fixes PR7080.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4d9e7388ccdfdab97f92caac5db9b87a530742f4 03-May-2010 Douglas Gregor <dgregor@apple.com> Complain when we try to initialize an object of Objective-C class type
(which is ill-formed) with an initializer list. Also, change the
fallback from an assertion to a generic error message, which is far
friendlier. Fixes <rdar://problem/7730948>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
72e96fd181b19b8d01144a685cda6e955584c7ea 03-May-2010 Anders Carlsson <andersca@mac.com> Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1c63b9c15d48cb8c833a4b2d6fd6c496c0766e88 27-Apr-2010 Douglas Gregor <dgregor@apple.com> When explicitly building a temporary object (CXXTemporaryObjectExpr),
keep track of whether we need to zero-initialize storage prior to
calling its constructor. Previously, we were only tracking this when
implicitly constructing the object (a CXXConstructExpr).

Fixes Boost's value-initialization tests, which means that the
Boost.Config library now passes all of its tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
fb87b89fc9eb103e19fb8e4b925c23f0bd091b99 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
087fb7d0b5e08f34b2e28a09c376f66449f30886 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Ensure that we have completed a type before attempting initialization
on that type. Fixes several problems in Boost.Interprocess.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4154e0b1a5d03cbe4836e381c7d6187b7a0a200c 25-Apr-2010 Douglas Gregor <dgregor@apple.com> When we create a temporary of class type that we don't immediately
bind, check accessibility of the destructor and mark the declaration
as referenced. Fixes a bunch of Boost.Regex failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f86fcb341116e72c5497e6b57695f46eca5f29e9 24-Apr-2010 Douglas Gregor <dgregor@apple.com> When we attempt to create a temporary object of class type, be sure
that the type we're copying is complete.

Boost.Regex now builds, although it's failing its regression tests
with our favorite "Sema doesn't consider destructor as used."
assertion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d1a272204cef9304df3930d94f66713b05db27d6 24-Apr-2010 Douglas Gregor <dgregor@apple.com> When we are performing copy initialization of a class type via its
copy constructor, suppress user-defined conversions on the
argument. Otherwise, we can end up in a recursion loop where the
bind the argument of the copy constructor to another copy constructor call,
whose argument is then a copy constructor call...

Found by Boost.Regex which, alas, still isn't building.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
688fc9b9b4323a294f5bf4f8a83f7c365edec573 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Switch the initialization of Objective-C message parameters (as occurs
during message sends) over to the new initialization code and away
from the C-only CheckSingleAssignmentConstraints. The enables the use
of C++ types in method parameters and message arguments, as well as
unifying more initialiation code overall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
711f34adb886cce8ba86c7b1b6513a1eaaf63bb5 21-Apr-2010 Anders Carlsson <andersca@mac.com> Keep tack of whether a base in an InitializedEntity is an inherited virtual base or not. Use this in CheckConstructorAccess.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9a68a67c6ae4982001815cc04f69b8781058263a 21-Apr-2010 Anders Carlsson <andersca@mac.com> Pass the InitializedEntity to Sema::CheckConstructorAccess and use it to report different diagnostics depending on which entity is being initialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f3afbeaa68624178a7a78cc20932351eb1f9f10d 21-Apr-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix comment to reflect recent code change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e12a779bbecb46b7287a87e0ff441e32147d10bb 20-Apr-2010 Chris Lattner <sabre@nondot.org> reapply john's patch, he broke mainline again by changing the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
56f3cc6a5ffff81f20d89796b9fbd6710aede8c3 20-Apr-2010 Chris Lattner <sabre@nondot.org> revert r101863, whcih is causing Sema/altivec-init.c to fail on a ton
of buildbots with:

error: 'error' diagnostics expected but not seen:
Line 9: too few elements in vector initialization (expected 8 elements, have 2)
1 warning and 1 error generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
820cbbb668ff6a38a8724dbe6f20242e14f1900a 20-Apr-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Altivec vector literal initializer count mismatch error removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2559a7045a74679c80376305397a5953d038e1d0 18-Apr-2010 Douglas Gregor <dgregor@apple.com> When checking the copy constructor for the optional copy during a
reference binding to an rvalue of reference-compatible type, check
parameters after the first for complete parameter types and build any
required default function arguments. We're effectively simulating the
type-checking for a call without building the call itself.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
523d46af407f32fc53861e6f068e8076d4fe84a8 18-Apr-2010 Douglas Gregor <dgregor@apple.com> In C++98/03, when binding a reference to an rvalue of
reference-compatible type, the implementation is permitted to make a
copy of the rvalue (or many such copies, even). However, even though
we don't make that copy, we are required to check for the presence of
a suitable copy constructor. With this change, we do.

Note that in C++0x we are not allowed to make these copies, so we test
both dialects separately.

Also note the FIXME in one of the C++03 tests, where we are not
instantiating default function arguments for the copy constructor we
pick (but do not call). The fix is obvious; eliminating the infinite
recursion it causes is not. Will address that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
153b3ba7a61f3228fd3a8c67b9bff94db3e13a2e 18-Apr-2010 Douglas Gregor <dgregor@apple.com> Do not consider explicit constructors when performing a copy to a
temporary object. This is blindingly obvious from reading C++
[over.match.ctor]p1, but somehow I'd missed it and it took DR152 to
educate me. Adjust one test that was relying on this non-standard
behavior.


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

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

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




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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
f0e43e5c4634870b8ac7bf65d5ffa5f292d4c8a5 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Switch the checking of implicit casts for static_cast, C-style, and
functional casts over to InitializationSequence, eliminating a caller
of Sema::TryImplicitConversion. We also get access and ambiguity
checking "for free".

More cleanups to come in this routine.



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

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
2f59979a7cc7929f53c9984423b0abeb83113442 02-Apr-2010 Douglas Gregor <dgregor@apple.com> Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.



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



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


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


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

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

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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
80639debfb2d90b2f1ffdbcd9a391f744cb0a393 11-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wmissing-field-initializers. Patch by mikem!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a1a9f035852e35ed88f4902a855eb952cf08bebb 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Reference binding via user-defined conversion can compute a binding
that is not reference-related (because it requires another implicit
conversion to which we can find). Fixes PR6483.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1dcd061f7209f227d785043bd4a75e427d851abe 07-Mar-2010 Tanya Lattner <tonic@nondot.org> Fix 80 col violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
47f164e15b9358b51ae65f8249d56842f8750767 07-Mar-2010 Tanya Lattner <tonic@nondot.org> Fix indentation, use string directly instead of StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
20df6683f1e4834c42d1c37509900d1fecddef4a 07-Mar-2010 Tanya Lattner <tonic@nondot.org> Fix some weird patch issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1e1d396dc55002a2a6355048db542a38b5137002 07-Mar-2010 Tanya Lattner <tonic@nondot.org> Implement missing-braces warning and add a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
91be6f5ccbde073e592bed9a3e3bc363957714fb 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Use CXXTemporaryObjectExpr for explicitly-constructed temporaries. We
used to do this, but it got lost when we switched functional-style
cast syntax over to using the new initialization code. Fixes PR6457.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
692f85c1d217c8c3cdc06d884ad61b101c75c856 26-Feb-2010 Douglas Gregor <dgregor@apple.com> Commit Eli's fix for implicit conversions to array type. Fixes PR6264.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
b571924f32590f026889f227f03570e59e5c29b7 13-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Silence a GCC warning about a possibly uninitialized variable. It's data flow
only flows so far it seems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
60c93c9981c467738369702e7aa23fd58c2b6aac 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Migrate the mish-mash of declaration checks in
Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:

- Fix all of the places in the testsuite where we defined const
objects without initializers (now that we diagnose this issue)
- Teach instantiation of static data members to find the previous
declaration, so that we build proper redeclaration
chains. Previously, we had the redeclaration chain but built it
too late to be useful, because...
- Teach instantiation of static data member definitions not to try
to check an initializer if a previous declaration already had an
initializer. This makes sure that we don't complain about static
const data members with in-class initializers and out-of-line
definitions.
- Move all of the incomplete-type checking logic out of
Sema::FinalizeDeclaratorGroup; it makes more sense in
ActOnUnitializedDecl.

There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2c79281ef66cb5001f0ebadf6b317250c21a1c01 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Be more careful when checking initializer lists that involve reference
types; we don't want to give an expression reference type. Fixes PR6177.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a508b7de6c5246ab04ed69d0ab4e9977ec1fb4d4 07-Feb-2010 Anders Carlsson <andersca@mac.com> Add support for threadsafe statics, and make them the default (matching gcc).

Daniel, I'd appreciate a review of the driver/cc1 parts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
67fa05b9ed29923b7b905a09cfb95c2ac91b5835 05-Feb-2010 Douglas Gregor <dgregor@apple.com> A dependent initializer with zero arguments should return a NULL
initializer (for no initialization) rather than a ParenListExpr with
zero arguments in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a64a869312066ff6119d1d7ae03f88ce499e3f82 03-Feb-2010 Anders Carlsson <andersca@mac.com> Revert the new reference binding code; I came up with a way simpler solution for the reference binding bug that is preventing self-hosting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
41593e3b7da967b52bc3c7f488b8752dee63f38e 02-Feb-2010 John McCall <rjmccall@apple.com> Fix this comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b13b737a2450167c82e148590e8019b839ce6b98 01-Feb-2010 John McCall <rjmccall@apple.com> Access checking for implicit user-defined conversions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3aba09376c5f49c4c8d176109ea4835bc2c528ee 31-Jan-2010 Anders Carlsson <andersca@mac.com> Start creating CXXBindReferenceExpr nodes when binding complex types to references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
9db7dbb918ca49f4ee6c181e4917e7b6ec547353 31-Jan-2010 Douglas Gregor <dgregor@apple.com> Rework base and member initialization in constructors, with several
(necessarily simultaneous) changes:

- CXXBaseOrMemberInitializer now contains only a single initializer
rather than a set of initialiation arguments + a constructor. The
single initializer covers all aspects of initialization, including
constructor calls as necessary but also cleanup of temporaries
created by the initializer (which we never handled
before!).

- Rework + simplify code generation for CXXBaseOrMemberInitializers,
since we can now just emit the initializer as an initializer.

- Switched base and member initialization over to the new
initialization code (InitializationSequence), so that it

- Improved diagnostics for the new initialization code when
initializing bases and members, to match the diagnostics produced
by the previous (special-purpose) code.

- Simplify the representation of type-checked constructor initializers in
templates; instead of keeping the fully-type-checked AST, which is
rather hard to undo at template instantiation time, throw away the
type-checked AST and store the raw expressions in the AST. This
simplifies instantiation, but loses a little but of information in
the AST.

- When type-checking implicit base or member initializers within a
dependent context, don't add the generated initializers into the
AST, because they'll look like they were explicit.

- Record in CXXConstructExpr when the constructor call is to
initialize a base class, so that CodeGen does not have to infer it
from context. This ensures that we call the right kind of
constructor.

There are also a few "opportunity" fixes here that were needed to not
regress, for example:

- Diagnose default-initialization of a const-qualified class that
does not have a user-declared default constructor. We had this
diagnostic specifically for bases and members, but missed it for
variables. That's fixed now.

- When defining the implicit constructors, destructor, and
copy-assignment operator, set the CurContext to that constructor
when we're defining the body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
ca755fe38f00d63363b3a3ac2a1ae6c1eb2957f9 30-Jan-2010 Anders Carlsson <andersca@mac.com> Eliminate yet another old-school PerformCopyInitialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
ef06e2451c3069569ba543e7b1c5e0de7a257005 29-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix reference-binding when we have a reference to const volatile type;
previously, we were allowing this to bind to a temporary. Now, we
don't; add test-cases and improve diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
de4b1d86bf48bc2a84bddf6b188f6da53eaea845 29-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix reference binding of const lvalue references to bit-fields, which
requires a temporary. Previously, we were building an initialization
sequence that bound to the bit-field as if it were a real lvalue. Note
that we previously (and still) diagnose binding of non-const
references to bit-fields, as we should.

There's no real way to test that this code is correct, since reference
binding does not *currently* have any representation in the AST. This
fix should make it easier for that to happen, so I've verified this
fix with...

Added InitializationSequence::dump(), to print an initialization
sequence for debugging purposes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a6fe0bf89db4372c9e8e8a5c2a50593c2977df29 29-Jan-2010 Anders Carlsson <andersca@mac.com> Simplify InitListChecker::CheckReferenceType

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a1635d9b468709d47b6c533cc82bdabf34f560b8 25-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Code simplification; this should have no visible effects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1b36a2fcb2cea310c01fc2a80a9da915e5d2ceb0 24-Jan-2010 Anders Carlsson <andersca@mac.com> Use new initialization code when dealing with [dcl.init.aggr]p12. This fixes the bug where array elements and member initializers weren't copied correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8ff9e86c492c784b3ce2abe5b5d870cd6db365a8 24-Jan-2010 Anders Carlsson <andersca@mac.com> Change all InitializedEntity pointers over to be references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9a8a70ef79f68db5b17d505eb9681bf161384fe8 23-Jan-2010 Anders Carlsson <andersca@mac.com> Start passing InitializedEntity to CheckDesignatedInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
987dc6a3fa0917de269c9d60b7d4f21c68b8b09f 23-Jan-2010 Anders Carlsson <andersca@mac.com> More init work, adding more entity parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2bbae5de98f486d03e10c039668182075b5569dd 23-Jan-2010 Anders Carlsson <andersca@mac.com> Use the new init code for member subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
784f69940755dd66cf244dd84f57a57d358e5c43 23-Jan-2010 Anders Carlsson <andersca@mac.com> Switch some array initialization over to the new init code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
46f4659f9d012ca2e2050c1fc39a59666114b3f9 23-Jan-2010 Anders Carlsson <andersca@mac.com> Baby steps towards migrating the InitListChecker over to the new initialization code. Pass an InitializedEntity pointer through to most init checker functions. Right now, it's ignored everywhere except when initializing vectors in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1f24350dac272caea50ae9a52f1b85722fd3557a 23-Jan-2010 Anders Carlsson <andersca@mac.com> When an InitializedEntity is passed to CheckSingleInitializer, call the new Sema::PerformCopyInitialization overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c07b8c02f7c54631ab9a9bd7db9f031d3db170ca 23-Jan-2010 Anders Carlsson <andersca@mac.com> Change CheckSingleInitializer to take/return OwningExprResults instead. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d3d824d45c32d457493e7cb79cc34a4761afb760 23-Jan-2010 Anders Carlsson <andersca@mac.com> Separate EK_ArrayOrVectorElement into EK_ArrayElement and EK_VectorElement; arrays and vectors are pretty different beasts in C++. Doug, please review/comment.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
5535c38a2fcface6c13bc8bbeca66882de2fa227 12-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Fix the CodeGen half of PR5911 by changing reference initialization to
correctly look through arrays to see cv-qualifiers. Also enhances the routine
for doing this to preserve more type sugaring for diagnostics.


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



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



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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
319d57f21600dd2c4d52ccc27bd12ce260b174e7 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c171e3b192a372669cf622ff0b6a847f8e5b4220 01-Jan-2010 Douglas Gregor <dgregor@apple.com> Typo correction for C99 designated field initializers, e.g.,

test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
field in type 'struct Window'; did you mean 'bounds'?
.bunds.
^~~~~
bounds



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
bba48cbd77ff5168b32efa9b77845d45f9205e48 22-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Zap CheckInitializerTypes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
a91eb541a6adf81acf872e7315bc6b814c3241eb 22-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Switch file-scope assignment initialization over to InitializationSequence.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
d6d37dee48cfc5bbcc998bd9d151e4fb3a9437e8 22-Dec-2009 Douglas Gregor <dgregor@apple.com> When filling in value initializations within an initializer list, be
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
33c2da9b3abdade4f0df4f90962fb8c518967fc4 20-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix review comment; no visible change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
745880f35066bdb1950d0e870608295221346fc5 20-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch default-initialization of variables of class type (or array thereof) over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cfdc81a83467973b14e4ea5e9e9af1690f135415 19-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Initialization improvements: addition of string initialization and a few
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7abfbdbc97ad8e7f340789f751df1e32b10118b4 19-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch more of Sema::CheckInitializerTypes over to
InitializationSequence. Specially, switch initialization of a C++
class type (either copy- or direct-initialization).

Also, make sure that we create an elidable copy-construction when
performing copy initialization of a C++ class variable. Fixes PR5826.



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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
16006c901315fa12a108b4e571f187f4b676e426 16-Dec-2009 Douglas Gregor <dgregor@apple.com> When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
52bb5d2a1474460707e5ca11656b2749a7a33a82 16-Dec-2009 Douglas Gregor <dgregor@apple.com> In Sema::CheckInitializerTypes, replace a use of CheckReferenceInit with an InitializationSequence

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cb57fb9f91e0976f4a3382b89a2734ffa50eb6fb 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::CheckValueInitialization; its callers now use
InitializationSequence to perform the actual initialization.

Also, introduced the notion of a tree of initialized entities, so that
we can know where an initialization began when dealing with nested
initializations (as occur when performing list initialization). This
will, eventually, be useful for producing better diagnostics when list
initialization fails, because we can show the path from the top-level
object being initialized down to the actual subobject where
initialization failed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
71d1740c94060b424bb745d6c6973ff27cfdee06 15-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement value initialization in InitializationSequence; untested
WIP, yet again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a6ca65075490a1f217bbe5f83fe7b80e821df2d8 14-Dec-2009 Douglas Gregor <dgregor@apple.com> Minor cleanups for constructor initialization in InitializationSequence

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
51c56d6c8a944c2e49dd714db65a780d9f627e15 14-Dec-2009 Douglas Gregor <dgregor@apple.com> Constructor initialization for InitializationSequence. Untested WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4a520a2bd8a6b79fa5d4771f02e34e7bd6bc461d 14-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement user-defined conversions in InitializationSequence. WPI that
isn't turned on anyway yet, so it cannot be tested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
60cfcecaf48e4310339dcfbdb0e3f0e6d2853855 13-Dec-2009 Chandler Carruth <chandlerc@gmail.com> Silence some release build warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9f61aa9e280adea9fbf3365f0e4f6ed568c9885a 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
03981014e4f0c3b4e935872dda96a28c2f1874ea 11-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix a recent regression from the initialization changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d87b61f6398bab21176f73818a8d11ca1c3632c8 10-Dec-2009 Douglas Gregor <dgregor@apple.com> Move initialization via initializer list over to InitializationSequences.


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

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

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

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

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

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






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
29d9c1adfadf65e2d847d44bec37746844b9e0e3 06-Dec-2009 Chris Lattner <sabre@nondot.org> remove some extraneous syntax: sourceloc implicitly converts to sourcerange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
73460a32bc5299a5927d23d2e464d72af796eabf 20-Nov-2009 Douglas Gregor <dgregor@apple.com> Deduce a ConstantArrayType from a value-dependent initializer list
rather than punting to a DependentSizedArrayType, tightening up our
type checking for template definitions. Thanks, John!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cb78d8852a454684c987220132cdb5e54dd00121 19-Nov-2009 Douglas Gregor <dgregor@apple.com> Cope with an amusingly little anomaly with dependent types and
incomplete array initialization, where we have the following in a
template:

int a[] = { 1, 2, something-value-dependent };
// ...
sizeof(a);

The type of "a" appears to be a non-dependent IncompleteArrayType, but
treating it as such makes the sizeof(a) fail at template definition
time. We now correctly handle this by morphing the IncompleteArrayType
into a DependentSizedArrayType with a NULL expression, indicating that
its size has no corresponding expression (and, therefore, the type is
distinct from others).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
46a617a792bfab0d9b1e057371ea3b9540802226 16-Oct-2009 John McCall <rjmccall@apple.com> Remove the ConstantArrayType subtypes. This information is preserved in the
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
39da0b8145eaec7da7004f9b3645c5c9f4f63b1d 10-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
f47511ab0575b8c4752e33cdc4b82a84dcc4d263 08-Sep-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr now takes a MultiExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
ec8e5ea799412a9d2aac4814c9c62cc32b3faad5 05-Sep-2009 Anders Carlsson <andersca@mac.com> Pass the ConstructLoc to BuildCXXConstructExpr.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
da3f4e2dd5938145f132be237a2ed5914cc86702 25-Aug-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr now returns an OwningExprResult.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9abf2aedae7538cfd85f3ff0898a6d14385c8e36 16-Aug-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
089c2602ebaccdda271beaabdd32575b354d4d09 16-Aug-2009 Anders Carlsson <andersca@mac.com> BuildCXXConstructExpr doesn't need to take an ASTContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
1cf9ff87ee235ad252332a96699abdb32bd6facb 06-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Set and use Elidable in elimination of copy ctors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
caa499b50bd6d423d095b79aca857f1c57345a0a 05-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Handle destruction of temporaries used in default argument
construction of constructor calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b2c352ed5586cf869a5dad87a528b9ac000d2fae 05-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to improve ir-gen for constructors with default argument
expressions and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
0863452c21e3e6da5b2613fd455495486c1ad5df 07-Jul-2009 Nate Begeman <natebegeman@mac.com> Extra vector element initializers in OpenCL is an error, not a warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7e7eb3da052a6d80ddf2377cab0384c798f73f75 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
b78d833b12f7c4baab138f305f72efd49455a3f9 26-Jun-2009 Chris Lattner <sabre@nondot.org> Improve error recovery in C++: when we hit 'implicit int' cases in C++,
these are usually because the parser was thoroughly confused. In addition
to typing the value being declared as an int and hoping for the best, we
mark the value as invalid so we don't get chains of errors when it is
used downstream. In C, implicit int actually is valid, so typing the thing
as int is good and marking it invalid is bad. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6b5374f837f925d99b1a76bc2fe8c98c1698df7f 13-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Allow initializing a vector with a vector in addition to allowing a list
of the elements. Issue reported on cfe-dev by Mattias Holm.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
bb6415c69fc6440c337970e39749d4d482d9de42 31-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4285: allow intializing a const wchar_t array with a wide
string.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8e587a15da6d3457a418239d5eb4146fcbd209f3 30-May-2009 Anders Carlsson <andersca@mac.com> Remove VarDecl from CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0f5f2c669e435a31eca9ca2f09fd8917ee11664e 30-May-2009 Anders Carlsson <andersca@mac.com> Remove VarDecl from CheckInitializerTypes now that CXXConstructExpr doesn't need to take a VarDecl anymore. (It still does, but it won't for long)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e540858b289b23653bcb23646f135729203635cb 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Make sure we don't give the wrong warning, and make sure not to set
hadError (suppressing future diagnostics) if we didn't print an
error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
587cbdfd95f4b0aaccc14b31f5debe85d5daf7ed 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Add an assertion so that we don't accidentally build constant arrays of
VLAs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8718a6a02ccc53fea758677781a8df3a8b0c41c9 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Revert r72575, which isn't really right, and fix up other code to
handle the construct in question correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
4f54f4e2f1af5850805033d69c5199df068d11e7 29-May-2009 Mike Stump <mrs@apple.com> Avoid dumping during semantic analysis when checking array types when
a vla is used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
bffed8a98cf5775cd39dc1765abc75c914513012 27-May-2009 Anders Carlsson <andersca@mac.com> Fix another test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7c520cf417e7a4eceeefef0a8b2a2b33811f0481 27-May-2009 Anders Carlsson <andersca@mac.com> Relax an assert to an if check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
2078bb9c9336da56ea521e98e718556b227541f6 27-May-2009 Anders Carlsson <andersca@mac.com> Create CXXConstructExprs when constructing via copy initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c4bb7bfe8328f79004517dd268f6146c8066c205 22-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for GNU array-range designators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9ea62768fca25d829d80199cf4f8cf0f4dd39251 22-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C99 designated initializers, because we
can. Also, delay semantic analysis of initialization for
value-dependent as well as type-dependent expressions, since we can't
always properly type-check a value-dependent expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
759f25237864f3a3cc23eb01f0c0ce6edcc9342d 16-May-2009 Eli Friedman <eli.friedman@gmail.com> PR3009: Get rid of bogus warning for scalar compound literals.

This patch isn't quite ideal in that it eliminates the warning for
constructs like "int a = {1};", where the braces are in fact redundant.
However, that would have required a bunch of refactoring, and it's
much less likely to cause confusion compared to redundant nested braces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
ba79fc2d1b742e34df104aadb2780725c2a882fc 16-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Attempt to fix a read-after-free running test/Sema/designated-initializers.c.

Douglas, can you check that this is doing the right thing?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
711997184366d584c9c437102cae1e9d9927b986 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Switch designated-initializer checking from using designator iterators
to using designator indices. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
eeae8f072748affce25ab4064982626361293390 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Make our diagnostics about the obsolete GNU designated-initializer
syntax into extension warnings, and provide code-modification hints
showing how to fix the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
08457737b60ba2e7f58ecf3062010843268fc6ea 21-Mar-2009 Douglas Gregor <dgregor@apple.com> Fix a thinko in the pre-allocation strategy for structured initializer
lists. The code wasn't accounting for the distinction between the
top-level call to getStructuredSubobjectInit and later calls that
occur deeper in the hierarchy. This problem manifested itself as
over-allocation in cases where we have large arrays of small
structures (<rdar://problem/6707362>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
fa2192042f223b5122a9e17719930f77634fd31f 21-Mar-2009 Douglas Gregor <dgregor@apple.com> When building the structured initializer list, pre-allocate storage in
its vectors based on the subobject type we're initializing and the
(unstructured) initializer list. This eliminates some malloc thrashing
when parsing initializers (from 117 vector reallocations down to 0
when parsing Cocoa.h). We can't always pre-allocate the right amount
of storage, since designated initializers can cause us to initialize
in non-predictable patterns.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a6457963cf7ffe71498c408dd590d9d1acb9513c 20-Mar-2009 Douglas Gregor <dgregor@apple.com> Allow flexible array initializers that are not surrounded by
braces. We now build the appropriate fully-structured initializer list
for such things. Per PR3618, verified that we're getting the right
code generation.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
ed8a93d17b8936dc7978cdc37f3f00fc49d24f71 01-Mar-2009 Douglas Gregor <dgregor@apple.com> Fix PR3509 by providing correct starting locations for initializer lists

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
220b6369d7717bfe6894b46cef055d3e763827f2 27-Feb-2009 Chris Lattner <sabre@nondot.org> fix a bozobug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
19753cfa6059b237880a91f21ef58f2d8984845f 27-Feb-2009 Chris Lattner <sabre@nondot.org> ok, not as broken as I thought, just confusing. This allows
initialization of wchar_t arrays with wide strings, and generalizes
wchar_size.c to work on all targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8879e3b29d2527260c401bce0ed0e401901ef601 27-Feb-2009 Chris Lattner <sabre@nondot.org> allow wide strings to initialize arrays compatible with wchar_t.
Unfortunately this doesn't work yet because wchar_t is completely
broken in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
79e079d3caecc0ddd7128dc038d3f8960bbab62e 25-Feb-2009 Chris Lattner <sabre@nondot.org> handle @encode interactions with array initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
19da8cdfb3d5cd31e06d02c7bab1eb1bd41a7949 25-Feb-2009 Chris Lattner <sabre@nondot.org> rename CheckStringLiteralInit to CheckStringInit and pass in the
string size as an argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0820254f97bb8925d933a3664ea1c6fca3997b97 24-Feb-2009 Chris Lattner <sabre@nondot.org> make SemaRef be a reference to sema, not a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
8b419b9b5f21cf948cf6fe788f67bf1efd97524c 24-Feb-2009 Chris Lattner <sabre@nondot.org> move InitListChecker to be private to SemaInit.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
95e8d658fbea5b53c5e77c48f883fe6c9f7f620f 24-Feb-2009 Chris Lattner <sabre@nondot.org> Make CheckSingleInitializer a static function in SemaInit.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f71ae8d8024561f92dd7916363e7a791684563cc 24-Feb-2009 Chris Lattner <sabre@nondot.org> make CheckStringLiteralInit a static function in SemaInit.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6c291a88bce9852225328b7b37a7ce1d1edec3c1 24-Feb-2009 Chris Lattner <sabre@nondot.org> change IsStringLiteralInit into a static function in SemaInit.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
dd8e0065207e953bb28b95ad9cb6b2c13f56b3b8 24-Feb-2009 Chris Lattner <sabre@nondot.org> move some initialization checking code from SemaDecl.cpp
to SemaInit.cpp, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
7c53ca6e03833adab4465462b7d5c888741b715d 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Downgrade the "excess elements in initializer" errors to warnings *in
C*. They're required errors in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
dfb5e597e033c8fa09c0e178bd93cfcdf060862e 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Fix a bug with designated initializers where we were stepping out of a
union subobject initialization before checking whether the next
initiailizer was actually a designated initializer. This led to
spurious "excess elements in union initializer" errors. Thanks to
rdivacky for reporting the bug!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
fdf556936f94344d5482747403f27822cf0ae37f 09-Feb-2009 Douglas Gregor <dgregor@apple.com> When handling "the rest" of a designated array subobject, maybe sure
to tell it that it wasn't (directly) designated. This way, we unwind
back to the explicit initializer list properly rather than getting
stuck in the wrong subobject. Fixes llvm.org/PR3519



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
eeb15d499f032bb89773ddaca2d17475122a37bb 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Implement semantic analysis for the GNU flexible array initialization
extension. The interaction with designated initializers is a
bit... interesting... but we follow GNU's lead and don't permit too
much crazy code in this area.

Also, make the "excess initializers" error message a bit more
informative.

Addresses PR2561: http://llvm.org/bugs/show_bug.cgi?id=2561


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d863517ab7e936cbc3244a0fc431c8b672f5ece4 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Add iterators to LookupResult, allowing one to iterate over the
non-ambiguous name lookup results without allocating any memory, e.g.,
for sets of overloaded functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
87fd703e097c27d63479cb83b687d4000a22bbb1 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Check value-initializations that occur when an initializer list
provides too few elements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b574e5630d66629ccc8f2432e60b59ae42f1f363 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
930d8b5ecc074cca01ecd9a522a55f55f3b72396 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Implement and test aggregate initialization in C++. Major changes:

- Support initialization of reference members; complain if any
reference members are left uninitialized.
- Use C++ copy-initialization for initializing each element (falls
back to constraint checking in C)
- Make sure we diagnose when one tries to provide an initializer
list for a non-aggregate.
- Don't complain about empty initializers in C++ (they are permitted)
- Unrelated but necessary: don't bother trying to convert the
decl-specifier-seq to a type when we're dealing with a C++
constructor, destructor, or conversion operator; it results in
spurious warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d7eb846aaf5ee4a8d22c3cd0796d1e7229d46013 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Switch Type::isAggregateType to use the C++ definition of "aggregate
type" rather than the C definition. We do this because both C99 and
Clang always use "aggregate type" as "aggregate or union type", and
the C++ definition includes union types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a9c878086036de36482cc21e35a33cabe9699b0a 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
3498bdb9e9cb300de74c7b51c92608e2902b2348 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0bb76897bedb8b747efc6523efb432fc24966118 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
68355a57bb9d5daccd3fc73e92370ba2b1a6eafb 29-Jan-2009 Chris Lattner <sabre@nondot.org> fix an absolutely inscrutible gcc 4.0 error:

llvm[0]: Compiling SemaInit.cpp for Debug build
SemaInit.cpp:171: error: ‘InitListChecker’ has not been declared
SemaInit.cpp:171: error: ISO C++ forbids declaration of ‘InitListChecker’ with no type
SemaInit.cpp: In function ‘int InitListChecker(clang::Sema*, clang::InitListExpr*, clang::QualType&)’:
SemaInit.cpp:172: error: ‘hadError’ was not declared in this scope
SemaInit.cpp:173: error: ‘SemaRef’ was not declared in this scope
SemaInit.cpp:177: error: ‘FullyStructuredList’ was not declared in this scope



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
9e80f7252ec1b91142e41790e4491c61e14b9472 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Better documentation for our initialization checker

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c34ee5ef2b267a683c432ba0c342f7c3a14889d6 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Move InitListChecker out of Sema.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
6fbdc6bd38cc51232223ae3539c32f23c45ea852 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Eliminate infinite looping in a wacky case with designated initializers. Simplifies (somewhat) the actually checking of the initializer expression following the designators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
54f0728c2ab0f967e976300478b2f5cdfed78415 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove Expr::hasSideEffects. It doesn't work anyway

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
34e7946831a63f96d3ba3478c74ca8e25ee52d7e 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Improvements to code-generation and semantic analysis of designated
initializers.

- We now initialize unions properly when a member other than the
first is named by a designated initializer.
- We now provide proper semantic analysis and code generation for
GNU array-range designators *except* that side effects will occur
more than once. We warn about this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp
d6f584ff262f51b40f4c9e317b13f1f21db29755 23-Jan-2009 Douglas Gregor <dgregor@apple.com> More APSInt appeasement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
53d3d8e0662197f7245d8f5ff697a72a2b4b3f54 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Hopefully the last of the APSInt signedness issues with initializers. Fixes PR clang/3378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
e3fa2de90ea1666bf4504b8fd557b09a57aac222 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure all of the isUnsigned flags line up when comparing initializer values, to really really fix PR clang/3377

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f6c717c3dca839dcd189b4a6fa46c8fe7a8bec1d 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Properly manage the bit-widths of APInts/APSInts in array initialization.
Fixes PR clang/3377


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
87f55cf59e82f246d8605733e9300d0c5f6830a6 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.

*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
05c13a3411782108d65aab3c77b1a231a4963bc0 22-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of semantic analysis and ASTs for C99
designated initializers. This implementation should cover all of the
constraints in C99 6.7.8, including long, complex designations and
computing the size of incomplete array types initialized with a
designated initializer. Please see the new test-case and holler if you
find cases where this doesn't work.

There are still some wrinkles with GNU's anonymous structs and
anonymous unions (it isn't clear how these should work; we'll just
follow GCC's lead) and with designated initializers for the members of a
union. I'll tackle those very soon.

CodeGen is still nonexistent, and there's some leftover code in the
parser's representation of designators that I'll also need to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
e267ff35b2f4e9d2b0d8bf24109d41cc7398b61b 11-Dec-2008 Douglas Gregor <dgregor@apple.com> Address some comments on the name lookup/DeclContext patch from Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.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/SemaInit.cpp
396f0bfd4b2189452914893ce69f5fb068d0ec22 18-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support initialization of incomplete array with zero size (as
extension).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
12bc692a78582f1cc32791325981aadcffb04c5e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> Minor #include cleaning
- Drop TokenKinds.h from Action.h
- Move DeclSpec.h from Sema.h into individual Sema .cpp files


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
613535273b90dc5cbd0f9fa056dedc93801ea35a 10-Aug-2008 Steve Naroff <snaroff@apple.com> InitListChecker::CheckListElementTypes(): Check for function types and issue an appropriate diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
1bb516c8615714317c72ec8065cc3177714d336e 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to count the struct elements correctly; here, we want the
member count. The count returned by numStructUnionElements is the
number of initializers that will be consumed, not the number of members
to iterate through. Fixes PR2534.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.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/SemaInit.cpp
39ba4aeca296b1c9f04bde7d9d3cbbf129f1abd3 10-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Changes to TagDecl:
Added TagKind enum.
Added getTagKind() method.
Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c92e5e4e4d632343b1f5b34cbd1d583666b1f4f8 09-Jun-2008 Eli Friedman <eli.friedman@gmail.com> For struct initialization, check compatibility with the unqualified
type; this isn't explicitly stated in the standard, but it doesn't
really make sense for them to have an effect here. Fixes the included
testcase, sent to me by Steve Naroff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
f84eda37251c679e2f20343c47a4a3586d9a8e21 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Count the number of initializable members correctly in structs/unions
with unnamed members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
402256fc665ba179873ffcb4d630e28cbea42f27 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Diagnose implicit init list for empty aggregate, like struct {}. Fixes
PR2151 (by not creating the empty implicit init list).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
638e14413a4557c399fa2b7da2be5e4e9c1330a2 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Move the error checking for variable-sized objects so we don't
double-report errors; fixes PR2362.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
d8dc2100487640d8f5ce53201fdcfac7b5ca32b2 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Be a bit more defensive in SemaInit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
cda25a977e4b7fe4e080b87586410eaeab7b62f6 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Adjust warning so that it doesn't fire when there is an error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
bb504d3a63e0e4b2439900ba6d77b620fb6de857 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Add errors for some illegal constructs (specifically, "int a = {{3}};"
and "int a = {};"). I'll adjust the tests in a bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
c9c0ea6576666eb7e96508f6b8ce2b4d33af3f02 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Some more SemaInit cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
b85f70719da9ce5a3ca9c801ee0748732e2660ee 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Various fixes; solves (almost) all of the test regressions that would be
caused by enabling SemaInit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
a647caad2dec67ac25b763f06237cfe3c3968b51 06-May-2008 Steve Naroff <snaroff@apple.com> Several fixes to SemaInit.cpp. It's still not enabled (since it fails a few tests). Expect to enable it very soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp
0cca749f64ff54476df3a4fc084821b8a8d712d5 02-May-2008 Steve Naroff <snaroff@apple.com> Replace Sema::CheckInitializerListTypes() with a helper class (InitListChecker) that synthesizes implicit InitListExpr's when appropriate (see InitListExpr comments in Expr.h for more details). I also moved the code to SemaInit.cpp, to help reduce clutter in SemaDecl.cpp.

NOTE: This work is incomplete and still fails many tests (as a result, it isn't enabled yet). Nevertheless, I wanted to check it in so I can work on it from home.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaInit.cpp