History log of /external/clang/lib/Sema/SemaDeclCXX.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4967a710c84587c654b56c828382219c3937dacb 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master Clang for rebase to r275480

Bug: http://b/31320715

This merges commit ac9cc4764cf47a6c3f031687d8592e080c9f5001 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Ic2875e5c3673c83448cd7d1013861e42947b1b55
/external/clang/lib/Sema/SemaDeclCXX.cpp
87d948ecccffea9e9e37d0d053b246e2d6d6c47b 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

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

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

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

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7bd67854cfa59699e0efe72244af1578f2a1c09e 26-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195620:
------------------------------------------------------------------------
r195620 | rsmith | 2013-11-24 23:07:05 -0800 (Sun, 24 Nov 2013) | 3 lines

Take cv-qualifiers on fields of class type into account when determining
whether a defaulted special member function should be deleted.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f72bc468e54819393c1805f19cbf353061b4c0ec 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't reject dependent range-based for loops in constexpr functions. The loop
variable isn't really uninitialized, it's just not initialized yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ce6426feda94ca716ee7743b71961850740eb08d 08-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Issue a diagnostic if we see a templated friend declaration that we do not
support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
33b1f634e074835a1b49c23d2b7674161fef1762 04-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Issue a diagnostic if an implicitly-defined move assignment operator would move
the same virtual base class multiple times (and the move assignment is used,
and the move assignment for the virtual base is not trivial).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a8d478ec139fde0069d671f584416566a4d072a9 04-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Update a comment to match current core issues list.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
28165b7a977339253ce34b7b1b1c442b9b73f46d 02-Nov-2013 David Majnemer <david.majnemer@gmail.com> Sema: Disallow inheriting from classes with flexible array members

Flexible array members inherently index off of the end of their parent
type.

We shouldn't allow this type to be used as a base, virtual or otherwise,
because indexing off the end may find us inside of another base or the
derived types members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7041fcc6b8078a7f87713dac168c2bed64a9d191 02-Nov-2013 David Majnemer <david.majnemer@gmail.com> Sema: Remove stray whitespace around Sema::CheckBaseSpecifier


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
858d2ba136c8dcdc051fe20b3190c40bc25de189 25-Oct-2013 Richard Trieu <rtrieu@google.com> Simplify and refactor the uninitialized field warning.

Change the uninitialized field warnings so that field initializers are checked
inside the constructor. Previously, in class initializers were checked
separately. Running one set of checks also simplifies the logic for preventing
duplicate warnings. Added new checks to warn when an uninitialized field is
used in base class initialization. Also fixed misspelling of uninitialized
and moved all code for this warning together.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f06a2893bc9778857295c64ee32b4a899a338480 23-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules.

With this fixed, I no longer see any test regressions in the libc++ test suite
when enabling a single-module module.map for libc++ (other than issues with my
system headers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b5c7768a74936d4e2c7a484570a638cb74702d8b 19-Oct-2013 Kaelyn Uhrain <rikka@google.com> Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.

Now that CorrectTypo knows how to correctly search classes for typo
correction candidates, there is no good reason to only replace an
existing CXXScopeSpecifier if it refers to a namespace. While the actual
enablement was a matter of changing a single comparison, the fallout
from enabling the functionality required a lot more code changes
(including my two previous commits).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
08235661cf457978ba4645ec8e22697aebabe4fa 18-Oct-2013 Alp Toker <alp@nuanti.com> Fix missed exception spec checks and crashes

Delayed exception specification checking for defaulted members and virtual
destructors are both susceptible to mutation during iteration so we need to
swap and process the worklists.

This resolves both accepts-invalid and rejects-valid issues and moreover fixes
potential invalid memory access as the contents of the vectors change during
iteration and recursive template instantiation.

Checking can be further delayed where parent classes aren't yet fully defined.
This patch adds two assertions at end of TU to ensure no specs are left
unchecked as was happenning before the fix, plus a test case from Marshall Clow
for the defaulted member crash extracted from the libcxx headers.

Reviewed by Richard Smith.

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

Summary: Some MS headers use these features.

Reviewers: rnk, rsmith

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
682a56b15ae01cc8154d4800d29498da93911981 17-Oct-2013 Alp Toker <alp@nuanti.com> Revert "Fix missed exception spec checks and crashes"

The changes caused the sanitizer bot to hang:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/2311

Needs investigation.

This reverts commit r192914.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bb81f880aa77cfd09dedfc72a9b87262889ae75c 17-Oct-2013 Alp Toker <alp@nuanti.com> Fix missed exception spec checks and crashes

Delayed exception specification checking for defaulted members and virtual
destructors are both susceptible to mutation during iteration so we need to
process the worklists fully.

This resolves both accepts-invalid and rejects-valid issues and moreover fixes
potential invalid memory access as the contents of the vectors change during
iteration and recursive template instantiation.

This patch also adds two assertions at end of TU to ensure no specs are left
unchecked as was happenning before the fix, plus a test case from Marshall Clow
for the defaulted member crash extracted from the libcxx headers.

Reviewed by Richard Smith.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b79b17b67f2c0de8fd343fdd070e5ccbfe20d602 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17567: Improve diagnostic for a mistyped constructor name. If we see something
that looks like a function declaration, except that it's missing a return type,
try typo-correcting it to the relevant constructor name.

In passing, fix a bug where the missing-type-specifier recovery codepath would
drop a preceding scope specifier on the floor, leading to follow-on diagnostics
and incorrect recovery for the auto-in-c++98 hack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b2969b1e50580344891a98f5b241f8351fe371cf 11-Oct-2013 Warren Hunt <whunt@google.com> Adds Microsoft compatiable C++ record layout code to clang.



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

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

Patch by Hristo Venev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
56fe35b4e2a437bc7fee4ec321c742c8fd8c5cf6 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Fix windows newlines :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6992ab33b7113e1bd7af51c0c52d17c23706c01 29-Sep-2013 Faisal Vali <faisalv@yahoo.com> Implement conversion to function pointer for generic lambdas without captures.

The general strategy is to create template versions of the conversion function and static invoker and then during template argument deduction of the conversion function, create the corresponding call-operator and static invoker specializations, and when the conversion function is marked referenced generate the body of the conversion function using the corresponding static-invoker specialization. Similarly, Codegen does something similar - when asked to emit the IR for a specialized static invoker of a generic lambda, it forwards emission to the corresponding call operator.

This patch has been reviewed in person both by Doug and Richard. Richard gave me the LGTM.

A few minor changes:
- per Richard's request i added a simple check to gracefully inform that captures (init, explicit or default) have not been added to generic lambdas just yet (instead of the assertion violation).
- I removed a few lines of code that added the call operators instantiated parameters to the currentinstantiationscope. Not only did it not handle parameter packs, but it is more relevant in the patch for nested lambdas which will follow this one, and fix that problem more comprehensively.
- Doug had commented that the original implementation strategy of using the TypeSourceInfo of the call operator to create the static-invoker was flawed and allowed const as a member qualifier to creep into the type of the static-invoker. I currently kludge around it - but after my initial discussion with Doug, with a follow up session with Richard, I have added a FIXME so that a more elegant solution that involves the use of TrivialTypeSourceInfo call followed by the correct wiring of the template parameters to the functionprototypeloc is forthcoming.

Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fad9e13f3cb85198f0ee5af620ba81cd78574faa 26-Sep-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- generic lambdas within template functions and nested
within other generic lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware
(Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit)

As an example of what compiles through this commit:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

This patch has been reviewed by Doug and Richard. Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics).



Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately
generate a template-parameter-type when 'auto' is parsed in a generic
lambda parameter context. (i.e we do NOT use AutoType deduced to
a template parameter type - Richard seemed ok with this approach).
We encode that this template type was generated from an auto by simply
adding $auto to the name which can be used for better diagnostics if needed.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- various tests were added - but much more will be needed.

There is obviously more work to be done, and both Richard (weakly) and Doug (strongly)
have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData
in a future patch which is forthcoming.

A greatful thanks to all reviewers including Eli Friedman, James Dennett,
and especially the two gracious wizards (Richard Smith and Doug Gregor)
who spent hours providing feedback (in person in Chicago and on the mailing lists).
And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified!

Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ee0bc3b53795109e79daba77b279c3903c6150af 22-Sep-2013 Nick Lewycky <nicholas@mxc.ca> Simplify code to equivalent code. No need to test for null after cast<>, use
takeAs<> instead of cast<>(.take()). Fix 80-column violation in whitespace after
comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ef8f90caa14d85cffba2fea4b6bd425c3b22eea7 20-Sep-2013 Richard Trieu <rtrieu@google.com> Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class. This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
int x;
int y;
A() : x(y) {} // y is initialized after x, warn here
A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.



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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
225e9826336f85166cbc4636ae61028f6f7868be 16-Sep-2013 Richard Trieu <rtrieu@google.com> Move the uninitialized field check to after all the field initializers are added
to the CXXConstructorDecl so that information from the constructor can be used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190810 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3ddec88be4a322adeb9990db2f83abaca6579d5f 16-Sep-2013 Richard Trieu <rtrieu@google.com> Pass additional information around the uninitialized field visitor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fbb08b5ec01fbdeb6219fbba0f5edfd95c752233 13-Sep-2013 Richard Trieu <rtrieu@google.com> Refactor the uninitialized field visitor. Also moved the calls to the visitor
later in the code so that the expressions will have addition processing first.
This catches a few additional cases of uninitialized uses of class fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e575359c34a9248c55ec0c03a8fc945f1ee4cb01 09-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix constructor-related typos.

Noticed by Roman Divacky.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dae9271c2c32527fea8b01953912e214eadc548e 06-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Improve error for "override" + non-virtual func.

Consider something like the following:

struct X {
virtual void foo(float x);
};
struct Y : X {
void foo(double x) override;
};

The error is almost certainly that Y::foo() has the wrong signature,
rather than incorrect usage of the override keyword. This patch
adds an appropriate diagnostic for that case.

Fixes <rdar://problem/14785106>.

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

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

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

Fixes PR16635.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
66ea35d9f3d93cab3ca6d735c8eb19a5f701b86f 30-Aug-2013 Pavel Labath <labath@google.com> Sema: avoid reuse of Exprs when synthesizing operator=

Summary:
Previously, Sema was reusing parts of the AST when synthesizing an assignment
operator, turning it into a AS-dag. This caused problems for the static
analyzer, which assumed an expression appears in the tree only once.

Here I make sure to always create a fresh Expr, when inserting something into
the AST, fixing PR16745 in the process.

Reviewers: doug.gregor

CC: cfe-commits, jordan_rose

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ef072033876e295ec5d3402f8730a3ae358ad815 28-Aug-2013 Reid Kleckner <reid@kleckner.net> Delete CC_Default and use the target default CC everywhere

Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fc2181301750feae060973a51176e9737145bf22 27-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Simplify a bit.

This follows from computeKeyFunction having:

// Template instantiations don't have key functions,see Itanium C++ ABI 5.2.6.
// Same behavior as GCC.
TemplateSpecializationKind TSK = RD->getTemplateSpecializationKind();
if (TSK == TSK_ImplicitInstantiation ||
TSK == TSK_ExplicitInstantiationDefinition)
return 0;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
344472ebeded2fca2ed5013b9e87f81d09bfa908 23-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
152b4e4652baedfceba1cd8115515629225e713f 22-Aug-2013 Manuel Klimek <klimek@google.com> Revert "Implement a rudimentary form of generic lambdas."

This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ecb5819a9e64fb654d46a3b270a286cc570c58ff 22-Aug-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- nested lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware


As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Augment AutoType's constructor (similar to how variadic
template-type-parameters ala TemplateTypeParmDecl are implemented) to
accept an IsParameterPack to encode a generic lambda parameter pack.

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that Sema::ActOnLambdaAutoParameter may use it to create the
appropriate list of corresponding TemplateTypeParmDecl for each
auto parameter identified within the generic lambda (also stored
within the current LambdaScopeInfo). Additionally,
a TemplateParameterList data-member was added to hold the invented
TemplateParameterList AST node which will be much more useful
once we teach TreeTransform how to transform generic lambdas.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- Teach Sema::ActOnStartOfLambdaDefinition to set the
return type of a lambda without a trailing return type
to 'auto' in C++1y mode, and teach the return type
deduction machinery in SemaStmt.cpp to process either
C++11 and C++14 lambda's correctly depending on the flag.

- various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,
James Dennett and the ever illuminating Richard Smith. And
yet I am certain that I have allowed unidentified bugs to creep in;
bugs, that I will do my best to slay, once identified!

Thanks!




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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c895f4d411152b08365cac48f330a8a7898fb382 19-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> const'ify Sema::ActOnCompoundStmt by
changing Parameter of Sema::ActOnCompoundStmt from MutableArrayRef to
ArrayRef.
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
e7205c0e2472dd66238f4c6b6db1b7cc2957b42a 10-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Omit llvm:: before SmallVector and SmallVectorImpl. We have using directive in include/clang/Basic/LLVM.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4e9686b1f9947f1747b4f4316deb2087a7f56282 09-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement [class.friend]p11's special name lookup rules for friend declarations
of local classes. We were previously handling this by performing qualified
lookup within a function declaration(!!); replace it with the proper scope
lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a7b879723d3989d85b9492fd8218e7d745367fe3 07-Aug-2013 Jordan Rose <jordan_rose@apple.com> Eliminate CXXConstructorDecl::IsImplicitlyDefined.

This field is just IsDefaulted && !IsDeleted; in all places it's used,
a simple check for isDefaulted() is superior anyway, and we were forgetting
to set it in a few cases.

Also eliminate CXXDestructorDecl::IsImplicitlyDefined, for the same reasons.

No intended functionality change.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
4ac537b0f07f2efb9fcf081f60d54e6cfb1cf2d5 23-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y literal suffix support:
* Allow ns, us, ms, s, min, h as numeric ud-suffixes
* Allow s as string ud-suffix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e0883603389c5f380354474e0d6d1d63827f0c30 22-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Update comment to refer to core issue number.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d030c7a6f36438f6c7dd977f8be0de0cc781ad5 22-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
* renamed isTypeName as HasTypenameKeyword
In UsingDecl:
* renamed get/setUsingLocation to get/setUsingLoc
* renamed is/setTypeName as has/setTypename



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0d317a08460d9e0eb826233db9c1c41ba27e2dee 22-Jul-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Remove superfluous cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cbc820af7193e3ad9c71fbe6e3c8bd3c1166e540 22-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR257 / fix PR16659:
A constructor for an abstract class does not call constructors for virtual
base classes, so it is not an error if no initializer is present for the
virtual base and the virtual base cannot be default initialized.

Also provide a (disabled by default, for now) warning for the case where a
virtual base class's initializer is ignored in an abstract class's constructor,
and address a defect in DR257 where it was not carried through to C++11's rules
for implicit deletion of special member functions.

Based on a patch by Maurice Bos.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1169e2fa84939325bdf1d0f558c63e87404a6b57 21-Jul-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Convert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fd527a4e1a62218285c0ea94dcd53e01b52c48b7 17-Jul-2013 NAKAMURA Takumi <geek4civic@gmail.com> SemaDeclCXX.cpp: Dissolve a ligature "fi" in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d4de59d3e54421ef88316d650e35802ba9c572cf 17-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed source range of C++03 access declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fcb5a251e9c0c8c2d54323677d4f2ba5219301d0 12-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix crash on zero-argument assignment operator.

Make sure we don't crash when checking whether an assignment operator
without any arguments is a special member. <rdar://problem/14397774>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0daf1f4a0ff1cd6487c7040ac8f97eee48185536 10-Jul-2013 Kaelyn Uhrain <rikka@google.com> Offer typo suggestions for 'using' declarations.

Patch courtesy of Luke Zarko <zarko@google.com>

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5fb478be9b91f15624e855e7bd6ac2101021ac48 28-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix error recovery with in-class initializer.

Previously, for a field with an invalid in-class initializer, we
would create a CXXDefaultInitExpr referring to a null Expr*.
This is not a good idea.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b26f012c8354b85dff5d9a0eac3a78bd11c73e9b 28-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix line endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b4f0f3f3f7adcbaf1cd56e53ddb7af92afba2c58 26-Jun-2013 Aaron Ballman <aaron@aaronballman.com> This patch fixes PR16395, when HandleMSProperty returns null due to a declaration with no name.

Patch thanks to Robert Wilhelm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f6a144f5991c6b29622a31fdab86adede0648d12 26-Jun-2013 David Majnemer <david.majnemer@gmail.com> Implement DR136

Friend declarations that specify a default argument must be a definition
and the only declaration in the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2f686697187e8834346b7924797d44c978252ec6 22-Jun-2013 David Majnemer <david.majnemer@gmail.com> Revert r184401 which reverted r183462.

The problem with r183462 was that we assumed that a diagnostic id of
zero would be silent.

This small correction to CheckDerivedToBaseConversion changes it's
behavior to omit the diagnostic when given a diagnostic id of zero.

This fix passes the test case added in r184402.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4cde94a04694d5d24dc9e3bf6c5fa3403629838e 20-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Clean up warning and add a test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
62341d3bde21c85405318950ed8d26b6b3e36544 20-Jun-2013 Chandler Carruth <chandlerc@gmail.com> Temporarily revert r183462: "Implement DR7"

This fixes PR16370, I'll add the test case in a follow-up commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
36155c14b691720ee3e94bfe99886229650bbfb5 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++11: If a class has a user-declared copy operation or destructor, the
implicit definition of a copy operation is deprecated. Add a warning for this
to -Wdeprecated. This warning is disabled by default for now, pending
investigation into how common this situation is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1b2209fd149436c98e73d4b8667b40b5f4b974cd 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> In C++11, promote access declaration diagnostic from warning to error. There
doesn't seem to be any value in even adding a -W flag for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
8150da3796300bdc876775e1782331f0e43d2d94 07-Jun-2013 Eli Friedman <eli.friedman@gmail.com> When we're synthesizing copy/move-assignment, we can't form a reference to an
invalid field; make sure we don't try. Fixes <rdar://problem/14084171>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
585bee48bac063f31696e308798f9432b5ba4116 07-Jun-2013 David Majnemer <david.majnemer@gmail.com> Implement DR7

Disallowing deriving from classes that have private virtual base classes
except in instances where the deriving class would be able to cast
itself to the private virtual base via a different derivation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f51cfb89b3fe317318e434db4856b06a90afc126 20-May-2013 Peter Collingbourne <peter@pcc.me.uk> [ms-cxxabi] Look up operator delete() at every virtual dtor declaration.

While the C++ standard requires that this lookup take place only at the
definition point of a virtual destructor (C++11 [class.dtor]p12), the
Microsoft ABI may require the compiler to emit a deleting destructor
for any virtual destructor declared in the TU, including ones without
a body, requiring an operator delete() lookup for every virtual
destructor declaration. The result of the lookup should be the same
no matter which declaration is used (except in weird corner cases).

This change will cause us to reject some valid TUs in Microsoft ABI
mode, e.g.:

struct A {
void operator delete(void *);
};

struct B {
void operator delete(void *);
};

struct C : A, B {
virtual ~C();
};

As Richard points out, every virtual function declared in a TU
(including this virtual destructor) is odr-used, so it must be defined
in any program which declares it, or the program is ill formed, no
diagnostic required. Because we know that any definition of this
destructor will cause the lookup to fail, the compiler can choose to
issue a diagnostic here.

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

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

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

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

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

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
a36bbac10f7b74ef198ec2fb0eb52dbd8a50e7f0 10-May-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize Sema::ActOnMemInitializer


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

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a8942d7686dde6d221a176c502ce857bdc409dab 07-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: an assignment operator is implicitly 'constexpr' if it would only call 'constexpr' assignment operators for a literal class type.


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

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

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

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

This commit depends on an LLVM commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
e5e575ded9cd4b80229fb299a2d97e9d44728eda 26-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Add r180263 back, but fix hasBraces() to be correct during parsing.

Original commit message:

Fix a case in linkage computation that should check for single line extern "C".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
11dc6347bb01b766cf4f357d707ff789cba9114b 25-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Put friend decls in the correct context.

When we find a friend declaration we have to skip transparent contexts for doing
lookups, but we should not skip them when inserting the new decl if the lookup
found nothing.

Fixes PR15841.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
987c03085558277a5fe8cef8e1b628cabcc626dc 17-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15755: don't drop parameter packs when dropping parameters with default
arguments in the formation of a candidate set of inheriting constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
82b0f86252c050b43f2e5d5425d6e37970aabd7c 17-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7974c60375b2b9dfc20defc77c9ed8c3d6d241a1 17-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> DR974: Lambdas can have default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
ec64244f5939fa81596fbeddad966cca4b4a4c51 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0b0ca4724d1c05dc0dd1d6e5aff4c8a439cbb1a2 10-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add support for computing the exception specification for an inheriting
constructor. This isn't quite perfect (as usual, we don't handle default
arguments correctly yet, and we don't deal with copy/move constructors for
arguments correctly either, but this will be fixed when we implement core issue
1351.

This completes our support for inheriting constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4841ca5f83bf970f910ac7d154cdd71d2a3cf481 10-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++11 inheriting constructors: support for inheriting constructor templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
045d2524e136fabd10613d7ac0063df632a7c2a5 09-Apr-2013 John McCall <rjmccall@apple.com> When checking for illegal expressions in a default-argument
expression, look through pseudo-object expressions.

rdar://13602832

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f608aff66c5412ab583258f989417b4974ba507a 06-Apr-2013 Richard Trieu <rtrieu@google.com> When -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to add
more information to the notes. This information is already present on other
diagnostic messages that involves overloads.


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

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

Revert "Revert 178663."

This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.

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

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

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

This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ab5b4c438b40c72252933072d4c9e9a948106f0 02-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> If a defaulted special member is implicitly deleted, check whether it's
overriding a non-deleted virtual function. The existing check for this doesn't
catch this case, because it fires before we mark the method as deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
12fef490dce56bf8abc1bad7fec798eb882aabf7 27-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15597: Fix a confusion between the implicit exception specification and the
uninstantiated exception specification when a special member within a class
template is both defaulted and given an exception specification on its first
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0162c1ce296fc48fbe03a31a2ae00b939eef86a8 27-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13267210> Ensure that Sema::CompareReferenceRelationship returns consistent results with invalid types.

When Sema::RequireCompleteType() is given a class template
specialization type that then fails to instantiate, it returns
'true'. On subsequent invocations, it can return false. Make sure that
this difference doesn't change the result of
Sema::CompareReferenceRelationship, which is expected to remain stable
while we're checking an initialization sequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dc392c1bae3306af7aec25f0b0b14637d2dc6b39 26-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13185264> Don't crash when attempting to redundantly initialize a member of an anonymous union.


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
70c5361c9fdb4f6c78ff39c8592db2cbfe2b647f 20-Mar-2013 John McCall <rjmccall@apple.com> Remove some dead code.

Patch by Stephen Lin!

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

No (intended) functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
531db82c6ecfb4772c6870731c06ad8718f1e0ce 07-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Add a hasExternalLinkage helper. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3cdbbdc53241907939486ba4a9b0c9b5655419c3 06-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15390: If a function returns a pointer to a function, that function type
can't have default arguments even though it's a parameter-declaration-clause in
a function declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
41f3f3a4792f46787632fdb94f952f6b3ce3f4ae 05-Mar-2013 Jordan Rose <jordan_rose@apple.com> Silence a number of static analyzer warnings with assertions and such.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
684aa73192d92850a926870be62a1787eb5b7ed9 22-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6b3d3e54c003b03f16e235ad2ff49e95587bbf92 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
053214013990ad8ec096dafc64aa7c0ad2b05bc0 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15300: Support C++11 attributes on base-specifiers. We don't support any such
attributes yet, so just issue the appropriate diagnostics. Also generalize the
fixit for attributes-in-the-wrong-place code and reuse it here, if attributes
are placed after the access-specifier or 'virtual' in a base specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
ce6a10eaadd152f05103dfffe22ac20ef2c04615 06-Feb-2013 Nick Lewycky <nicholas@mxc.ca> Don't check whether a friend declaration is correctly formed when instantiating,
we already checked it when parsing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
10318845f40d50b9d0ce010b0ea8d93a7b5ab029 01-Feb-2013 Douglas Gregor <dgregor@apple.com> Don't do delayed exception-specification checking on an invalid
class. Fixes <rdar://problem/13017229>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c84028ed9aa0dfd54ab729dee78f29c961d7f37 31-Jan-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Added outer template parameter lists to friend type AST nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3e55e3e9f5e89c0cd433f6c01e0b067911228612 31-Jan-2013 Matt Beaumont-Gay <matthewbg@google.com> Fix unused variable warnings in -asserts build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1d87fbaeea4a9fbbd73b3a53641f59f1673098e5 30-Jan-2013 David Blaikie <dblaikie@gmail.com> Provide a fixit for constexpr non-static data members.

If the member has an initializer, assume it was probably intended to be static
and suggest/recover with that.

If the member doesn't have an initializer, assume it was probably intended to
be const instead of constexpr and suggest that.

(if the attempt to apply these changes fails, don't make any suggestion &
produce the same diagnostic experience as before. The only case where this can
come up that I know of is with a mutable constexpr with an initializer, since
mutable is incompatible with static (but it's already incompatible with
const anyway))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d5617eeafc93209a26b9f88276c88cf997c3a0a7 25-Jan-2013 John McCall <rjmccall@apple.com> The standard ARM C++ ABI dictates that inline functions are
never key functions. We did not implement that rule for the
iOS ABI, which was driven by what was implemented in gcc-4.2.
However, implement it now for other ARM-based platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
299adab3e2033e9addc1df4544d8486fc596c6ff 19-Jan-2013 David Blaikie <dblaikie@gmail.com> Remove windows line endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ee000bb236fd99f297c253206e5f110a8f49661e 17-Jan-2013 David Blaikie <dblaikie@gmail.com> Improve -Wreorder to handle cases of anonymous class member ordering

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
93c8617bec98aeb769ee9f569d7ed439eec03249 17-Jan-2013 David Blaikie <dblaikie@gmail.com> ArrayRef-ize some ctor initializer related APIs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
72190da43924db7d0238fe5c696ecab2bb5bf196 17-Jan-2013 David Blaikie <dblaikie@gmail.com> Remove some unnecessary casts

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
afb7ce3f877594362381926eaeac8ed6bbe18069 17-Jan-2013 Aaron Ballman <aaron@aaronballman.com> Fixes crash when illegal function definitions are deleted or defaulted. Fixes PR14577.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1c030e9a3f290a1eea5de82fe1e63dfde2bd8f1e 13-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> ArrayRef'ize Sema APIs related to format string checking


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fc35cbca942ccdfe43742c1d786ed168517e0a47 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Tighten types a bit. No functionality change.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
1d28caf3b5254e60d3e3a1d2d37e5df2e5924111 11-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14558: Compute triviality of special members (etc) at the end of the class
definition, rather than at the end of the definition of the set of nested
classes. We still defer checking of the user-specified exception specification
to the end of the nesting -- we can't check that until we've parsed the
in-class initializers for non-static data members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fff3248e69c478cfb4d1a1ffdefb808d5885535b 09-Dec-2012 Aaron Ballman <aaron@aaronballman.com> Virtual method overrides can no longer have mismatched calling conventions. This fixes PR14339.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
afee0ff915b87f92e8c07c72d31c3165aacf6fa8 09-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14550: If a system header contains a bogus constexpr function definition,
don't mark the function as invalid, since we suppress the error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bc2a35d5ff492107dab5bdb7682f0da2f4a88861 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Finish implementing 'selected constructor' rules for triviality in C++11. In
the cases where we can't determine whether special members would be trivial
while building the class, we eagerly declare those special members. The impact
of this is bounded, since it does not trigger implicit declarations of special
members in classes which merely *use* those classes.

In order to determine whether we need to apply this rule, we also need to
eagerly declare move operations and destructors in cases where they might be
deleted. If a move operation were supposed to be deleted, it would instead
be suppressed, and we could need overload resolution to determine if we fall
back to a trivial copy operation. If a destructor were implicitly deleted,
it would cause the move constructor of any derived classes to be suppressed.

As discussed on cxx-abi-dev, C++11's selected constructor rules are also
retroactively applied as a defect resolution in C++03 mode, in order to
identify that class B has a non-trivial copy constructor (since it calls
A's constructor template, not A's copy constructor):

struct A { template<typename T> A(T &); };
struct B { mutable A a; };


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
55798658f879915992ed0ebe30b0b63fd570ff1b 08-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove some remnants of the assumption that there is at most one of each
flavour of special member.


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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
504643934a1cb2f9d0c22b4895c777d8aa4c5139 07-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Per [dcl.fct.def.default]p1, don't allow variadic special members to be defaulted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
afb49189d6962f3636d6a93d09c0b495e94ac782 29-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> The declaration of a special member can require overload resolution to be
performed, to determine whether that special member is deleted or constexpr.
That overload resolution process can in turn trigger the instantiation of a
template, which can do anything, including triggering the declaration of that
very same special member function. When this happens, do not try to recursively
declare the special member -- that's impossible. Instead, only try to realise
the truth. There is no special member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
acf796b4797c5b3e9e237148fa622afdc04b3eff 28-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Store on the CXXRecordDecl whether the class has, or would have, a copy
constructor/assignment operator with a const-qualified parameter type. The
prior method for determining this incorrectly used overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b8abff66a8d30356c82314c4734c692cdd479e5e 28-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> C++ core issue 1344, PR10618: promote "addition of default argument makes this
a special member" diagnostic from warning to error, and fix the cases where it
produced diagnostics with incorrect wording.

We don't support this as an extension, and we ban it even in C++98 mode. This
breaks too much (for instance, the ABI-specified calling convention for a type
can change if it acquires a copy constructor through the addition of a default
argument).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d0adeb65c743e01ca3436db1d47a97cdcc78df89 27-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Simplify checking for whether we should implicitly declare special members and
add some assertions. No functionality change.


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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
621ba4f0dba0accdf67fb38e98bbe14db22ddf8e 15-Nov-2012 Nick Lewycky <nicholas@mxc.ca> Teach the uninitialized field warning about anonymous structs and union members.
Fixes PR14073!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c88953ff0cebd861643ab92309aba71d23c306b 14-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove another questionable use of hasTrivial*. The relevant thing for this
test was whether the /selected/ operator= was trivial, not whether the class
had any trivial (or any non-trivial) operator=s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
044c8aa39d582ebc6bca1720c65ddd06fb27780c 13-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix some wrong-code bugs in implicitly-defined assignment operators:
- In C++11, perform overload resolution over all assignment operators, rather than just looking for copy/move assignment operators.
- Clean up after temporaries produced by operator= immediately, rather than accumulating them until the end of the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e7ce7094602ebb341220467c9a1d6643f45b9595 13-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Factor duplicated implicit memcpy call generation code out of copy/move
assignment generation. This incidentally avoids reusing the same Expr* across
multiple statements in the same object; that was generating slightly broken
ASTs, but I couldn't trigger any observable bad behavior, so no test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
229d47aef27e6f65fe4dc3beb22f622dd81104ad 10-Nov-2012 Douglas Gregor <dgregor@apple.com> Rework my implementation of circular-reference finding to not use
CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the
failure introduced in r167651.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d777e2845110469182809e4efc577899395805f7 10-Nov-2012 Douglas Gregor <dgregor@apple.com> Diagnostic circular inheritance involving dependent base classes. We
would have diagnosed this at instantiation time anyway, if only we
didn't hang on all of these test cases. Fixes <rdar://problem/12629723>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4b7631bc011ce36dbc8f664c518668f0ba5d18a9 04-Nov-2012 Nick Lewycky <nicholas@mxc.ca> Put the usage-directive inside the nearest namespace or TU decl. We don't want
to have UsingDirectiveDecl inside anything other than those two.

No user-visible functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
444d384a969ce05ae534bf8be3174e308dc8c58b 20-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Rework implementation of DR1492: Apply the resolution to operator delete too,
since it also has an implicit exception specification. Downgrade the error to
an extwarn, since at least for operator delete, system headers like to declare
it as 'noexcept' whereas the implicit definition does not have an explicit
exception specification. Move the exception specification for user-declared
'operator delete' functions from the type-as-written into the type, to reflect
reality and to allow us to detect whether there was an implicit exception spec
or not.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5f750680d421328225e597d6429a298027dc6360 19-Oct-2012 David Blaikie <dblaikie@gmail.com> Handle diamond inheritance in -Woverloaded-virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9a14db3fefa73ef8a702dea1928fd0ee0befe59b 18-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Fix Objective-C implicit property synthesis for C++ classes so we use valid
source locations in places where it is necessary for diagnostics. By itself,
this causes assertions, so while I'm here, also fix property synthesis
for properties of C++ class type so we use so we properly set up a scope
and mark variable declarations.

<rdar://problem/12514189>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
76398e5ad39ae719dcc650c7cddeb25379c02c34 18-Oct-2012 David Blaikie <dblaikie@gmail.com> Fix -Woverloaded-virtual when the using statement refers to a base declaration of a virtual function.

GCC and Clang both do not warn on:

struct a { virtual void func(); };
struct b: a { virtual void func(); void func(int); };
struct c: b { void func(int); using b::func; };

but if the "using" was using a::func GCC would still remain silent where Clang
would warn. This change makes Clang consistent with GCC's existing behavior.

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b5e4ace3161bd2c3f88f39e228ba8f6aaa15e751 10-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix stack overflow when trying to create an implicit moving
constructor with invalid code.

rdar://12240916

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c969e6a7e4260fdb284593ed344b51f51e7225f6 05-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Workaround for libstdc++4.6 <atomic> bug: make comment more explicit about what's going on, per Sean Silva's suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d1a55a6631b11b6c5364772023451c547eafedee 05-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Egriegious hack to support libstdc++4.6's broken <atomic> header, which defines
a non-inline namespace, then reopens it as inline to try to add its symbols to
the surrounding namespace. In this one special case, permit the namespace to be
reopened as inline, and patch up the name lookup tables to match.


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e402e72273cde2a64fa6097c1fe93f500038675d 25-Sep-2012 John McCall <rjmccall@apple.com> Fix for r163013 regression and further __interface enhancement.
Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
54b3ba8cf2eb4886a88cdb8adedb15f43333ff1d 25-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't produce diagnostics for missing ctor-initializers during template
instantiations if we encountered errors parsing some of the initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7821e0756744018a34c533f30cdabe62a72d4e4a 21-Sep-2012 Hans Wennborg <hans@hanshq.net> Make warnings about uninitialized fields include the field name.

This makes the wording more informative, and consistent with the other
warnings about uninitialized variables.

Also, me and David who reviewed this couldn't figure out why we would
need to do a lookup to get the name of the variable; so just print the
name directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1a6eac865260b2795e3555e569e6a2e990ee73bd 21-Sep-2012 Craig Topper <craig.topper@gmail.com> Doxygen-ify a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b6b5b97c517cc651285f620a70b1ca52fa808c5a 21-Sep-2012 David Blaikie <dblaikie@gmail.com> PR13890: Warn on abstract final classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6f80daa84164ceeb8900da07f43b6a150edf713 20-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Per C++11 [class.friend]p3, the 'friend' keyword must appear first in a
non-function friend declaration. Patch by Josh Magee!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
471f985ae04817e0e8198a925fc7d74eaacaf962 18-Sep-2012 Hans Wennborg <hans@hanshq.net> Warn about self references in in-class initializers.

This makes Clang warn about self references in in-class initializers,
for example:

struct S {
int a = a + 42;
};

This basically just moves UninitializedFieldVisitor up a bit in
SemaDeclCXX.cpp, and adds a call to it from ActOnCXXInClassMemberInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8f411c39283caf2a403739b0c5dd398a6df511dc 17-Sep-2012 Axel Naumann <Axel.Naumann@cern.ch> Don't write uninitialized values even if nobody ever asks for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a6ddea6adbef22d4e2673dbb7236186ac5b14e09 14-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> When diagnosing multiple mem-initializers in a delegating ctor, point to the delegating initializer, not to the first initializer. For good measure, also highlight the other initializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dd084276526db1d53edf2b6fc8c4c8187e6ab540 14-Sep-2012 Douglas Gregor <dgregor@apple.com> As we do with base and member initializers in a dependent class, delay
type checking for non-static data member initializers in a dependent
class, because our ASTs lose too much information to when
type-checking an initializer. Fixes <rdar://problem/11974632>,
although the result is still rather unsatisfactory.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cddbc1d5872c96cd8c3ad3ddededa304757270d7 06-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't try to check override control for invalid member functions. Fixes a crash in a corner case. Patch by Olivier Goffart!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f143ae9b68cdd40dfb120094baaa702b810eb52c 01-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Changed the remaining dead asserts to llvm_unreachable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
17d35c36fbae764fcd68fa8b31624078a033aabc 01-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Normalize line endings of r163013 (part 2).

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
a8eaf008e92759142982f7b40720b2b2674bd663 23-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix undefined behavior: member function calls where 'this' is a null pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5965b7c7ddf8d9635426943a05441c71cb59fef6 20-Aug-2012 Hans Wennborg <hans@hanshq.net> Better wording for reference self-initialization warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d1420c6fa788669e49f21e184927c7833881e399 16-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Store SourceManager pointer on PrintingPolicy in the case where we're dumping,
and remove ASTContext reference (which was frequently bound to a dereferenced
null pointer) from the recursive lump of printPretty functions. In so doing,
fix (at least) one case where we intended to use the 'dump' mode, but that
failed because a null ASTContext reference had been passed in.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1f2e1a96bec2ba6418ae7f2d2b525a3575203b6a 10-Aug-2012 John McCall <rjmccall@apple.com> Check access to friend declarations. There's a number of different
things going on here that were problematic:
- We were missing the actual access check, or rather, it was suppressed
on account of being a redeclaration lookup.
- The access check would naturally happen during delay, which isn't
appropriate in this case.
- We weren't actually emitting dependent diagnostics associated with
class templates, which was unfortunate.
- Access was being propagated incorrectly for friend method declarations
that couldn't be matched at parse-time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0b8220ae342f71fb50e763668f92d038eb54fb3f 07-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wunused-private-fields: Don't try to check unresolved initializer expressions
for side-effects. Instead, check for side-effects after performing
initialization. Doing so also removes some strange corner cases and differences
between in-class initialization and constructor initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a4b39658673954fb9f75673594b50028685fc665 06-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13499: Don't try to check whether 'override' has been validly applied until
we know whether the function is virtual. But check it as soon as we do know;
in some cases we don't need to wait for an instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eef00293897a73cc47f4d42e2653ff47c59d6030 06-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13527: don't assert if a function is explicitly defaulted when it's already
been defined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5295b97d6a0117414a24d319d9a018191ec1d8e3 03-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash if a literal operator template's template parameter pack is not a non-type template parameter pack. Patch by Andy Gibbs!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c27bc80a98b9558513b50956c930eedc9e461ae0 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: handle using-declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dd25e80a6d67485173fe295f54418e05764cc8cb 31-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13479: If we see the definition of an out-of-line destructor in C++11, be
sure to update the exception specification on the declaration as well as the
definition. If we're building in -fno-exceptions mode, nothing else will
trigger it to be updated.


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

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3fe52ff7df93f7a928a15cc2cbf5134fdc0cec15 23-Jul-2012 Douglas Gregor <dgregor@apple.com> When we have an Objective-C object with non-trivial lifetime in a
structor class under ARC, that struct/class does not have a trivial
move constructor or move assignment operator. Fixes the rest of
<rdar://problem/11738725>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
517bb844016064f303416f09f1aeb123e32c0f66 18-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13381, part 2: when determining if a defaulted special member function should
be defined as deleted, take cv-qualifiers on class members into account when
looking up the copy or move constructor or assignment operator which will be
used for them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6a06e5ff3b680dcf7234d200309fd2400c478095 18-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13381: consider cv-qualifiers on a class member's type when determining which
constructor will be used for moving that object, in the computation of its
exception specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f729ce0b231e045b8e7db61e85e87186c09db238 12-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Ignore visibility attributes after definitions. This matches newer (4.7) gcc's
behavior and is the first step in fixing pr13338.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e3f470a718ec00eb8b546e405fa59bc2df2d7c46 12-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Stop instantiating a class if we hit a static_assert failure. Also, if the
static_assert fails when parsing the template, don't diagnose it again on every
instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a5ef44ff5d93a3be6ca67782828157a71894cf0c 11-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Enable comment parsing and semantic analysis to emit diagnostics. A few
diagnostics implemented -- see testcases.

I created a new TableGen file for comment diagnostics,
DiagnosticCommentKinds.td, because comment diagnostics don't logically
fit into AST diagnostics file. But I don't feel strongly about it.

This also implements support for self-closing HTML tags in comment
lexer and parser (for example, <br />).

In order to issue precise diagnostics CommentSema needs to know the
declaration the comment is attached to. There is no easy way to find a decl by
comment, so we match comments and decls in lockstep: after parsing one
declgroup we check if we have any new, not yet attached comments. If we do --
then we do the usual comment-finding process.

It is interesting that this automatically handles trailing comments.
We pick up not only comments that precede the declaration, but also
comments that *follow* the declaration -- thanks to the lookahead in
the lexer: after parsing the declgroup we've consumed the semicolon
and looked ahead through comments.

Added -Wdocumentation-html flag for semantic HTML errors to allow the user to
disable only HTML warnings (but not HTML parse errors, which we emit as
warnings in -Wdocumentation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ff817f7070c0308e9d4486432b774005d4f8e420 07-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> When marking virtual functions as used for a class' vtable, mark all functions
which will appear in the vtable as used, not just those ones which were
declared within the class itself. Fixes an issue reported as comment#3 in
PR12763 -- we sometimes assert in codegen if we try to emit a reference to a
function declaration which we've not marked as referenced. This also matches
gcc's observed behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3a2d0fb726aca3096b5c1ea9be734417060f34d7 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Split out the "empty" case for compound statement into a separate ctor.

Move the ASTContext-dependent version out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8a50fe0d76b0f245b4cdd599230f2ee023be82cd 02-Jul-2012 Douglas Gregor <dgregor@apple.com> Be more eager about setting the 'Invalid' bit on an invalid class
template instantiation. I wasn't able to reproduce this down to
anything small enough to put in our test suite, but it's "obviously"
okay to set the invalid bit earlier and precludes a
known-broken-but-not-marked-broken class from being used elsewhere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
619ee6acdd43b95b20c5aa96b22c3f238ce1a021 29-Jun-2012 David Blaikie <dblaikie@gmail.com> Avoid redundant error when redefining a function as deleted.

Reviewed by Doug Gregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d9cf8268dcd3f4d393b7a38fef7eb40c7e7f4d10 25-Jun-2012 David Blaikie <dblaikie@gmail.com> PR12937: Explicitly deleting an explicit template specialization.

This works around a quirk in the way that explicit template specializations are
handled in Clang. We generate an implicit declaration from the original
template which the explicit specialization is considered to redeclare. This
trips up the explicit delete logic.

This change only works around that strange representation. At some point it'd
be nice to remove those extra declarations to make the AST more accurately
reflect the C++ semantics.

Review by Doug Gregor.

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

Original comment:

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

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

Patch by Sam Panzer!


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

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

This reverts commit 7d96f6106bfbd85b1af06f34fdbf2834aad0e47e.

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

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

Patch by Sam Panzer!


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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e099125e58bd9a4c5c9ad486fa86683d1745fbb7 15-Jun-2012 Richard Trieu <rtrieu@google.com> Fix T* p to T *p


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
de5e75caac71d4cfeb9d04cd10281176f43579d6 15-Jun-2012 Richard Trieu <rtrieu@google.com> Use a proper visitor to recursively check for uninitialized use in constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
568eae48a4e19c0359cdcd2a33b8ec9812e4abbc 13-Jun-2012 Daniel Jasper <djasper@google.com> Allow __attribute__((unused)) for fields and make it silence
-Wunused-private-field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d3861ce75a308c65b58c0159e2cee58aea2dff1c 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove CXXRecordDecl flags which are unused after r158289.

We need an efficient mechanism to determine whether a defaulted default
constructor is constexpr, in order to determine whether a class is a literal
type, so keep the incrementally-built form on CXXRecordDecl. Remove the
on-demand computation of same, so that we only have one method for determining
whether a default constructor is constexpr. This doesn't affect correctness,
since default constructor lookup is much simpler than selecting a constructor
for copying or moving.

We don't need a corresponding mechanism for defaulted copy or move constructors,
since they can't affect whether a type is a literal type. Conversely, checking
whether such functions are constexpr can require non-trivial effort, so we defer
such checks until the copy or move constructor is required.

Thus we now only compute whether a copy or move constructor is constexpr on
demand, and only compute whether a default constructor is constexpr in advance.
This is unfortunate, but seems like the best solution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7756afa6273cf708b5e3fbd6a6478eb2cada27e2 10-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR13052 properly, by performing special member lookup to determine whether
an explicitly-defaulted default constructor would be constexpr. This is
necessary in weird (but well-formed) cases where a class has more than one copy
or move constructor.

Cleanup of now-unused parts of CXXRecordDecl to follow.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
f8cc02e50553b5c3bc6570bff0c47ac7db85fe8d 06-Jun-2012 Daniel Jasper <djasper@google.com> Introduce -Wunused-private-field. If enabled, this warning detects
unused private fields of classes that are fully defined in the current
translation unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d21016f0b6d9dfcce9cd9f2d1451286e75d9de48 20-May-2012 Eli Friedman <eli.friedman@gmail.com> Make delegating initializers use a similar codepath to base initializers in dependent contexts. PR12890.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c1aa40cdc8f42c3a5505ebb54aa54f3e5086b7ef 19-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Apparently empty names are allowed here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c470442fe144b93c2877134559d0067b3215289d 19-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify some users of DeclarationName::getNameKind. Fold getFETokenInfoAsVoid into its only caller.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3003e1d6626d07e8fc4af95fad95b3a5d4c4af98 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fold the six functions checking explicitly-defaulted special member functions
into one. These were all performing almost identical checks, with different bugs
in each of them.

This fixes PR12806 (we weren't setting the exception specification for an
explicitly-defaulted, non-user-provided default constructor) and enforces
8.4.2/2's rule that an in-class defaulted member must exactly match the implicit
parameter type.


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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
a058fd4f0a944174295f77169b438510dad389f8 03-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Revert most of r154844, which was disabled in r155975. Keep around the
refactorings in that revision, and some of the subsequent bugfixes, which
seem to be relevant even without delayed exception specification parsing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
a2e76f56c60dbd4de3dc0fed02bb01bea4dcff81 29-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> [class.copy]p23: Fix an assertion caused by incorrect argument numbering in a
diagnostic, add a test for this paragraph, and tighten up the diagnostic wording
a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a1366cbab89ec6d4f630dca91e85d03d9e5d1d7d 27-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12224 (sort of): Diagnose inheriting constructor declarations in C++11 mode.
We do not support IRGen for these, and get some parts of the semantic analysis
wrong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5d59b79c2fd8783900e52cf2dd6add5d3627b2fc 25-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12625: Cope with classes which have incomplete base or member types:
Don't try to query whether an incomplete type has a trivial copy constructor
when determining whether a move constructor should be declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c614e4f2b07741130e6c99a971a7093358fb9e4 24-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12629: Cope with parenthesized function types when attaching a delayed
exception specification to a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a4156b8574666aa69a2b0ad35dc9e9603433e4ae 21-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix regression in r154844. If necessary, defer computing adjusted destructor
exception specifications in C++11 until after we've parsed the exception
specifications for nested classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c86d1fdb7b785c34d14fd83a470b395466c69e5d 21-Apr-2012 NAKAMURA Takumi <geek4civic@gmail.com> SemaDeclCXX.cpp: Fix utf8 in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
704c8f76bbe2de68375f7f146e75bd74de6dd518 20-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix bug where a class's (deleted) copy constructor would be implicitly given a
non-const reference parameter type if the class had any subobjects with deleted
copy constructors. This causes a rejects-valid if the class's copy constructor
is explicitly defaulted (as happens for some implementations of std::pair etc).


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

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

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
74e2fc332e07c76d4e69ccbd0e9e47a0bafd3908 16-Apr-2012 Douglas Gregor <dgregor@apple.com> Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.


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

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

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

Fixes PR10036 and PR12450.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
63f557804b76bf765aea58e5a46503e47e21f7c1 09-Apr-2012 John McCall <rjmccall@apple.com> My original patch missed the virtual-base case for destroying
base-class subojects.

Incidentally, thinking about virtual bases makes it clear to me that
we're not appropriately computing the access to the virtual base's
member because we're not computing the best possible access to the
virtual base at all; in fact, we're basically assuming it's public.
I'll file a separate PR about that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
12d8d80fb0f8d9cddecb34da0f37b0dc9fcaf5e6 09-Apr-2012 John McCall <rjmccall@apple.com> Fix the access check performed as part of the determination of whether
to define a special member function as deleted so that it properly
establishes an object context for the accesses to the base subobject
members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
bf9658c3c200ee19bf0b6b157149f2376e39d270 06-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Point the caret at the error for the 'expected namespace name' diagnostic in
a namespace alias declaration.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e6af6604b905435456f49cd4a37da0ce6e505c38 02-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR10217 diagnostic fix: don't say 'copy constructor' when we mean
'copy assignment operator'.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1c931be1873f8c20cdcb5060c84570cd3359aa02 02-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1402: if a field or base class is not movable, the derived class's
move constructor/move assignment operator are not declared, rather than being
defined as deleted, so move operations on the derived class fall back to
copying rather than moving.

If a move operation on the derived class is explicitly defaulted, the
unmovable subobject will be copied instead of being moved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c5a89a1cc2f168ad0a115c560b8de5f1c952d8c5 02-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Basic semantic analysis support for inheriting constructor declarations in
dependent contexts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
df8dc86148a209792dfcbe7b05a00294ed3bcff4 29-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Refactor special member function deletion. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6960587df0bd1b421c11715807a4d2302a3aae3c 28-Mar-2012 Douglas Gregor <dgregor@apple.com> Unify and fix our checking of C++ [dcl.meaning]p1's requirements
concerning qualified declarator-ids. We now diagnose extraneous
qualification at namespace scope (which we had previously missed) and
diagnose these qualification errors for all kinds of declarations; it
was rather uneven before. Fixes <rdar://problem/11135644>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9c6fde5ac9c4a696baaa637a7fb6d83fe91e1e09 16-Mar-2012 Nick Lewycky <nicholas@mxc.ca> Skip through transparent contexts when deciding where to add a friend function.
This fixes g++.dg/parse/friend5.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9cda03ff7fc40b727d0cc44b1702dbae09d63f42 13-Mar-2012 James Molloy <james.molloy@arm.com> Ensure that default arguments are handled correctly in sub scopes. For example:

void f () {
int g (int a, int b=4);
{
int g(int a, int b=5);
}
}

should compile.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1b7f9cbed1b96b58a6e5f7808ebc9345a76a0936 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10447: lazily building name lookup tables for DeclContexts was broken.
The deferred lookup table building step couldn't accurately tell which Decls
should be included in the lookup table, and consequently built different tables
in some cases.

Fix this by removing lazy building of DeclContext name lookup tables. In
practice, the laziness was frequently not worthwhile in C++, because we
performed lookup into most DeclContexts. In C, it had a bit more value,
since there is no qualified lookup.

In the place of lazy lookup table building, we simply don't build lookup tables
for function DeclContexts at all. Such name lookup tables are not useful, since
they don't capture the scoping information required to correctly perform name
lookup in a function scope.

The resulting performance delta is within the noise on my testing, but appears
to be a very slight win for C++ and a very slight loss for C. The C performance
can probably be recovered (if it is a measurable problem) by avoiding building
the lookup table for the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
e5658f0ab2a6f8fea258adb64edbb8485bb21dee 10-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12225: The requirement that literal operators be namespace-scope functions
does not imply that such functions can't be declared at block scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
f52757d63f90e0d03eba20318f6036db944ba50c 10-Mar-2012 Douglas Gregor <dgregor@apple.com> Only make a call to a copy constructor elidable if in fact we are
doing a copy. Fixes PR12139.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
a9e88b2549add9766382c70d270dfd89fa33f7cf 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Literal operators can't have default arguments.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2fb4ae36825ca3a0cbe7e845c5747062870066be 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix not
starting with an underscore is ill-formed.

Since this rule rejects programs that were using <inttypes.h>'s macros, recover
from this error by treating the ud-suffix as a separate preprocessing-token,
with a DefaultError ExtWarn. The approach of treating such cases as two tokens
is under discussion for standardization, but is in any case a conforming
extension and allows existing codebases to keep building while the committee
makes up its mind.

Reword the warning on the definition of literal operators not starting with
underscores (which are, strangely, legal) to more explicitly state that such
operators can't be called by literals. Remove the special-case diagnostic for
hexfloats, since it was both triggering in the wrong cases and incorrect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0cc323c6bed7206f9743a9775ec8d9cb90655f9c 06-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> static_assert: Allow any string-literal as the message, not just a character
string literal, and adjust the diagnostic code to match. This also causes us
to escape any control characters in the message.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
52c16682068850abee4a53495bdf69588d165acd 05-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Avoid double lookup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b4a7b1e587a232c95d02a8ca10eeba60164fbba1 04-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add tests for [over.literal]. Fix a few bugs which were exposed by the tests.


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
79363f5e612c17cd05e1fa888632ee7860ced1ab 27-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Ensure that we delete default constructors in the right cases. Don't delete the
default constructor of a union if it has a const member with no user-provided
default constructor.


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

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e653ba2f3b6d993b5d410554c12416c03ec7775b 26-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Special members which are defaulted or deleted on their first declaration are
trivial if the implicit declaration would be. Don't forget to set the Trivial
flag on the special member as well as on the class. It doesn't seem ideal that
we have two separate mechanisms for storing this information, but this patch
does not attempt to address that.

This leaves us in an interesting position where the has_trivial_X trait for a
class says 'yes' for a deleted but trivial X, but is_trivially_Xable says 'no'.
This seems to be what the standard requires.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
64bee65a3436e3f0c352fcfe2130676f3502cffe 25-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Work-in-progress for lambda conversion-to-block operator. Still need to implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
221c27f0d34c5938d84bbb8fafe1c3e3f1f87f2e 24-Feb-2012 Douglas Gregor <dgregor@apple.com> C++11 [class.ctor]p5 says that
A defaulted default constructor for a class X is defined as deleted if [...]
- X is a union and all of its variant members are of const-qualified type.

A pedantic reading therefore says that

union X { };

has a deleted default constructor, which is both silly and almost
certainly unintended. Pretend as if this this read

- X is a union with one or more variant members, and all of its
variant members are of const-qualified type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c43dccdae3083e73061cb1b2f517b77d35876a0 23-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace some DenseSets with SmallPtrSets. Apart from the "small" optimization, the current implementation is also a denser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
33deb35535aebe81bed0eaf5c14f3032276a086e 22-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Fix parsing and processing initializer lists in return statements and as direct member initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ac1303eca6cbe3e623fb5ec6fe7ec184ef4b0dfa 22-Feb-2012 Douglas Gregor <dgregor@apple.com> Generate an AST for the conversion from a lambda closure type to a
block pointer that returns a block literal which captures (by copy)
the lambda closure itself. Some aspects of the block literal are left
unspecified, namely the capture variable (which doesn't actually
exist) and the body (which will be filled in by IRgen because it can't
be written as an AST).

Because we're switching to this model, this patch also eliminates
tracking the copy-initialization expression for the block capture of
the conversion function, since that information is now embedded in the
synthesized block literal. -1 side tables FTW.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
552e29985a710f4ced62b39d70557501bd31ca9b 21-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement name mangling for lambda expressions that occur within the
initializers of data members (both static and non-static).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ff2348888133dcc64f7363af2093cb608caeb7ce 21-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a constexpr FIXME: When implicitly instantiating the primary template for an
explicit specialization of a function template, mark the instantiation as
constexpr if the specialization is, rather than requiring them to match.


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

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

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



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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7d5088aa52d6e32b309ad0af32ea520ddbc5f953 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Initial refactoring of 'ShouldDeleteSpecialMember', in preparation for providing
decent diagnostics. Finish the work of combining all the 'ShouldDelete'
functions into one. In unifying the code, fix a minor bug where an anonymous
union with a deleted default constructor as a member of a union wasn't being
considered as making the outer union's default constructor deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
27dd7d962bbf774988bc5e59d04a7743ed503514 17-Feb-2012 Douglas Gregor <dgregor@apple.com> Rework the Sema/AST/IRgen dance for the lambda closure type's
conversion to function pointer. Rather than having IRgen synthesize
the body of this function, we instead introduce a static member
function "__invoke" with the same signature as the lambda's
operator() in the AST. Sema then generates a body for the conversion
to function pointer which simply returns the address of __invoke. This
approach makes it easier to evaluate a call to the conversion function
as a constant, makes the linkage of the __invoke function follow the
normal rules for member functions, and may make life easier down the
road if we ever want to constexpr'ify some of lambdas.

Note that IR generation is responsible for filling in the body of
__invoke (Sema just adds a dummy body), because the body can't
generally be expressed in C++.

Eli, please review!


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
c6889e7ed16604c51994e1f11becf213fdc64eb3 14-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement C++ core issue 974, which permits default arguments for
lambda expressions. Because these issue was pulled back from Ready
status at the Kona meeting, we still emit an ExtWarn when using
default arguments for lambda expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
625bb569df0c34feec0d52c0ec5215f21ef2e054 14-Feb-2012 Dmitri Gribenko <gribozavr@gmail.com> Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)

* if, switch, range-based for: warn if semicolon is on the same line.
* for, while: warn if semicolon is on the same line and either next
statement is compound statement or next statement has more
indentation.

Replacing the semicolon with {} or moving the semicolon to the next
line will always silence the warning.

Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb273b798760ed960edb0a619092da314e21f4ea 14-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix another issue introduced by the proposed wording for core issue 1358: since
the instantiation of a constexpr function temploid is now always constexpr, a
defaulted constexpr function temploid is often ill-formed by the rule in
[dcl.fct.def.default]p2 that an explicitly-defaulted constexpr function must
have a constexpr implicit definition. To avoid making loads of completely
reasonable code ill-formed, do not apply that rule to templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
86c3ae46250cdcc57778c27826060779a92f3815 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update constexpr implementation to match CWG's chosen approach for core issues
1358, 1360, 1452 and 1453.
- Instantiations of constexpr functions are always constexpr. This removes the
need for separate declaration/definition checking, which is now gone.
- This makes it possible for a constexpr function to be virtual, if they are
only dependently virtual. Virtual calls to such functions are not constant
expressions.
- Likewise, it's now possible for a literal type to have virtual base classes.
A constexpr constructor for such a type cannot actually produce a constant
expression, though, so add a special-case diagnostic for a constructor call
to such a type rather than trying to evaluate it.
- Classes with trivial default constructors (for which value initialization can
produce a fully-initialized value) are considered literal types.
- Classes with volatile members are not literal types.
- constexpr constructors can be members of non-literal types. We do not yet use
static initialization for global objects constructed in this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
215e4e17d00e12c38687a95502506d8f2ca3e646 12-Feb-2012 Douglas Gregor <dgregor@apple.com> Lambdas have a deleted default constructor and a deleted copy
assignment operator, per C++ [expr.prim.lambda]p19. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
f0459f87aaf05e76ce0d8c8c1e4c68e3c22195b7 11-Feb-2012 Douglas Gregor <dgregor@apple.com> Implement C++11 [expr.lambda.prim]p13, which prohibits lambdas in
default arguments if in fact those lambdas capture any entity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7badd2467a1650c0c2a5fdef974f590fc32c3694 09-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Make sure a variable with a C++ direct initializer triggers jump scope checking. Fixes PR10620 / <rdar://problem/9958362> .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
30ecfad3af057bff74d1c98099eda0677525574e 09-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1359: A constexpr constructor does not need to initialize an empty struct or
empty union. This still rejects anonymous member structs or unions which only
contain such empty class types, pending standard wording defining exactly what
an empty class type is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5e058eb02875530f1aed10c3417a1011744239b1 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Don't complain about the lack of a constructor for a lambda expression. They are constructed in different ways

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
925d8e7c0f18e03dc4bc634b3c6c1ec09373d993 08-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement the agreed resolution to DR1457: a signed left shift of a 1 bit into
the sign bit doesn't have undefined behavior, but a signed left shift of a 1 bit
out of the sign bit still does. As promised to Howard :)

The suppression of the potential constant expression checking in system headers
is also removed, since the problem it was working around is gone.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5b6a3ddda0669b6e3ea3de1f239eee40004423e5 06-Feb-2012 Manuel Klimek <klimek@google.com> Canonicalize the base class used in the nested-name-specifier of a generated
assignment operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
38a42916cb07fd368d9e2ae1e7915fa896f9ec06 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Removed redundant location info from ElaboratedTypeLoc / DependentNameLoc / DependentTSTLoc. Uniformed names referencing elaborated keyword. No intended functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d79093af384ac0ea78f4237a001eae7467e06a61 05-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Implement DR1358: An instantiation of a constexpr function which
can't produce a constant expression is not ill-formed (so long as some
instantiation of that function can produce a constant expression).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
5ba73e1af8ef519161bd40063dc325457e21676a 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr:
The recent support for potential constant expressions exposed a bug in the
implementation of libstdc++4.6, where numeric_limits<int>::min() is defined
as (int)1 << 31, which isn't a constant expression. Disable the 'constexpr
function never produces a constant expression' error inside system headers
to compensate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
20039ae1d9f520d8395899d807473b638fb48688 02-Feb-2012 Rafael Espindola <rafael.espindola@gmail.com> Reject mismatched "#pragma GCC visibility push" and "#pragma GCC visibility pop".

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
745f5147e065900267c85a5568785a1991d4838f 27-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ecd7b04ae7764179d40ee4e3e49c99d1fbcb4eff 24-Jan-2012 Douglas Gregor <dgregor@apple.com> Promote the extension warning for attempts to catch a reference or
pointer to incomplete type from an ExtWarn to an error. We put the
ExtWarn in place as part of a workaround for Boost (PR6527), but it
(1) doesn't actually match a GCC extension and (2) has been fixed for
two years in Boost, and (3) causes us to emit code that fails badly at
run time, so it's a bad idea to keep it. Fixes PR11803.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f211662199c87461f3b1475a549ab439c63ca83b 24-Jan-2012 David Blaikie <dblaikie@gmail.com> Support decltype in member initializers.

This is the last piece of N3031 (decltype in weird places) - supporting
the use of decltype in a class ctor's member-initializer-list to
specify the base classes to initialize.

Reviewed by Richard Smith.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
28976604ff81048e17b4aba6f1f9bc2b29a870a3 23-Jan-2012 Nico Weber <nicolasweber@gmx.de> Eli says this should check MicrosoftMode instead.

Also change a || that I accidentally changed to && back to ||.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
afcc96a20029ac9009feefbc555a4f9d923e3e06 23-Jan-2012 Nico Weber <nicolasweber@gmx.de> In ms mode, a move assignment operator shouldn't mark a copy ctor as deleted.

MSVC2010's pair class has a move assignment operator but no explicit copy
constructor, which makes it unusable without this change.

For symmetry, let move copy constructors not mark the default assignment
operator as deleted either. Both changes match cl.exe's behavior. Fixes
pr11826.

Also update the standard excerpt to point to the right paragraph.



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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
98d3606cd5583f35ba1f8cb11bf3245dd4f7ea02 17-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Add Sema::isInitListConstructor. This will be needed for upcoming work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
62b7cfb73e202051e7ab0dad42ba213acd0dec7e 17-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Auto deduction support for std::initializer_list, including for-range support. This means you can now write:

for (int i : {1, 4, 512, 23, 251}) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
84760e3a5d885ab19b5d11aafe78dfdfe2911e3a 17-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Template argument deduction for std::initializer_list arguments from initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
395e04dbd7294bae4640aef1705cec3d052578b0 17-Jan-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Add Sema::isStdInitializerList, which will be necessary for the upcoming operations.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ef96ee0be5f100789f451641542a69cd719144d2 14-Jan-2012 Douglas Gregor <dgregor@apple.com> De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).

Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3534050c491454e4a5c7bcd0f8e6054cd89012cd 13-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11754: Reject non-static constexpr member functions in classes with virtual
base classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9ec0ef31c3bc40612e8bf47bd7d265d5e7c01ff9 13-Jan-2012 Eli Friedman <eli.friedman@gmail.com> constexpr is allowed on static member functions of non-literal classes. Per report on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dc98cd0cdd2eee8290b624ef69c6d91ce626d85e 11-Jan-2012 Kaelyn Uhrain <rikka@google.com> Fix the caching in CorrectTypo so that other non-keyword identifiers
are still added if the cached correction fails validation.

Also fix a copy-and-paste error in a comment from my previous commit.
Finally, add an example of the benefit the typo correction callback adds
to TryNamespaceTypoCorrection--which happens to also tickle the above
caching problem, as the only way a non-namespace Decl would be added to
the possible corrections is if it was cached as the correction for a
previous instance of the same typo where the typo was corrected to a
non-namespace via a different code path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7d5e6948e6a4e04ee67b607f931d90d3063579f2 11-Jan-2012 Kaelyn Uhrain <rikka@google.com> Add initial callback object support to Sema::CorrectTypo.

Also includes two examples of the callback: a wrapper/replacement for
the CorrectTypoContext enum, and a conversion of the two calls to
CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable
improvement to the typo correction, as demonstrated in the added test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
67310745f32be49d85aca83b47a7707f63a82adf 10-Jan-2012 Douglas Gregor <dgregor@apple.com> When something goes wrong in type-checking a namespace definition, make the namespace declaration invalid

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
02577fffafce0d88c7ad71502bb9e9bb628b2c0c 10-Jan-2012 Chandler Carruth <chandlerc@gmail.com> Remove a set, but unused variable. Found with GCC's warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bdad7a2e21686296b78dac6190b78d11c996f6d7 10-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update C++11 scoped enumeration support to match the final proposal:
- reject definitions of enums within friend declarations
- require 'enum', not 'enum class', for non-declaring references to scoped
enumerations


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f5c9f9fd6f5e2850b9b0f19283430245b696c6e5 07-Jan-2012 Douglas Gregor <dgregor@apple.com> Switch NamespaceDecl from its own hand-rolled redeclaration chain over
to Redeclarable<NamespaceDecl>, so that we benefit from the improveed
redeclaration deserialization and merging logic provided by
Redeclarable<T>. Otherwise, no functionality change.

As a drive-by fix, collapse the "inline" bit into the low bit of the
original namespace/anonymous namespace, saving 8 bytes per
NamespaceDecl on x86_64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6aeaa60217e1ed11a621409acf1b53df0d14b591 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Tweak the fix to PR8977: an empty expression-list represents value initialization, not default initialization. Fixes PR11712.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b701d3d0b20b00cb3b1d874a23f1e8d450f989f8 24-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Always implicitly declare move assignment operations for dynamic classes, in
case they override virtual functions from a base class. Also fix -print-stats
counting of move assignment/construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6180245e9f63d2927b185ec251fb75aba30f1cac 22-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.


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

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

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9aab9c4116bb3ea876d92d4af10bff7f4c451f24 10-Dec-2011 Douglas Gregor <dgregor@apple.com> Make sure that we infer __strong, etc. when we instantiate variables
under ARC. Fixes <rdar://problem/10530209>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
44d95b55711bc5c2e4055ebf1b5156e7fd3f0196 09-Dec-2011 David Blaikie <dblaikie@gmail.com> Provide a separate warning for weak vtables in explicit template instantiations. There's no (current) way to fix such templates to emit strong symbols/vtables, but perhaps users want to know about the cost being incurred anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f48538897ccd6726e87485267495a62fdfd0b369 28-Nov-2011 Douglas Gregor <dgregor@apple.com> When synthesizing an implicitly-defined copy or move constructor, or
when computing the exception specification of a copy or move constructor,
ignore non-static data member initializers. Fixes PR11418 /
<rdar://problem/10478642>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6fe2965ce722826ae7c3af85271f900286ef20c3 17-Nov-2011 David Blaikie <dblaikie@gmail.com> Include named unions in union member init checking

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5bbe816cd08bd28a87e8dadedf2cafb19ebf3b0b 12-Nov-2011 David Blaikie <dblaikie@gmail.com> Remove unnecessary 'else's after 'return's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
66f85713bd0d22f867efa8e9fb0037befdd6b151 07-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: static data members declared constexpr are required to have an
initializer; all other constexpr variables are merely required to be
initialized. In particular, a user-provided constexpr default constructor can be
used for such initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fb35e8f497d180e562e2e1bd8cd4b756b2d4a846 03-Nov-2011 Douglas Gregor <dgregor@apple.com> When we're checking a friend function template in an out-of-line class
definition, we may not have a scope corresponding to the namespace
where that friend function template actually lives. Work around this
issue by faking up a scope with the appropriate DeclContext.

This is a bit of a hack, but it fixes <rdar://problem/10204947>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ddb21473ef1ff20b3abf7ba3cd6cb29acbd5cf06 03-Nov-2011 Douglas Gregor <dgregor@apple.com> Don't build member initializers for zero-length or incomplete arrays,
and don't try to destroy them, either. Fixes
<rdar://problem/10228639>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5d8419c12a1ffaf710fa11fb1091f10f03f2c1dc 01-Nov-2011 Douglas Gregor <dgregor@apple.com> When we run into a constructor or destructor that is defined in the
wrong class, make sure to drop it immediately; we don't want that
constructor to be available within the DeclContext. Fixes
<rdar://problem/9677163>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2eb0ce3610a877f75e95c66d6c2bff315e127009 01-Nov-2011 Matt Beaumont-Gay <matthewbg@google.com> Silence a warning in -Asserts builds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
76852c218a207ef43583515cb835b6e855353a0f 01-Nov-2011 Douglas Gregor <dgregor@apple.com> Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0216df8fd3ce58f5a68ef2ab141ea34c96c11164 29-Oct-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed FriendDecl source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9158902bae11aec846edcf132a6dc29c834f197b 24-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> Minor refactoring of my last patch. Per Doug's suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fef2189421b89dad5582b6dd7561badd4224d974 23-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Diagnose unexpanded parameter packs in member initialisers (including
in-class member initialisers).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dc69be23b1e8e02e831d192e479bd4881382cfc5 23-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Clean up duplicated code in Sema::BuildMemInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
13c7fcceb9fd96f5be03af038ce16b05bb5e9598 22-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> c++: support gcc's application of weak attribute on
class declaration which forces any such class and any
class that inherits from such a class to have their
typeinfo symbols be marked as weak.
// rdar://10246395
A test/CodeGenCXX/weak-extern-typeinfo.cpp
M lib/Sema/SemaDeclCXX.cpp
M lib/Sema/SemaDeclAttr.cpp
M lib/CodeGen/CGRTTI.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cb8f951deacd251d9b3a73dc65f341477e039de1 20-Oct-2011 Douglas Gregor <dgregor@apple.com> There's no point in marking a declaration invalid just because it
shadows a template parameter. Complain about the shadowing (or not,
under -fms-extensions), but don't invalidate the declaration. Merely
forget about the template parameter declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ba4ee9a9b6e4cffc12bb6b395a58b89c189bb07e 20-Oct-2011 Douglas Gregor <dgregor@apple.com> When we parse something that looks like a templated friend tag but
actually just has an extraneous 'template<>' header, strip off the
'template<>' header and treat it as a normal friend tag. Fixes PR10660
/ <rdar://problem/9958322>.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f106f0ee3ba0c81d4c56f7935f518da53d78c08e 18-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> In C++11, a class's members are allowed to be nominated as friends.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5f1c822def3efffe1d8f7299fbbbc3b1cdd4833d 13-Oct-2011 Erik Verbruggen <erikjv@me.com> Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
769bb2d0dbd173589747cc8e7428a66db3b2692e 11-Oct-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Get rid of ShouldDeleteMoveConstructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c32d684d6c787b332a64c9013598d5ef668c4b45 11-Oct-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Consolidate copy constructor deletion into ShouldDeleteSpecialMember.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2c712f50cd56eaf3662989b556e9c6b1e8fcd11a 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Move some bool flags out of function parameter lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
6e4337556efa700d5b4dceac22fa0dfbd1cdee8f 10-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: Disable checking of constructor member initializer lists for
constexpr constructor templates. Such checking is optional, and currently hard
to get right since clang doesn't generate implicit member initializers until
instantiation (even for non-dependent members).

This is needed for clang to accept libstdc++ from g++4.6 in c++0x mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d24c306e693a1013b233f062291e87d49fa8a580 10-Oct-2011 Douglas Gregor <dgregor@apple.com> When adding a direct initializer to a declaration, allow the
initializer to update the type of the declaration. For example, this
allows us to determine the size of an incomplete array from its
initializer. Fixes PR10288.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
147545d698972cfd34ece30a5d55e8180784161e 10-Oct-2011 Douglas Gregor <dgregor@apple.com> Parse the initializer for a class member after handling its
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e16da07474c376fbbeda2d4238cf35e2bd664d5a 10-Oct-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Begin work consolidating ShouldDelete* functions.

Begin with just default constructors. One note is that as a side effect
of this, a conformance test was removed on the basis that this is almost
certainly a defect as with most of union initialization. As it is, clang
does not implement union initialization close to the standard as it's
quite broken as written. I hope to write a paper addressing the issues
eventually.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
883af83bd6f9b0b60b8c7a78b8682eb8ab40a4a8 10-Oct-2011 Douglas Gregor <dgregor@apple.com> Implement the restrictions in C++ [class.friend]p6, which disallow
defining a friend function with a qualified name or in a local
class. Fixes PR9853.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b5a0187b12524d2c1e6ac96e81715d1e70bbe0ad 09-Oct-2011 Douglas Gregor <dgregor@apple.com> Diagnose attempts to declare a non-static data member with a
non-identifier name. Fixes PR10839.


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

Thanks to Jeffrey Yasskin for the thorough review!



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9f569cca2a4c5fb6026005434e27025b9e71309d 01-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: semantic checking for constexpr functions and constructors. Based in
part on patches by Peter Collingbourne.

We diverge from the C++11 standard in a few areas, mostly related to checking
constexpr function declarations, and not just definitions. See WG21 paper
N3308=11-0078 for details.

Function invocation substitution is not available in this patch; constexpr
functions cannot yet be used from within constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c6d990a767150b02337de1136fdb55ccf349f4d1 29-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: semantic checking for constexpr variables.

We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier).


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6df6548e44a61c444bd85dccd0398cba047c79b1 24-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Correctly parse braced member initializers (even in delayed parsing) and correctly pass
the information on to Sema. There's still an incorrectness in the way template instantiation
works now, but that is due to a far larger underlying representational problem.
Also add a test case for various list initialization cases of scalars, which test this
commit as well as the previous one.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a120d01c66010db47332b7ca67b737fda6c2c264 23-Sep-2011 Douglas Gregor <dgregor@apple.com> When checking for weak vtables, check whether the actual definition of
the key function is inline, rather than the original
declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes
<rdar://problem/9979458>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
d836c0d379403a173ae1ede56fcad034d04a1e34 23-Sep-2011 Douglas Gregor <dgregor@apple.com> Don't finalize checking of base and member initializers for a
constructor template. Fixes PR10457.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
690b2dbde0ef9eec6b5c950b0c4c7106db37f0a5 22-Sep-2011 Douglas Gregor <dgregor@apple.com> Only trigger the initialize-an-array-via-elementwise-copy/move code
generation when we're dealing with an implicitly-defined copy or move
constructor. And, actually set the implicitly-defined bit for
implicitly-defined constructors and destructors. Should fix self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
77b6de07be9186063c12928d2e9785a5d4eecbf6 22-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying the fields passed to Sema::ActOnFields


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f250365ce65412d7d4e331fccf042b6e974c2f14 21-Sep-2011 Douglas Gregor <dgregor@apple.com> Diagnose attempts to write a templated data member, from Stepan
Dyatkovskiy! Fixes PR10896.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3f224b2efde9b02dcc78c5c85667a62dcd1f5ab3 20-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Fix a pretty nasty bug in noreturn destructors that cascaded into lots
of false positive warnings that depend on noreturn destructors pruning
the CFGs, but only in C++0x mode!

This was really surprising as the debugger quickly reveals that the
attributes are parsed correctly (and using the same code) in both modes.
The warning fires in the same way in both modes. But between parsing and
building the destructor declaration with the noreturn attribute and the
warning, it magically disappears. The key? The 'noexcept' appears!

When we were rebuilding the destructor type with the computed implicit
noexcept we completely dropped the old type on the floor. This almost
makes sense (as the arguments and return type to a destructor aren't
exactly unpredictable), but lost any function type attributes as well.
The fix is simple, we build the new type off of the old one rather than
starting fresh.

Testing this is a bit awkward. I've done it by running the
noreturn-sensitive tests in both modes, which previous failed and now
passes, but if anyone has ideas about how to more specifically and
thoroughly test that the extended info on a destructor is preserved when
adding noexcept, I'm all ears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
24dd9ad9001d1aa16223de135d7e4ed34e94b207 19-Sep-2011 Erik Verbruggen <erikjv@me.com> Removed an unused field and its accessors methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a495066d3cc094b3eb5edb4efbdb169da1f67841 19-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> In constructors, don't generate implicit initializers for members of anonymous structs contained within anonymous unions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9aca87d4b48058d56a48d62435ad6a871cc62ad1 19-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Remove function which is unused as of r139996. Thanks to David Blaikie for bringing this to my attention.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
416f63e42d4c34a38833a3aa8fa1ebb3c847722b 18-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR10304: Do not call destructors for data members from union destructors. Prior to C++11, this
has no effect since any such destructors must be trivial, and in C++11 such destructors must not
be called.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c115f630b748b2f27cff34137fb6a50b10a471a5 18-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR10954: variant members should not be implicitly initialized in constructors if no
mem-initializer is specified for them, unless an in-class initializer is specified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
e761230ae3751b525cadd8066c74ec278ee4ef57 09-Sep-2011 Douglas Gregor <dgregor@apple.com> __module_private__ is inherited by redeclarations of an entity, and
must also be present of the first declaration of that entity.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
90ab75b5ad328d2b155ec83fd4e80cd0f7af5729 09-Sep-2011 Richard Trieu <rtrieu@google.com> Changed references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to CXXBaseSpecifier, CXXCtorInitializer, NestedNameSpecifier, TemplateParameterList and removed their typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d267c57afb3af418ed5281b7a9bb4555d701a82 09-Sep-2011 Douglas Gregor <dgregor@apple.com> Modules: introduce the __module_private__ declaration specifier, which
indicates that a declaration is only visible within the module it is
declared in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f81e5a9e3f3ff80c56e4afb4fe6311a8735f36e8 09-Sep-2011 Richard Trieu <rtrieu@google.com> Change all references of type ExprTy to Expr and get rid of the typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b2b5658a8e4ad566303ec98caceaa3485e7635f7 06-Sep-2011 Douglas Gregor <dgregor@apple.com> When performing a derived-to-base cast on the right-hand side of the
synthesized move assignment within an implicitly-defined move
assignment operator, be sure to treat the derived-to-base cast as an
xvalue (rather than an lvalue). Otherwise, we'll end up getting the
wrong constructor.

Optimize a direct call to a trivial move assignment operator to an
aggregate copy, as we do for trivial copy assignment operators, and
update the the assertion in CodeGenFunction::EmitAggregateCopy() to
cope with this optimization.

Fixes PR10860.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
74e611a5fd0b5977c664d13a07b625ae23527d0d 04-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Add test case for defaulted copy and move structure validation.
Fix bug this uncovered.
Address minor comments from Doug.
Enable cxx_implicit_moves feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bf3380a317ab09ae7f23c1bc17cb562f8175a986 03-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Teach -Wdangling-field to warn about temporaries bound to references as
well.

Also, clean up the flow of the code a bit, and factor things more
nicely.

Finally, add the test case that was missing from my previous
commit (sorry), with new tests added to cover temporaries and other fun
cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
81c6477bcd39b6b1a0a7d9c38da5ab8cbb6ea565 03-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Add a simple new warning to catch blatantly dangling pointer and
reference members of classes. We've had several bugs reported because of
this, and there's no reason not to flag it right away in the compiler.

Comments especially welcome on the strategy for implementing this
warning (IE, what should trigger this?) and on the text of the warning
itself.

I'm going to extend this to cover obvious cases with temporaries and
beef up the test cases some in subsequent patches. I'll then run it over
a large codebase and make sure its not misbehaving before I add it to
-Wall or turn it on by default. I think this one might be a good
candidate for on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
45d3d716622f12f9d8e77f2e4c8ffddf4bfe3559 01-Sep-2011 Douglas Gregor <dgregor@apple.com> When defining the implicit move assignment operator, don't perform
semantic analysis when taking the address of an xvalue. Instead, just
build the unary operator directly, since it's safe to do so (from the
IRgen and AST perspectives) for any glvalue. Fixes PR10822.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1155c42e7b1b4e401bb0a331a6d715d637958c75 31-Aug-2011 Douglas Gregor <dgregor@apple.com> Allow C99 hexfloats in C++0x mode. This change resolves the standards
collision between C99 hexfloats and C++0x user-defined literals by
giving C99 hexfloats precedence. Also, warning about user-defined
literals that conflict with hexfloats and those that have names that
are reserved by the implementation. Fixes <rdar://problem/9940194>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
85ea7aa961deac1d754f610af8062ae3f8b4e2a5 30-Aug-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Declare and define implicit move constructor and assignment operator.

This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
af1fc7af351758b0ea0d285bdfe5640128109a4e 15-Aug-2011 Richard Smith <richard-llvm@metafoo.co.uk> Track in the AST whether a function is constexpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
af0f4d0b2e38c810effc8b024ad2fb6604eec5d3 14-Aug-2011 Francois Pichet <pichet2000@gmail.com> Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.

Example:
template <class T>
class A {
public:
template <class U> void f(U p) { }
template <> void f(int p) { } // <== class scope specialization
};

This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
136da1c4320156fe8924139f58fbeed2e32cc6e8 10-Aug-2011 Douglas Gregor <dgregor@apple.com> When adding the base and member initializers for an implicitly-defined
special member function, make sure to classify an explicitly-defaulted
copy constructor as a "copy" operation. Fixes PR10622.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4dc41c9b766140b507980a13acccf2f05ed19cd3 10-Aug-2011 Douglas Gregor <dgregor@apple.com> Rewrite default initialization of anonymous structs/unions within a
constructor. Previously, we did some bogus recursion into the fields
of anonymous structs (recursively), which ended up building invalid
ASTs that would cause CodeGen to crash due to invalid GEPs.

Now, we instead build the default initializations based on the
indirect field declarations at the top level, which properly generates
the sequence of GEPs needed to initialize the proper member. Fixes
PR10512 and <rdar://problem/9924046>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6b167f4fc40477847687c004b73166f53eeda8da 09-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Don't emit memcpy for copying fields of arrays of volatile elements.
Use the the path that generates a loop. This fixes
bogus error that clang puts out. // rdar://9894548



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dfe6543e12eca5c79421378b7fa6b3e8fc403e63 28-Jul-2011 Douglas Gregor <dgregor@apple.com> Lazily deserialize Sema::VTableUses. Plus, fix the utterly and
completely broken deserialization mapping code we had for VTableUses,
which would have broken horribly as soon as our local-to-global ID
mapping became interesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0129b561a1452bf057f6b18b6a1de815d487ab81 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Turn Sema::DelegatingCtorDecls into a LazyVector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
402785357ab053dd53f4fdd858b9630a5e0f8bad 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Mechanically rename SourceManager::getInstantiationLoc and
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
4110e1399bf940317cee58d6a48a92f7b7a4ce54 21-Jul-2011 Eric Christopher <echristo@apple.com> Speculatively revert 135649 to bring back the g++ testing bots.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
98c6bda3be11b78a10026f142a399aa1918900f2 21-Jul-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> When copping out on a friend template declaration, be sure to mark its
access specifier as public.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ff6f8f038f32d85c32fd984673cea51ef737b22 20-Jul-2011 Richard Smith <richard-llvm@metafoo.co.uk> Replace r134583's fix for PR10290 with one which also works for non-value-dependent cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e7003b72e691c4d83ba5516c58bccc2f2a4b3fe0 13-Jul-2011 Douglas Gregor <dgregor@apple.com> Eliminate an incomplete/incorrect attempt to provide support for C++0x
unrestricted unions, which ended up attempting to initialize objects
in a union (which CodeGen isn't prepared for). Fixes PR9683.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
98a5403ecf1d2b60ae8cbf43e54194bd762cacaa 12-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a bug where a local variable named 'self' is causing
implicit ivar accesses to go through the 'self' variable
rather than the real 'self' for the method. // rdar://9730771


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cdb8076dd9cfb975a1bcb3e7cb58a59648c35af0 11-Jul-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed PR10243.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c41b878b24bf9619d5351b05d7088221dfbe9447 06-Jul-2011 Douglas Gregor <dgregor@apple.com> Don't try to type-check a copy construction of an exception
declaration with dependent type. Fixes PR10232 /
<rdar://problem/9700653>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9a30c9946e898e595eb71f23dc9a60303428998b 05-Jul-2011 Douglas Gregor <dgregor@apple.com> ActOnCXXConditionDeclaration should take into account that
ActOnDeclarator can return NULL. Fixes PR10270, from Hans Wennborg!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
db7abf78dedc2ef6ccb42b3dac6ab330fe2ea469 28-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the call to GetTypeForDeclarator in Sema::ActOnCXXConditionDeclaration.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1ab0d90af489b5441d0bf25338d420ddae3ece74 25-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix a couple more issues related to r133854:

When performing semantic analysis on a member declaration, fix the check for whether we are declaring a function to check for parenthesized declarators, declaration via decltype, etc.

Also fix the semantic check to not treat FuncType* as a function type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cf5abc7ba032bd35158e4d75b0bc92a482fc67e8 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Support for catching objc pointer objects in c++ catch-statement
in fragile abi mode and some other cleanups. // rdar://8940528



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9d96bce991048fd2337cf058ec6a6a722207cbf2 22-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Alloa catching Objective-C id's being thrown with C++ throw
in Darwin's fragile abi mode. // rdar://8940528


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
1ccbc546d01d0ee2bce5d1e3de0888c9c6d65f35 22-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Ensure that we delete implict copy members when explicit move members
are also present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
661c67a9227708056850403847a10395308705e5 22-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Attempt to reapply this patch for caching copy assignment operator
lookup. Previously, it was breaking self-host, but it's been a week and
a half and I can't reproduce, so I need to see if it's still failing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4857947d18a7d0d0c250892fc5597ec0aecc9823 21-Jun-2011 NAKAMURA Takumi <geek4civic@gmail.com> De-Unicode-ify in comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b77115d7b988f55f961e24129a62f20dfd066a94 17-Jun-2011 John McCall <rjmccall@apple.com> When synthesizing implicit copy/move constructors and copy/move assignment
operators, don't make an initializer or sub-operation for zero-width
bitfields.




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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3bde0ce7a18d2513ebe286df67baa32700fd3d6b 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> This change is breaking selfhost. Revert it until I have more time
to study it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
53e669f4bd617dc4df1b1850bcd3998d7680bdc5 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement caching of copy assignment operator lookup.

I believe, upon, careful review, that this code causes us to incorrectly
handle exception specifications of copy assignment operators in C++03
mode. However, we currently do not seem to properly implement the subtle
distinction between copying of members and bases made by implicit copy
constructors and assignment operators in C++03 - namely that they are
limited in their overload selection - in all cases. As such, I feel that
committing this code is correct pending a careful review of our
implementation of these semantics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c530d1758cef1acc596f2ec905665da534e66d29 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement caching for copy constructors in similar situations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b320e0c322fb71d6235ebca9ec22940a97bdcdc7 10-Jun-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement caching of default constructors on the resolution table. This
isn't yet used for the less controlled environments of initialization.

Also a few random text fixups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
9ae60d54e4454192384933f3020968ea5c8c3540 26-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a new warning for when adding a default argument to a method
makes it into a special member function. This is very bad and can lead
to all sorts of nastiness including implicit member functions violating
the One Definition Rule. This should probably be made ill-formed in a
later version of the standard, but for now we'll just warn.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ffe37fdda5b4b4f162a45155c30d9f60ce110c12 25-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a little bit of cleanup and a lot more of the base work
behind implicit moves. We now correctly identify move constructors and
assignment operators and update bits on the record correctly. Generation
of implicit moves (declarations or definitions) is not yet supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cd10dec673680fd18a2e5a27646173780c059d32 24-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb88ae5f9acdd17ec76fb83e151a77e25e4e8f31 23-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Correctly propagate defaultedness across template instantiation. This
fixes PR9965, but we're not out of the water yet, as we do not
successfully handle out-of-line definitions, due to my utter
misunderstanding of how we manage templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b2ee8305f878259613b65d0f96a03f7f852977ea 23-May-2011 Francois Pichet <pichet2000@gmail.com> Emulate a MSVC bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.

Example:
class A { public: int f(); };
class B : public A { private: using A::f; };
class C : public B { private: using B::f; };

Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it.

This fixes 1 error when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e3406826db726960ede77dd18361eb327d30c108 20-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Add a missing case for default constructor deletion.

This case is tested by the fact that the modified test produces
significatly worse diagnostics. That's on the list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b7ec906b189f71ab35825bdb60fb1f6c4c40880b 20-May-2011 Douglas Gregor <dgregor@apple.com> Downgrade the error about re-opening an inline namespace as non-inline
to a warning, since apparently libstdc++'s debug mode does this (and
we can recover safely). Add a Fix-It to insert the "inline", just for kicks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ee33912f8ec3453856c8a32ed2c2e8007bed614 19-May-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Reapply r121528, fixing PR9941 by delaying the exception specification check for destructors until the class is complete and destructors have been adjusted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
493ff72fa7c7b43ab5a8edddb5762d7b745bb2ab 18-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> After consultation with doug, revert r131515.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1d78032167c2f2d470e4270aadcb07ff71e6c7e1 18-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert r121528 as it breaks a simple testcase, which leads to, among
other things, libcxx not building.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0320a1d7b3305d1aef36ee68b77bebe170e1d30a 18-May-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Implement implicit exception specifications of destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
71a682f98a1e79c84e95e45f94041bcd7a694ef5 18-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement an additional fix for infinite recursion of deleted special
member functions by making sure that they're on the record before
checking for deletion.

Also make sure source locations are valid to avoid crashes.

Unfortunately, the declare-all-implicit-members approach is still
required in order to ensure that dependency loops do not result in
incorrectly deleting functions (since they are to be deleted at the
declaration point per the standard).

Fixes PR9917

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d02fec890e147a7726410108d4b1d74a842fc9ff 18-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Force declaration of implicit members in C++0x mode.

I hear at least one person crying out in anguish, but it's unfortunately
necessary to avoid infinite loops with mutually dependent constructors
trying to call each other and determine if they are deleted.

It might be possible to go back to the old behavior if we can implement
part-of-file lookups efficiently, or if a solution is discovered by
which we can safely detect and avoid infinite recusion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
be63122e65ea06010c4ce06a77276bcb29a575b6 17-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fix some minor bugs and add a lot more test cases for defaulted
constructors, including two more FIXMEs (one of which I don't actually
understand).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1f2f384eb7d0ea368819fe9cc4cc20a4b337ebea 17-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement some tests for defaulted constructors. To do this I had to
suppress an error we were previously emitting on valid union code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2b188085eccf741a9520ba86f1e6e32d0e0cd3f2 14-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> What I hope to be an implementation of defaulted copy assignment
operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7f410191f344dc26aa926de6593fdacaad9fd1a7 14-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> More progress towards defaulted copy assignment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
30de05c228d5d38dbfdeeeb598cb960646bf998a 14-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Start implementing defaulted copy assignment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
daebfef4b8c035d139f4b7d6f75be02b7a2c6218 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fix copy constructor deletion detection with array types.

This fixes PR9910

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
49634cf3b9b0c3da2aedc3bdefbf331bce167239 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Defaulting copy constructors now works reasonably well.

One more special member to go

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e4246a633b13197634225971b25df0cbdcec0c5d 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Properly parse the 'default' and 'delete' keywords.

They are actually grammatically considered definitions and parsed
accordingly.

This fixes the outstanding bugs regarding defaulting functions after
their declarations.

We now really nicely diagnose the following construct (try it!)

int foo() = delete, bar;

Still todo: Defaulted functions other than default constructors
Test cases (including for the above construct)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
ca46d131aa40ae953d719b096cb951b385787445 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement deletion of explicitly defaulted default constructors.

We still don't parse out-of-line defaults correctly, which is needed to
get the full effect out of this patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a6bff2caf90d769e0b6bfe59c3e7f16ef8402e5a 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Commit some missing changes to the previous patch.

This means we get C++0x jump-across-intializer semantics correct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cdee3fee8ca4df7fb9179f29cc3ba96ac4fd0f95 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement implicit deletion of default constructors.

Yes, I'm aware that the diagnostics are awful.

Tests to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f961ea5716867b5e426fb2136edd6d1f04c3a7ca 10-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Re-do R131114 without breaking code.

I've edited one diagnostic which would print "copy constructor" for copy
constructors and "constructor" for any other constructor. If anyone is
extremely enamored with this, it can be reinstated with a simple boolean
flag rather than calling getSpecialMember, which is inappropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c840649ed5acccf68e1bc5a9d22f2ea017074586 10-May-2011 Douglas Gregor <dgregor@apple.com> Reimplement Sema::MatchTemplateParametersToScopeSpecifier() based on
the semantic context referenced by the nested-name-specifier rather
than the syntactic form of the nested-name-specifier. The previous
incarnation was based on my complete misunderstanding of C++
[temp.expl.spec]. The latest C++0x working draft clarifies the
requirements here, and this rewrite is intended to follow that.

Along the way, improve source location information in the
diagnostics. For example, if we report that a specific type needs or
doesn't need a 'template<>' header, we dig out that type in the
nested-name-specifier and highlight its range.

Fixes: PR5907, PR9421, PR8277, PR8708, PR9482, PR9668, PR9877, and
<rdar://problem/9135379>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
680404e0d91ac67c91097af6c62bc92f1fba5965 10-May-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 131114. This fixes PR9884.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
001cad932380419c6fbfecbeec63e0579f5ecbf3 10-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Further implement defaulting constructors.

Focus is on default constructors for the time being. Currently the
exception specification and prototype are processed correctly. Codegen
might work but in all likelihood doesn't.

Note that due to an error, out-of-line defaulting of member functions is
currently impossible. It will continue to that until I muster up the
courage to admit that I secretly pray to epimetheus and that I need to
rework the way default gets from Parse -> Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a780da70f74ab09ed1f91c1e992abf850e5268ea 10-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> The last of the trivial constructor changes, make CXXSpecialMember
reflect our new, more accurate AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
37b8c9ee7cf2b4d5ce3ccd3be1fcadd18a783a57 09-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Clean up trivial default constructors now.

hasTrivialDefaultConstructor() really really means it now.

Also implement a fun standards bug regarding aggregates. Doug, if you'd
like, I can un-implement that bug if you think it is truly a defect.

The bug is that non-special-member constructors are never considered
user-provided, so the following is an aggregate:

struct foo {
foo(int);
};

It's kind of bad, but the solution isn't obvious - should

struct foo {
foo (int) = delete;
};

be an aggregate or not?

Lastly, add a missing initialization to FunctionDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
010157f9dbce11706c96229cf17f1da9e2a39d73 07-May-2011 Douglas Gregor <dgregor@apple.com> When checking for a prior declaration of the name of a namespace, skip
any names that aren't in the appropriate identifier namespaces. Fixes
an embarrassing bug where we give a redefinition error due to an
Objective-C category (<rdar://problem/9388207>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bb85f8edca8103aa10e4b2f4a6fcc3a251b0ea03 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
10620eb5164e31208fcbf0437cd79ae535ed0559 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Modify some deleted function methods to better reflect reality:

- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)

This fixes the bug that we weren't catching

void foo() = delete;
void foo() {}

as being a redefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fe2695eec167b28578825576863228f86b392f24 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Do defaulted constructors properly.

Explictly defaultedness is correctly reflected on the AST, but there are
no changes to how that affects the definition of functions or much else
really.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5f802e51406664ca9b6e0d57fc7ce37ea97a1c65 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert r130912 in order to approach defaulted functions from the other
direction and not introduce things in the wrong place three different
times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3e4c6c4c79a03f5cb0c4671d7c282d623c6dc35e 05-May-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++0x alias templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ad7ec12ef2edbadb85a3754f0395ef2f06d4256c 05-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement some framework for defaulted constructors.

There's some unused stuff for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c1598700010cea9364a58a65e967b0b56361b6aa 05-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Change cycle detection to be based off of a warning flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ebcbe1d3dc7d4f0c1f540a632fa0684dd0a857d5 05-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> there i fixed it

Increase robustness of the delegating constructor cycle detection
mechanism. No more infinite loops on invalid or logic errors leading to
false results. Ensure that this is maintained correctly accross
serialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fe57eef44cc80e5bb51e4f484835be08b8d84256 04-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a better version of delegating constructor cycle detection.

This is more efficient as it's all done at once at the end of the TU.
This could still get expensive, so a flag is provided to disable it. As
an added bonus, the diagnostics will now print out a cycle.

The PCH test is XFAILed because we currently can't deal with a note
emitted in the header and I, being tired, see no other way to verify the
serialization of delegating constructors. We should probably address
this problem /somehow/ but no good solution comes to mind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fa74c2344addf92826c938758fb4dc612a004eb9 04-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Ensure that delegating constructor loop detection uses canonical
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b76af9c969558b4484be87933e89e76e7ee87e21 04-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Ensure that destructors are properly inovked when an exception leaves
the body of a delegating constructor call.

This means that the delegating constructor implementation should be
complete and correct, though there are some rough edges (diagnostic
quality with the cycle detection and using a deleted destructor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
01aacc024673e84181ae687ff1c65ab65e10571a 03-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Move the AST modifications to after the cycle detection in
lib/Sema/SemaDeclCXX.cpp to avoid getting stuck in an infinite loop. See
the comment for more explanation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b79bf1db7adc8ed3172ee89db04428b65bf40693 02-May-2011 Nick Lewycky <nicholas@mxc.ca> Remove unused variable, but keep function call with side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
58a2cd8c0d52e710cbcc57a67eac7b51b0b831c4 24-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Synthesizing the definition of an implicit member is an AST modification, so notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
788440378c442562497c09610939cbe6218ab43d 23-Apr-2011 Douglas Gregor <dgregor@apple.com> At the end of the translation unit, defining a vtable can introduce
new templates that need to be instantiated and vice-versa. Iterate
until we've instantiated all required templates and defined all
required vtables. Fixed PR9325 / <rdar://problem/9055177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b65abda449dfb17aba39794be6ce41111d40fda0 22-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't enter a qualified scope for an invalid decl.

Fixes assertion later on. rdar://9122937 & http://llvm.org/PR9459

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cf320c6388c90f1938c264e87d77a0e43946e2c3 22-Apr-2011 Francois Pichet <pichet2000@gmail.com> For consistency, change suffix from war_ to warn_ for some Microsoft warnings I introduced lately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
162e1c1b487352434552147967c3dd296ebee2f7 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Support for C++11 (non-template) alias declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8cf9049185c72dc453ebb946d39420f3f78dec76 10-Apr-2011 Francois Pichet <pichet2000@gmail.com> Refactor 129240 to merge the old default argument into the new parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d051e00ad674754d476cc1fa0442da0bc47b2c8 10-Apr-2011 Francois Pichet <pichet2000@gmail.com> MSVC accepts that default parameters be redefined for member functions
of template class. The new value is ignored.

This fixes 1 error when parsing MSVC 2010 header files with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
2166948cc721b138b3aaf4358d28ec2dada22901 02-Apr-2011 Nico Weber <nicolasweber@gmx.de> Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a non-header file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3334b0b13ad3bf568a16cda29434b18d084f6dcb 28-Mar-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix PR9572 and neighboring lurking crashers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1d71cbf21ad8882192d0d88a76f0243b7cf490c9 27-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Reduce indentation using early exits and add a couple of comments. No
functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9172aa685f3a1cbf991a2c1cd40905e4d64bfdf6 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Improve -Wheader-hygiene to warn about using directives inside linkage
specifications within the global scope, from Elliot Glaysher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1d20927fd0a08c26ef0e86e26f42073fd582ff77 25-Mar-2011 Anders Carlsson <andersca@mac.com> Fixup comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128280 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2c3ee54e51d835a35bbf781c69e17f39e2ba0480 25-Mar-2011 Anders Carlsson <andersca@mac.com> Get rid of handling of the 'explicit' keyword from class-head. We still parse it though, although that will change shortly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
909a70d8a185f701c20bacc3c76f8f5979cbbc7c 25-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Apply the nonnull attribute to constructor expressions too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2b32dad701ef3e666e3b9cea02e1d094a1078c6f 24-Mar-2011 Anders Carlsson <andersca@mac.com> Add a new warning for exit-time destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
80558d2db10a96eada4d8fb79949b3263b44652b 20-Mar-2011 David Chisnall <csdavec@swan.ac.uk> Fix Objective-C++ exceptions (GNU runtime).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6a49bb69fadcb04119433278c808797a87d2d31 18-Mar-2011 Douglas Gregor <dgregor@apple.com> Add an opt-in -Wheader-hygiene, which current diagnoses the use of
global using directives in C++ headers, from Elliot Glaysher!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7f0a915eb546d353071be08c8adec155e5d9a0dc 18-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed inconsistency when adding TemplateParameterListsInfo.

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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f9c32eb0f80f991cbb3fc3e403759f39929f7994 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Revert "Disable delegating constructors for 2.9"
It is only meant for the release branch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9d0af360ec510c06967afd7a23b202ce5bad7301 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Disable delegating constructors for 2.9

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
caa35e4bbfccaaa6c4d69f29b3f1a8b544b3645e 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Revert "Disable inherited constructors for 2.9."
It is only meant for the release branch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a808c544f9df4d17cb189ba6aa167478cf17ad4a 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Disable inherited constructors for 2.9.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
796aa443ab5ed036f42ef33fed629e1b4b34871b 12-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Forgotten part of previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f4e3cfbe8abd124be6341ef5d714819b4fbd9082 11-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for the OpenCL vec_step operator, by generalising and
extending the existing support for sizeof and alignof. Original
patch by Guy Benyei.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c57c17dced5fb16a83a2ffb2b7e8c148df69ba5a 10-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Avoid do drop outer template parameter lists on the floor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f52516038ab5d0b1b90a6dd32f46b7d6dabd04c8 08-Mar-2011 Douglas Gregor <dgregor@apple.com> Teach libclang's token-annotation logic about context-sensitive
keywords for Objective-C+ and C++0x.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a2026c96d3935e7909e049ad9096762844544ed6 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source range for declarations using postfix types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
acba90f30876b4140b738f0d3dd0e50724053a96 08-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed NamespaceDecl source range.

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

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c54061a679d8db4169438b2f97f81e3f443c6a25 04-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Move private structs into anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0266aa37802a486e65f9259014bb60848fc4be23 03-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Woverloaded-virtual shouldn't warn for static functions. Fixes rdar://9083431 & http://llvm.org/PR9396.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
55a9637969260ca7eb66011732094b33f049c52a 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Removed left brace location from LinkageSpecDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5f6bcbebedb85ee745cbd9a3ca51ca8c766a6117 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed end source location for LinkageSpecDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9e876876afc13aa671cc11a17c19907c599b9ab9 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Reinstate the introduction of source-location information for
nested-name-speciciers within elaborated type names, e.g.,

enum clang::NestedNameSpecifier::SpecifierKind

Fixes in this iteration include:

(1) Compute the type-source range properly for a dependent template
specialization type that starts with "template template-id ::", as
in a member access expression

dep->template f<T>::f()

This is a latent bug I triggered with this change (because now we're
checking the computed source ranges for dependent template
specialization types). But the real problem was...

(2) Make sure to set the qualifier range on a dependent template
specialization type appropriately. This will go away once we push
nested-name-specifier locations into dependent template
specialization types, but it was the source of the
valgrind errors on the buildbots.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2786864406af0f3ec65b300675c6f3c809c22fd7 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Revert r126748, my second attempt at nested-name-specifier source
location information for elaborated types. *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
be38c5f5d8fa7c43c52fafddee054b8fe8c2b964 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Reinstate r126737, extending the generation of type-source location
information for qualifier type names throughout the parser to address
several problems.

The commit message from r126737:

Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
44cd9f9d686dfdb9ad16113c41c2dca1da35a646 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Revert r126737, the most recent nested-name-specifier location change, for buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
239cbb023c8da689e7722f7146914eed9755e368 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2494dd024b392b8def58bf067cc94b51c214cf77 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into
DependentNameTypeLoc. Teach the recursive AST visitor and libclang how to
walk DependentNameTypeLoc nodes.

Also, teach libclang about TypedefDecl source ranges, so that we get
those. The massive churn in test/Index/recursive-cxx-member-calls.cpp
is a good thing: we're annotating a lot more of this test correctly
now.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
0cfaf6a270ecd0f5c7e541a8047c87948317548b 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into namespace
aliases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
db9924191092b4d426cc066637d81698211846aa 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into using directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dc355713be51fcb4ee52d9fd6b4548ceff47fadf 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Update UsingDecl, UnresolvedUsingTypenameDecl, and
UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the
extremely-lossy NestedNameSpecifier/SourceRange pair it used to use,
improving source-location information.

Various infrastructure updates to support NestedNameSpecifierLoc:
- AST/PCH (de-)serialization
- Recursive AST visitor
- libclang traversal (including the first tests of this
functionality)



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

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7019186f3c05539698b589a59729b0adfb8ea0a1 23-Feb-2011 Douglas Gregor <dgregor@apple.com> When checking for abstract types, don't crash when we have a
FunctionProtoTypeLoc with NULL function parameter types, which can
occur in invalid code. Fixes PR9247 / <rdar://problem/9037911>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
483b9f3bc05c5409e2c6643f1c9d91e21c8ff9d2 21-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Tweaks to C++0x deduced auto type support:
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
* Temporary template parameter list for auto deduction is now allocated on the stack.
* Deduced 'auto' types are now uniqued.



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

This fixes PR 8738, 9060 and 9132.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f4b793ceb60418b64d3593ba3c8240e3594bff8f 19-Feb-2011 Douglas Gregor <dgregor@apple.com> Teach the virtual-functions-without-virtual-destructor warning to only
warn about polymorphic classes (which have virtual functions) rather
than dynamic classes (which are polymorphic or have virtual bases).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
45f11b78750590b1b1bcec6746c7639a256ce2a2 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Fix PR8767, improve diagnostic wording when allocating an object of an
abstract class type.

Patch by Stephen Hines, with a wording tweak from Doug applied by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e996ffd240f20a1048179d7727a6ee3227261921 16-Feb-2011 John McCall <rjmccall@apple.com> Save a copy expression for non-trivial copy constructions of catch variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b25b295fdfc443bdf060e860a21f6f01d9fbdc18 15-Feb-2011 John McCall <rjmccall@apple.com> Return a declaration to the parser when creating a field in C++ so that
the parser will complete the declarator with a valid decl and thus trigger
delayed diagnostics for it. It certainly looks like we were intentionally
returning null here, but I couldn't find any good reason for it, and there
wasn't a comment, so farewell to all that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eee1d5434ebfa955ffc3c493aecd68bb7b3f4838 14-Feb-2011 John McCall <rjmccall@apple.com> When parsing an out-of-line member function declaration, we must delay
access-control diagnostics which arise from the portion of the declarator
following the scope specifier, just in case access is granted by
friending the individual method. This can also happen with in-line
member function declarations of class templates due to templated-scope
friend declarations.

We were really playing fast-and-loose before with this sort of thing,
and it turned out to work because *most* friend functions are in file
scope. Making us delay regardless of context exposed several bugs with
how we were manipulating delay. I ended up needing a concept of a
context that's independent of the declarations in which it appears,
and then I actually had to make some things save contexts correctly,
but delay should be much cleaner now.

I also encapsulated all the delayed-diagnostics machinery in a single
subobject of Sema; this is a pattern we might want to consider rolling
out to other components of Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7502c1d3ce8bb97bcc4f7bebef507040bd93b26f 13-Feb-2011 John McCall <rjmccall@apple.com> Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
74b47f9173ccd2c22686b8fbf9d69852d6f46ac6 10-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For -Woverloaded-virtual take into account canonical methods. Fixes rdar://8979966 & http://llvm.org/PR9182.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1faa89f9c619e4b2411fab4af7e22ee7a2bd9009 05-Feb-2011 Anders Carlsson <andersca@mac.com> Re-land r124768, with a fix for PR9130.

We now emit everything except unused implicit virtual member functions when building the vtable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
799ef666685d6c97d64d1970a6f68bf7923360c2 03-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -Woverloaded-virtual.

The difference with gcc is that it warns if you overload virtual methods only if
the method doesn't also override any method. This is to cut down on the number of warnings
and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423.
If we want to warn that not all overloads are overriden we can have an additional
warning like -Wpartial-override.

-Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
01de7a44cea9f77cbcda65faad8edc8b48a3b617 03-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 124768.
This reopens PR99114, but that one at least can be avoided with an #include.
PR9130 cannot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aedd9d5ad3cc776fd61457050bcd54cac4c5ea66 03-Feb-2011 Anders Carlsson <andersca@mac.com> Don't try to mark virtual members referenced for classes where the key function
is not defined in the current translation unit. Doing so lead to compile errors
such as PR9114.

Instead, when CodeGen is building the vtable, don't try to emit a definition
for functions that aren't marked used in the current translation unit.
Fixes PR9114.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
668fdd8578c85aa2692ffdeb7614acabf1aaab25 02-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for -Wnon-virtual-dtor for dependent classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9641fc8e43f53b1ae8ed7742017e0a320d75fa8a 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Only warn for -Wnon-virtual-dtor for public destructors. Thanks to Benjamin Kramer for the hint!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
def4e2a405a15eb8381ca305725285d27a4bab65 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn if the class has virtual methods but non-virtual destructor. Addresses rdar://8756445.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6d7f8473cd6e967b3676948894ce72472102f9cb 30-Jan-2011 Anders Carlsson <andersca@mac.com> When building with optimizations, emit vtables where the key is not in the
current translation unit as available_externally.

This helps devirtualize the second example in PR3100, comment 18:

struct S { S() {}; virtual void xyzzy(); };
inline void foo(S *s) { s->xyzzy(); }
void bar() { S s; foo(&s); }

This involved four major changes:

1. In DefineUsedVTables, always mark virtual member functions as referenced for
non-template classes and class template specializations.
2. In CodeGenVTables::ShouldEmitVTableInThisTU return true if optimizations are
enabled, even if the key function is not implemented in this translation
unit. We don't ever do this for code compiled with -fapple-kext, because we
don't ever want to devirtualize virtual member function calls in that case.
3. Give the correct linkage for vtables where the key function is not defined.
4. Update the linkage for RTTI structures when necessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
70a21de5b4c6ca4883ed58093e71e7884d5218fb 28-Jan-2011 Douglas Gregor <dgregor@apple.com> Allow elision of invocations of move constructors from temporary objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c938c1668b4fd12af154e965dd935a89e4801a70 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Rvalue references for *this:

- Add ref-qualifiers to the type system; they are part of the
canonical type. Print & profile ref-qualifiers
- Translate the ref-qualifier from the Declarator chunk for
functions to the function type.
- Diagnose mis-uses of ref-qualifiers w.r.t. static member
functions, free functions, constructors, destructors, etc.
- Add serialization and deserialization of ref-qualifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a5c6c2a84cde5c9b8f8ec0610a9f89ffd54f44ee 25-Jan-2011 Anders Carlsson <andersca@mac.com> Don't insert class templates into the DynamicClasses vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cb88a1f968c3d4eb451dafb421a8d9578edcbf1a 24-Jan-2011 Anders Carlsson <andersca@mac.com> Use attributes for all the override control specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f89e0424b8903438179f4a2f16dddd5e5bdc814e 23-Jan-2011 Anders Carlsson <andersca@mac.com> Get rid of the [[final]] C++0x attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aa23d288be658cca59d2e128954a50e9ada4ef27 22-Jan-2011 Anders Carlsson <andersca@mac.com> Implement [class.derived]p8.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dfc2f1035d23e294b298766a3cf51dfe249d53a2 22-Jan-2011 Anders Carlsson <andersca@mac.com> Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2e1c730167d2b978c66558c029d163ffe64b9656 20-Jan-2011 Anders Carlsson <andersca@mac.com> Diagnose when a virtual member function marked final is overridden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3ffe183448af7c543a208dd3313a49c83a3ad53e 20-Jan-2011 Anders Carlsson <andersca@mac.com> When checking for functions marked override, ignore dependent contexts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4ebf1605166e0b6cc967a51429949a0722f79665 20-Jan-2011 Anders Carlsson <andersca@mac.com> Make CheckOverrideControl a member of Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9e682d9f567a51f26c3b0673837e23bafdb09c11 20-Jan-2011 Anders Carlsson <andersca@mac.com> Diagnose virtual member functions marked override but not overriding any virtual member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aae5af24f031ad5f17872bd8b27ed5c175c0f90c 20-Jan-2011 Anders Carlsson <andersca@mac.com> Only allow virtual member functions to be marked 'override' and 'final'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
69a87357310260c4b2c5dce2cdcd10c3fd3a0a58 20-Jan-2011 Anders Carlsson <andersca@mac.com> Pass the VirtSpecifiers along to Sema::ActOnCXXMemberDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6952f1e4256c5b43aee5e98cea4e9b663bd1d413 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for non-type template parameter packs whose type is
a pack expansion, e.g., the parameter pack Values in:

template<typename ...Types>
struct Outer {
template<Types ...Values>
struct Inner;
};

This new implementation approach introduces the notion of an
"expanded" non-type template parameter pack, for which we have already
expanded the types of the parameter pack (to, say, "int*, float*",
for Outer<int*, float*>) but have not yet expanded the values. Aside
from creating these expanded non-type template parameter packs, this
patch updates template argument checking and non-type template
parameter pack instantiation to make use of the appropriate types in
the parameter pack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2998d6b0e6d5476c473f68012a851fe4a0f609c8 19-Jan-2011 John McCall <rjmccall@apple.com> When building the copy expression for a __block variable, make sure
there's a respectable point of instantiation. Also, make sure we do
this operation even when instantiating a dependently-typed variable.



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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cbb67480094b3bcb5b715acd827cbad55e2a204c 08-Jan-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
more accurate, and makes it make sense for it to hold a delegating constructor
call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
97fcc4977b21da43ab106607ad472149b7d4785a 08-Jan-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Check for delegating constructors and (currently) return an error about them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3fb9e4b89f72823f162096086f0f964e6dcf66d6 04-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement pack expansion of base initializers, so that we can
initialize those lovely mixins that come from pack expansions of base
specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f90b27ad077c3339b62befc892382845339f9490 03-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement pack expansions whose pattern is a base-specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6fb0729241ab204e9bed9a5ff2f5bd396db111d4 21-Dec-2010 Douglas Gregor <dgregor@apple.com> When checking a using declaration, make sure that the context we're
looking in is complete. Fixes PR8756.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a669c534cf414339060868d70d2348fea9ce6c7d 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Add tests checking for unexpanded parameter packs in declarations that
occur within statements. Teach Sema::ActOnExceptionDeclarator() to
check for unexpanded parameter packs in the exception type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6f52675ec400a0ee89ec6214c4845b8ee274304a 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a31040f16604849b3b1dc36015056c81bae68ad1 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs within variable initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6ccab97c17c17f38eb92c7fe02c766508875bd97 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in friend declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
56c04588ef3cfa1bbc968fd68de2480a4e66971d 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in using declarations. As a
drive-by, make sure to check for unexpanded parameter packs within the
name of a declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
399ad970a25efcbfa7111e17f48285a70fba2731 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in static assertion expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0827408865e32789e0ec4b8113a302ccdc531423 15-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix diagnostic pragmas.

Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

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



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



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



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aee543a1a3d70de38cd2607fd2f3179551febc93 12-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Move the functionality to mark all vtables of key functions as used within
a translation unit to the ActOnEndOfTranslationUnit function instead of doing
it at the start of DefineUsedVTables. The latter is now called *recursively*
during template instantiation, which causes an absolutely insane number of
walks of every record decl in the translation unit.

After this patch, an extremely template instantiation heavy test case's compile
time drops by 10x, and we see between 15% and 20% improvement in average
compile times across a project. This is just recovering a regression, it
doesn't make anything faster than it was several weeks ago.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
075f8f1b6bed4d1b224c74f87508534cc6392ce6 10-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added ParenType type node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
90f1450c109fbbd333001165bbd986061f7c4513 10-Dec-2010 John McCall <rjmccall@apple.com> Treat visibility on an enclosing namespace as a non-explicit source of
visibility. Fixes PR8713.

I've disabled a test which was testing that you can #pragma pop visibility
to get out of a namespace's visibility attribute. We should probably just
diagnose that as an error unless it's instrumental to someone's system
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
53c374f1ac6d28b2341b3a8f3902eb51db9c50e7 07-Dec-2010 Douglas Gregor <dgregor@apple.com> Use Sema::MaybeCreateExprWithCleanups() only after we've checked for a NULL/invalid expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
894aed964fae942b62326881dc106801dabfd04c 06-Dec-2010 Chandler Carruth <chandlerc@gmail.com> Un-templatetize this method. It's definition is out of line in the .cpp file,
so that's not a valid thing to do at all. Instead, switch to a ValueDecl
argument, the template isn't really necessary here.

When handling the types explicitly in the code, it becomes awkward to cerate
the CXXBaseOrMemberInitializer object in so many places. Re-flow the code to
calculate the Init expression first, and then create the initializer. If this
is too gross, we can factor the init expression logic into helper functions,
but it's not past my threshold yet.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
00eb3f9c5b33e3d99aee1f8b75dd9c9678fdd66b 04-Dec-2010 Francois Pichet <pichet2000@gmail.com> More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:

struct X {
X() : au_i1(123) {}
union {
int au_i1;
float au_f1;
};
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8a72621a019a0b3ae793b1f5fc6da2243476979f 29-Nov-2010 John McCall <rjmccall@apple.com> Revert r120063, it was wrong.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6bb4dcb412d53d05a80017df81d41e447e2aa3ea 28-Nov-2010 Nico Weber <nicolasweber@gmx.de> Minor whitespace and comment fixes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fe4ea55700c806493bebbf7bbfe07ce4b7339a3e 23-Nov-2010 John McCall <rjmccall@apple.com> Redeclarations of using declarations are not okay in function scopes.
Not sure what I was thinking before.

Fixes PR8668.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
9c4eb1f3438370355f51dc8c62f2ca4803e3338d 19-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactoring.
Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope.

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



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8113ecfa4e41e2c888b1794389dfe3bce6386493 10-Nov-2010 Ted Kremenek <kremenek@apple.com> Region-allocate all AttributeList objects from a factory object instead of manually managing them
using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these
objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up.

This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList
objects and then blows them away all at once. While conceptually simple, most of the changes in
this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications.

This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser
object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList
objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its
underlying allocator as we enter/leave key methods in the Parser. This means that we get
simple memory management while still having the ability to finely control memory use if necessary.

Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic
in many large files with attributes.

This fixes the leak reported in: <rdar://problem/8650003>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
78b810559d89e996e00684335407443936ce34a1 10-Nov-2010 John McCall <rjmccall@apple.com> Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former. Fixes PR8022.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7d64271b162eaf5cae264ff64465b28af623dc17 09-Nov-2010 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
90ba6d5cf790c98231c93a63a5b1f7c6a95bd6b6 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Fix source locations in unnamed bitfield diagnostic, from Jakub
Wieczorek! Fixes PR8025.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
464b2f0ab31f6de8761f76f6754809f9746f4584 05-Nov-2010 Douglas Gregor <dgregor@apple.com> Check for an invalid field earlier in a constructor's initialization
of that field. Otherwise, we can end up building and later trying to
instantiate a dependent member initializer that will fail at
instantiation time.

Unfortunately, I've only managed to trigger this bug with very large
sources, so there's no test case :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
fe7574b3adc7b38e70dc4ecd335e8c9b38ab549f 22-Oct-2010 Douglas Gregor <dgregor@apple.com> When performing name lookup for a namespace definition, only look into
the current context's redeclaration context, ignoring using
directives. Fixes PR8430.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b41d899a6023385c00a61eb9dd3e44db9dc7994e 21-Oct-2010 Craig Silverstein <csilvers2000@yahoo.com> Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9a34edb710917798aa30263374f624f13b594605 19-Oct-2010 John McCall <rjmccall@apple.com> Redirect templated friend class decls to a new Sema callback and
construct an unsupported friend when there's a friend with a templated
scope specifier. Fixes a consistency crash, rdar://problem/8540527


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
be04b6df363f083f51636efcf4a8be4c5e8ea038 16-Oct-2010 John McCall <rjmccall@apple.com> Reformatting.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6102ca1d490836096678d7d934f0b2b78f9293ec 16-Oct-2010 John McCall <rjmccall@apple.com> White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't. Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a6e937ce32474934778346f4d51c3beec40e77ec 15-Oct-2010 Douglas Gregor <dgregor@apple.com> Diagnose C++ [class.mem]p13-14, where a class member has the same name
as the class itself. Fixes PR7082.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b6bbcc9995186799a60ce17d0c1acff31601653a 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8a407370c37229f2b69fe643850959b98899c28a 15-Oct-2010 John McCall <rjmccall@apple.com> template-ids are looked up differently in friend declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
922fff2c9ef458fc04839e45a79552513f41ec7e 14-Oct-2010 Douglas Gregor <dgregor@apple.com> Generalize the checking for qualification of (non-friend) class
members. Provide a hard error when the qualification doesn't match the
current class type, or a warning + Fix-it if it does match the current
class type. Fixes PR8159.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
380aaa44213c7ddff95117a30d5c6cec05a911d5 13-Oct-2010 John McCall <rjmccall@apple.com> Preserve the original scope when picking the right scope for a friend
declaration, because we'll need it later. Hopefully fixed self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
29ae6e5fb001deddd831e66faf143ecd9e50f67c 13-Oct-2010 John McCall <rjmccall@apple.com> Support friend function declarations in local classes correctly.
Fixes a crash and diagnoses the error condition of an unqualified
friend which doesn't resolve to something. I'm still not certain how
this is useful.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
337ec3d0e8cb24a591ecbecdc0a995a167f6af01 13-Oct-2010 John McCall <rjmccall@apple.com> Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them. Fixes a crash, this time
without a broken test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8cfb7a39caa44797522773cf417ad9c1a6ffbc6f 12-Oct-2010 Douglas Gregor <dgregor@apple.com> If we end up instantiating a function parameter whose default argument
has not yet been parsed, note that the default argument hasn't been
parsed and keep track of all of the instantiations of that function
parameter. When its default argument does get parsed, imbue the
instantiations with that default argument. Fixes PR8245.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
edd59112ab812ad498b8cc29ad2b6e2b90de787a 06-Oct-2010 Nick Lewycky <nicholas@mxc.ca> Silence unused variable warning in Release builds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
175ffbf7db893181b301e201c561ac928266f4be 06-Oct-2010 Anders Carlsson <andersca@mac.com> When checking for uninitialized fields in member initializers, special case static variables and enums. Fixes PR8075.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e80622fd48261b6e5c7e6629dcfee2f76b124487 29-Sep-2010 Douglas Gregor <dgregor@apple.com> Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7a39dd01edc43aa5f058e7259a39737fc1f43792 29-Sep-2010 Douglas Gregor <dgregor@apple.com> Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2138664dd2cff39de52ff11ca35f653c20b2e4b0 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit in
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
85606ebf3dd1b5dd81a59ef25b5ad47627664774 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2cf9d656f6283f2a8be0549da110d7cfbb1ea4b2 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9fe183ae1ec568716501f861235afecebee8cd45 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Reinstate r114921, which I've exonerated via a self-host build.

Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2a674e8e443b7a3e77957078248fb52b3b1ec321 28-Sep-2010 Bill Wendling <isanbard@gmail.com> Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e10288c1e9e06dbd715f47bfaa22ce5d65fdf096 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4a74df5901330c577d0a30d052338d06bbf9e279 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cdbfa6c4113411debfed9ffec2a45bd50b13e10f 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6e3c7713ca126c76053cc092670a949a5e15ddaf 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ed2e0823cc7b727abd9307db4cd887f293eebe2 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
27c08ab4859d071efa158a256f7e47e13d924443 28-Sep-2010 Douglas Gregor <dgregor@apple.com> Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5c0646b98b203d105c10ad8cc11be11cc99a4218 27-Sep-2010 Douglas Gregor <dgregor@apple.com> Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().

This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ff8819be64c53d71dcc0200ece9b2738041c80e2 21-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Do not warn with -Wuninitialized when the member is used in a sizeof or address-of expression.
Fixes rdar://8331312.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4ada9d3aa47d66e4074229fb93f24416526a15e8 20-Sep-2010 Douglas Gregor <dgregor@apple.com> Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ae79222014a7a90a2c2d4a04e67deac0012a0461 18-Sep-2010 John McCall <rjmccall@apple.com> static local variables with destructors don't require a global destructor
unless we're on a platform without __cxa_atexit (or use thereof has been
disabled). This patch actually just disables the check completely for
static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to
track the platform-specific fix.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1034170d053b2600dc435a128be88d76e6f988cf 13-Sep-2010 Douglas Gregor <dgregor@apple.com> Fix a typo noted by Gabor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
da0fd9a7faa8b8a666e3c31ff0b5897e0f73f892 12-Sep-2010 Douglas Gregor <dgregor@apple.com> Don't complain about useless user-defined conversion functions when
they were instantiated from a template. In template metaprogramming,
stuff happens. Fixes PR8065.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
83cb94269015bf2770ade71e616c5322ea7e76e1 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Simplify template instantiation for C++ exception declarations,
eliminating an unnecessary use of TemporaryBase in the process.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
36281c6fd792a254ade72caf825bad7b7c63b0e0 08-Sep-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c465e6494d16a19127873dc9bdc55177ac6b6fd 03-Sep-2010 John McCall <rjmccall@apple.com> Devirtualize Sema, kill off DeleteExpr and DeleteStmt, and reformat.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4e4d57069cf9402728e05f7fc856295a86e4801f 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Enable inline namespaces in the AST.

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

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

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

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

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

Fixes rdar://7637185

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d078e641450bbc5a20df8d3b54f87b27e398acb3 28-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Parser support for inline namespaces

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
ea318642072d3d94b5c3cff0fa6f4b33d2db0768 26-Aug-2010 John McCall <rjmccall@apple.com> Move things around so that Sema.h no longer depends on even DeclBase.h.
It still depends on Type because DeclarationName.h does.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
384aff8b94bb0d1ad6c5667b90621e5699815bb2 25-Aug-2010 John McCall <rjmccall@apple.com> Remove Sema.h's dependency on DeclCXX.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
50df6ae41f232612e5e88b19e0db9900d08d2f6c 25-Aug-2010 John McCall <rjmccall@apple.com> Remove the DenseSet dependency from Sema.h.



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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3a91abf311dcc399944882004f3e0b29489d31c7 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Diagnose the presence of multiple initializations of static data
members, from Faisal Vali! Fixes PR6904.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
b8f7de94c3a8fb4556d06a1447880e69bc3a113c 22-Aug-2010 Douglas Gregor <dgregor@apple.com> Do not elide copy construction when we're performing base-class initialization

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d226f65006733ed7f709c3174f22ce33391cb58f 21-Aug-2010 John McCall <rjmccall@apple.com> DeclPtrTy -> Decl *



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2c18bb7c9fca66c30b6eabbdcbc6399d24a54fa9 20-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> objective-c ivar refactoring patch. Iterations
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
72c4c15e030cabf71cffc899ca779a251bcc72d1 20-Aug-2010 Douglas Gregor <dgregor@apple.com> Revert r111609, which is failing its new test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
29c695b86199ce917fd59b875683960a1858342a 20-Aug-2010 John McCall <rjmccall@apple.com> Detect efforts to declare a template member friend and explicitly ignore them.
Avoids a crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
21e09b63df2e1cc1e18749839bf21a6adb9a5b3a 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Fix the source range of an anonymous namespace, from Jan Bierbaum

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

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

Some other notes about newly-generated attribute classes:

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9b7d6701dabc24387cc152e4d13bf9aec6aa461a 18-Aug-2010 Chris Lattner <sabre@nondot.org> zap dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
94c3b561a4f24c5c44a1e2ee6f28f530e6a041ba 18-Aug-2010 John McCall <rjmccall@apple.com> Rip out the existing retroactive abstract-class usage checker,
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class. Also, look into templates when doing this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
881b36ccbf8eaee709e7763369062a52f5961df1 16-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix initialization for members of anonymous struct in a union.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
ef3dce817d43faadbf21ce9102d33a9d84b02e09 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName inside UsingDecl.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0d30a87e124bb0273fedce3b62401039073fdece 08-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7800: both virtual and non-virtual bases must be marked as used for VTTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
a834888ecc3ea36ea78a585209f422c7730d437a 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the DeclaredInCondition bit now that it's no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
58e5539df7d9d1f003912fccb8d524d4f2c6846a 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove a redundant and broken check. Fixes PR7810.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
15442825bb2c3f2cc48f3ed753d172beb8ed1232 04-Aug-2010 John McCall <rjmccall@apple.com> Only look up an 'operator delete' on the definition of a destructor, not on
a declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4204f07fc8bffe6d320b2de95fea274ccf37a17b 02-Aug-2010 John McCall <rjmccall@apple.com> Further adjustments to -Wglobal-constructors; works for references and direct
initializations now.



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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
626e96e2874698a6736fd33672fa9c28da91d77e 01-Aug-2010 John McCall <rjmccall@apple.com> Make a first pass at implementing -Wglobal-constructors. I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
35f9a196ef897b9559de25aaecd957208f0b4f59 30-Jul-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed typedef inside extern "C".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5606220447c7901ba8d80147ddab893bb7949dd5 26-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add source location information to C++ base specifiers.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9557f5387a6b3f4636101298d0cf029538b60ded 24-Jul-2010 Eli Friedman <eli.friedman@gmail.com> Remove dead code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0f2b97d1b0bfbcec727a386dc9e5cf06051cb29b 24-Jul-2010 Eli Friedman <eli.friedman@gmail.com> PR7698: Make sure we correctly handle the initialization of an array with
dependent size.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5a180397870944548aaadeaebf58e415885b9489 24-Jul-2010 John McCall <rjmccall@apple.com> Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.
Diagnose attempts to do this under the GNU or fragile NeXT runtimes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
09acc9863fe422dc83725f77991bf80551664ada 08-Jul-2010 Douglas Gregor <dgregor@apple.com> A using declaration can redeclare a typedef to the same type. These
typedefs won't have the same canonical declaration (since they are
distinct), so we need to check for this case specifically. Fixes
<rdar://problem/8018262>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
06a54a38be5054c910ffc92db60edab23f9ea105 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
af57280ff8f5df43c413becfbf2415e0cdce9437 06-Jul-2010 Douglas Gregor <dgregor@apple.com> Remove my egregious hack that forced deserialization of visible
declarations when implicitly declaring the default constructor, copy
constructor, destructor, and copy-assignment operators of a
class. Argiris fixed the underlying problem in r107596.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5efd91a3b58e59006f8a3e8c9256ec00c38dba95 03-Jul-2010 John McCall <rjmccall@apple.com> Mark the operator delete associated with a virtual destructor as referenced.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1827403a7138946305c0058f262e02b595cf882f 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

4/159 implicit default constructors created
18/236 implicit copy constructors created
70/241 implicit copy assignment operators created
0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
225843186e3972ce798d3de00f86da9008b15a0e 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare implicit copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a376d10acfacf19d6dfa41069f7929739a18dd7a 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare copy-assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4923aa25eb39d64106a5817c02d560a3aecf8b2c 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare the implicitly-declared destructor in a C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
23c94dbb6631fecdb55ba401aa93722803d980c6 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Move the "current scope" state from the Parser into Action. This
allows Sema some limited access to the current scope, which we only
use in one way: when Sema is performing some kind of declaration that
is not directly driven by the parser (e.g., due to template
instantiatio or lazy declaration of a member), we can find the Scope
associated with a DeclContext, if that DeclContext is still in the
process of being parsed.

Use this to make the implicit declaration of special member functions
in a C++ class more "scope-less", rather than using the NULL Scope hack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
eb8c670d2949eb62005eca36c64c9461f2a2173e 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Provide exception specifications for implicitly-declared default constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
32df23e749f12a1eaf2a8c7a31e6e69ad0ec64d8 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Move the implicit declaration of a default constructor into a separate
routine; no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0d405db2d847acba979a74d747894bcf4d580fe3 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Provide exception specifications for implicitly-declared copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fabd43a5e3e9e5b8950ea7d110bbf1cd962365c0 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Move the implicit declaration of a constructor out to a separate
method. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
598a8543ec4c22e7f0a27e7ff2cf7e49cfa4e4ff 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Teach DeclareImplicitCopyConstructor how to cope with virtual bases
and multi-dimensional array fields. Fixes several bugs found by
inspection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4a0c26f57ffe685dfc795f04eaef9b805997b65e 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Move declaration of a class's implicit copy constructor into a
separate function. Aside from making the loops infinitely faster, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b87786f045d798b070980c108c922e1475d27b15 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Provide an exception-specification for an implicitly-declared
copy-assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d3c359041bce38e2a117b82a5bb37eba7f68b0c8 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Move the implicit declaration of a class's copy-assignment operator
into a separate routine. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4681ca84003bd52efbe05995a5a6853e4d9d6a60 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Make loops infinitely faster. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
d92ec474faeb6133e0d41f0de4526b22778476f2 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate fix for PR7526, which was failing because, now that we
aren't dropping all exception specifications on destructors, the
exception specifications on implicitly-declared destructors were
detected as being wrong (which they were).

Introduce logic to provide a proper exception-specification for
implicitly-declared destructors. This also fixes PR6972.

Note that the other implicitly-declared special member functions also
need to get exception-specifications. I'll deal with that in a
subsequent commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4b662a5684d41ea4ff6b52711929e00fefb00db1 01-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert r107374, which broke bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2fef752aebece6786e5f3d54984272ef85564af8 01-Jul-2010 Douglas Gregor <dgregor@apple.com> When building the type of a destructor, make sure to keep the
exception specification. Fixes PR7526.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e861c60bde74cf495447f50844d7ee7ea3a8a7a0 30-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Reapply r107235, this time with both my typo fixed, and a logical bug fixed.
Previously we relied on the presence of a member which needs no initialization
to prevent us from creating an additional initialization of the outer anonymous
union field. We have already correctly marked that field as initialized by the
member of the union (repeatedly due to the original bug this patch fixes) so we
simply need to bail out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ec29b352b7ab2a2e99f7a9b78ce27c5e2a08d0e1 30-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Revert r107235, it had a silly typo in it, and fixing the typo breaks something
else. Get the build bots happy while I debug. Very sorry for the delay fixing
this...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e9c9d15ef9429257136564c5bab76dbe286e37c7 30-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR7402: We were creating implicit member initializers for every field in an
anonymous union under the presumption that they didn't do anything. While this
is true, our checks for redundant initialization of an anonymous union still
fire when these overlap with explicit user initialization. A cleaner approach
is to avoid initializing multiple members of a union altogether, but this still
is in a rather fuzzy are especially when C++0x allows non-POD types into
unions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f186b54cc68e13a819736a54bc11d37179029154 30-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Retain the source location of the constructor when building an implicit member
initialization. I tried several ideas but couldn't come up with a test case for
this that didn't rely on a Clang bug to report a diagnostic after template
instantiation of the constructor due to the implicit initializers. Suggestions
welcome. This fixes the source location aspect of PR7402.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
12eb5d6aa882eb247a6c22225b625eee04217105 29-Jun-2010 Douglas Gregor <dgregor@apple.com> When typo correction produces a result that is not of the kind we're
looking for, reset the name within the LookupResult structure in
addition to clearing out the results. Fixes PR7508.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0e8c4b9fac447c6c9849e3ef8beb1ef273ac0f97 29-Jun-2010 Douglas Gregor <dgregor@apple.com> Typo correction for namespace alias definitions

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c070cc602d6eefea881f71a60de09e05b54c3fdd 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8e2eab27056a78bf1db50ee09929438ed5ea9d93 16-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixed conflict between objc_memmove_collectable builtin
decl. and one ddefined in darwin header file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3956b1ab303139d9e952c2c30ed16643fad0c325 16-Jun-2010 Douglas Gregor <dgregor@apple.com> If a non-dependent base class initializer fails to match any direct or
virtual base class, but the class still has dependent base classes,
then don't diagnose the failed match as an error: the right base class
might magically appear. Fixes PR7259.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ad00b7705f9bbee81beeac428e7c6587734ab5a6 16-Jun-2010 John McCall <rjmccall@apple.com> Fix a point of semantics with using declaration hiding: method templates
introduced by using decls are hidden even if their template parameter lists
or return types differ from the "overriding" declaration.

Propagate using shadow declarations around more effectively when looking up
template-ids. Reperform lookup for template-ids in member expressions so that
access control is properly set up.

Fix some number of latent bugs involving template-ids with totally invalid
base types. You can only actually get these with a scope specifier, since
otherwise the template-id won't parse as a template-id.

Fixes PR7384.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ff2d05f653948e4bb2877c210f9fa7a2888ceb5c 16-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Workaround a possible VS C++ bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
55bcace250e1ff366e4482714b344b8cbc8be5f3 16-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Patch adds support for copying of those
objective-c++ class objects which have GC'able objc object
pointers and need to use ObjC's objc_memmove_collectable
API (radar 8070772).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
43ad182474fac1e9d68ea4d1bcb80f8f9720245d 15-Jun-2010 Nick Lewycky <nicholas@mxc.ca> When analyzing for member self-assignment, don't attempt to dereference null
Stmt* such as those which occur in ?: . Fixes PR7378.

Also, generally whip the code into shape fixing several coding style violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6206d53f67613958ae1b023aba337ebb46f11a8b 05-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added AccessSpecDecl node.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4bde1e13d39e43581f7da872e4d7676ebf4a3ee7 04-Jun-2010 John McCall <rjmccall@apple.com> Delay checking for mutable const fields until we're checking the field.
Allows this check to work properly for instantiated fields and removes
an unnecessary GetTypeForDeclarator call.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ffdb2d2a8860c601b35575855494f45d85cf14d9 03-Jun-2010 Anders Carlsson <andersca@mac.com> Add all final overriders to the map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9da9cdfd5ac5fcbb8c6a9fc38938e845e53af1ed 28-May-2010 John McCall <rjmccall@apple.com> When filtering out previous declarations of friend functions, consider the
lookup context, not the direct semantic context. Fixes PR7230.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aeb4a28256a924d57b111842647cbd40ab67f6f0 27-May-2010 Douglas Gregor <dgregor@apple.com> Tweak the fix-it for a copy constructor declared to take its argument
by-value. We now only prepend a space if it is needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4142cebf70fe6c3855570c98b8042431797a65fd 26-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes misc. flexible array bugs in c++ (PR7029).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a0af3b453160fc4c67363c204da13820b0586909 26-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added source order to CXXBaseOrMemberInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b9aefa775158b68c453e4ac0e4e2ada561900d26 25-May-2010 Daniel Dunbar <daniel@zuster.org> IRgen/C++: When mark vtables used, make sure to still append to the VTableUse array if we promote a vtable from being just used to having its definition required. This ensures that we properly inform the consumer about whether the vtable is required or not, previously we could fail to do so when the vtable was in the VTableUses array before the decl which marked it as required.
- I think this can be cleaned up, since this means we may notify the consumer about the vtable twice, but I didn't see an easy fix for this without more substantial refactoring.
- Doug, please review!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e669f89e613029d4e21869b90f6d3f6cd299ff2a 25-May-2010 Daniel Dunbar <daniel@zuster.org> Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fb2db4657dc1e305c98d0c48fb1009a9f65b337a 22-May-2010 Douglas Gregor <dgregor@apple.com> Don't look for a destructor in a dependent type. Fixes PR7198.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fe2d379dbf570d49dc5d98a086cf43c4e675f5ce 21-May-2010 Douglas Gregor <dgregor@apple.com> Fix a crasher in constructor-initializer reordering warnings (PR7179).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ed5c5d90d89563265a408d8c9d8953f0cea036e 21-May-2010 Fariborz Jahanian <fjahanian@apple.com> Generate objc_memmove_collectable write-barrier for
classes whose base class have GC'able object pointers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f1860e5c381a2710fcebe6d55d799c6b25c21041 21-May-2010 John McCall <rjmccall@apple.com> Be sure to apply initializers to members of anonymous structs and unions
recursively, e.g. so that members of anonymous unions inside anonymous structs
still get initialized. Also generate default constructor calls for anonymous
struct members when necessary.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
68dd3ee3b5ae5b7694b4a21e34b4355431ed0457 20-May-2010 Douglas Gregor <dgregor@apple.com> Various small fixes for construction/destruction of Objective-C++
instance variables:
- Use isRecordType() rather than isa<RecordType>(), so that we see
through typedefs in ivar types.
- Mark the destructor as referenced
- Perform C++ access control on the destructor


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9614dc0f76af9707a07d656056d2ec08cdd04b3a 17-May-2010 Fariborz Jahanian <fjahanian@apple.com> Don't attempt to poke into an invalid field's class type
to mark its destructors as referenced which may cause
a crash. Fixes radar 7896920


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ca4aa379fcae53c50760cdf3632d8d801b795046 14-May-2010 Douglas Gregor <dgregor@apple.com> A vtable is used if the key function is defined... even if that key
function's definition is an out-of-class definition marked
"inline". Fixes an assertion in WebKit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
face9818b52a6d47e4aa055a4bfcd435aed6010f 13-May-2010 Chris Lattner <sabre@nondot.org> improve comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c63d2c8469d6b96712b324f76b4af07e1852313f 12-May-2010 Douglas Gregor <dgregor@apple.com> When we emit an error during the implicit definition of a special
member function (default constructor, copy constructor, copy
assignment operator, destructor), emit a note showing where that
implicit definition was required.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a97badf8a59368d69dea7e24b18e72c482f055a0 07-May-2010 Douglas Gregor <dgregor@apple.com> It turns out that we should be allowing redeclarations within function
scope. Thanks to Steven Watanabe for correcting me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
13c8577201e4fc0ddac5f09d05fd1778832137d1 06-May-2010 Douglas Gregor <dgregor@apple.com> Partial and full specializations of a class template may have a
different tag kind ("struct" vs. "class") than the primary template,
which has an affect on access control.

Should fix the last remaining Boost.Accumulors failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
60a8fbb4242e2535ccddd1fa2d8257ec1bf749c2 06-May-2010 Douglas Gregor <dgregor@apple.com> When implicit definition of the copy-assignment operator fails,
provide a note that shows where the copy-assignment operator was
needed. We used to have this, but I broke it during refactoring.

Finishes PR6999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fb8cc253420e93cee33d29df5a2bdae6aaf16e39 05-May-2010 Douglas Gregor <dgregor@apple.com> Reimplement code generation for copying fields in the
implicitly-generated copy constructor. Previously, Sema would perform
some checking and instantiation to determine which copy constructors,
etc., would be called, then CodeGen would attempt to figure out which
copy constructor to call... but would get it wrong, or poke at an
uninstantiated default argument, or fail in other ways.

The new scheme is similar to what we now do for the implicit
copy-assignment operator, where Sema performs all of the semantic
analysis and builds specific ASTs that look similar to the ASTs we'd
get from explicitly writing the copy constructor, so that CodeGen need
only do a direct translation.

However, it's not quite that simple because one cannot explicit write
elementwise copy-construction of an array. So, I've extended
CXXBaseOrMemberInitializer to contain a list of indexing variables
used to copy-construct the elements. For example, if we have:

struct A { A(const A&); };

struct B {
A array[2][3];
};

then we generate an implicit copy assignment operator for B that looks
something like this:

B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { }

CodeGen will loop over the invented variables i0 and i1 to visit all
elements in the array, so that each element in the destination array
will be copy-constructed from the corresponding element in the source
array. Of course, if we're dealing with arrays of scalars or class
types with trivial copy-assignment operators, we just generate a
memcpy rather than a loop.

Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes
all of its regression tests.

Conspicuously missing from this patch is handling for the exceptional
case, where we need to destruct those objects that we have
constructed. I'll address that case separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6cdc161527a513f28dfc6f6ec27eb287f8268024 04-May-2010 Douglas Gregor <dgregor@apple.com> When creating a call to a base subobject's operator= in an
implicitly-defined copy assignment operator, suppress the protected
access check. This eliminates the remaining failure in the
Boost.SmartPtr library (that was a product of the copy-assignment
generation rewrite) and, presumably, the Boost.TR1 library as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3d6c1782c4fc2ed3e6a924c15042edb1f56fee36 04-May-2010 John McCall <rjmccall@apple.com> When inheriting a default argument expression, inherit the full expression,
not just the inner expression. This is important if the expression has any
temporaries. Fixes PR 7028.

Basically a symptom of really tragic method names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
324b54d3f60d92a82815512119791ce1c285b63e 03-May-2010 Douglas Gregor <dgregor@apple.com> Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
62b71f489ec9735cfaa379ee604d0e12dde78975 03-May-2010 Douglas Gregor <dgregor@apple.com> When creating the declaration reference for implicit copy-construction
of a base class, give it real source-location information. Fixes PR7017.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ae374759fce6c74d5be29dfe058d4a727154115c 03-May-2010 Douglas Gregor <dgregor@apple.com> When declaring a namespace alias, ignore previous declarations that
aren't in scope. Fixes PR7014.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d56638180014e60538cd666cd11fde6d4698e051 03-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Replace a char*/size pair with stringref.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
06a9f3680d22529a2fcf20c52d71cf221d99d910 01-May-2010 Douglas Gregor <dgregor@apple.com> Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

- For a class subobject, call the appropriate copy-assignment
operator, after overload resolution has determined what that is.
- For an array of scalar types or an array of class types that have
trivial copy assignment operators, construct a call to
__builtin_memcpy.
- For an array of class types with non-trivial copy assignment
operators, synthesize a (possibly nested!) for loop whose inner
statement calls the copy constructor.
- For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
59b7f1538d9d4c4f7c3932e3e3f95d2cb0fca7e4 01-May-2010 Anders Carlsson <andersca@mac.com> When defining implicit copy constructors, use SetBaseOrMemberInitializers to initialize the bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
39957dce3df743023906926b40108d99bc8b0ce2 01-May-2010 Douglas Gregor <dgregor@apple.com> Added an RAII object that helps set up/tear down the Sema context
information required to implicitly define a C++ special member
function. Use it rather than explicitly setting CurContext on entry
and exit, which is fragile.

Use this RAII object for the implicitly-defined default constructor,
copy constructor, copy assignment operator, and destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
77bb1aa78bcd26e42c0382043e65a2b03242be4d 01-May-2010 John McCall <rjmccall@apple.com> It turns out that basically every caller to RequireCompleteDeclContext
already knows what context it's looking in. Just pass that context in
instead of (questionably) recalculating it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e4498c6d66a8f472cba29b6158a2e86dfc60d0ef 28-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More of Sema to implement initialization of
ivar of c++ object types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
110acc1ae8d978f9b423394eaf0cace61b1339f0 27-Apr-2010 John McCall <rjmccall@apple.com> Improve the diagnostic you get when making a qualified member access
with a qualifier referencing a different type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8e142ccf1196c9ae31f10f9caa97670e343971e7 25-Apr-2010 Anders Carlsson <andersca@mac.com> Revert enough of my patches to fix self-host again :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8f2abbc791bad003f5d190e70b01d7eafa2a7be1 25-Apr-2010 Anders Carlsson <andersca@mac.com> Add an explicit UsuallyTinyPtrVector that takes a single element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e127abe8bbcff7fef0326d68731bc178182a9990 25-Apr-2010 Anders Carlsson <andersca@mac.com> DefineImplicitCopyConstructor now uses SetBaseOrMemberInitializers to create implicit base initializers. (Member initializers are still handled by CodeGenFunction::SynthesizeCXXCopyConstructor for now).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c795750b29c923b3bb08eb8b93a44f1bc7646e98 25-Apr-2010 Anders Carlsson <andersca@mac.com> When building implicit base initializers, add a derived-to-base cast that points to the exact base specifier.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
63010a7f0f57a27a9735b5a75211c6d988be2074 23-Apr-2010 Anders Carlsson <andersca@mac.com> Cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f6513edbb783bb465987033934a68af5c1ded25b 23-Apr-2010 Anders Carlsson <andersca@mac.com> Handle copy initialization in BuildImplicitMemberInitializer. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e5ef740266891d8f68f35c8365b3142608f36a5f 23-Apr-2010 Anders Carlsson <andersca@mac.com> Add an ImplicitInitializerKind enum and pass it to BuildImplicitBaseInitializer and BuildImplicitMemberInitializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
114a297ef02a722b3afcd719210c060811d431e0 23-Apr-2010 Anders Carlsson <andersca@mac.com> Fix a think-o that broke self-host.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ddfb75f22d89c773ade4fa0df1e3a99d8b125d40 23-Apr-2010 Anders Carlsson <andersca@mac.com> Factor code to initialize an implicit member out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
defefd28a91c03466b1b6dfce84cc0b10e71a1bf 23-Apr-2010 Anders Carlsson <andersca@mac.com> Remove calls to isDependentContext, since we handle that case earlier in the code. Make BuildImplicitBaseInitializer return a boolean instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3b8c53b619c1c3d77632734d227566071459b9f5 22-Apr-2010 Anders Carlsson <andersca@mac.com> Re-land the patch that merges two diagnostics into one now that it passes self-host :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
128317e6a0b020966f7392aa850b24cfe43bc163 22-Apr-2010 Anders Carlsson <andersca@mac.com> Remove an unused declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
84688f2a21bfde3cfdf1c41a053ef7b774d4cd0c 21-Apr-2010 Anders Carlsson <andersca@mac.com> Factor some common code out into a separate function.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
046c294a43024874ff35656c6e785b64e72f1f36 17-Apr-2010 Anders Carlsson <andersca@mac.com> Vtable -> VTable renames across the board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
1deea66124bafea261b45be2849b02210aadf6b3 16-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c0b39640de335809ca7544f802751112619f30cc 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Audit uses of Sema::LookupSingleName for those lookups that are
intended for redeclarations, fixing those that need it. Fixes PR6831.

This uncovered an issue where the C++ type-specifier-seq parsing logic
would try to perform name lookup on an identifier after it already had
a type-specifier, which could also lead to spurious ambiguity errors
(as in PR6831, but with a different test case).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c83c6874e3bf1432d3df5e8d3530f8561ff5441f 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Feed proper source-location information into Sema::LookupSingleResult,
in case it ends up doing something that might trigger diagnostics
(template instantiation, ambiguity reporting, access
reporting). Noticed while working on PR6831.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
325e593a83b20d9bce3628aa78fda983b554814e 15-Apr-2010 Douglas Gregor <dgregor@apple.com> Warn about non-aggregate classes with no user-declared constructors
that have reference or const scalar members, since those members can
never be initializer or modified. Fixes <rdar://problem/7804350>.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d1fed3e8595a15edd7e14cee166ef90634fcf141 13-Apr-2010 Douglas Gregor <dgregor@apple.com> During referencing binding, only consider conversion functions for
direct reference binding when the source and target types are not
reference-related. Fixes PR6066.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3d04336baf091b16e9d8f85b48b82dafd2695874 13-Apr-2010 John McCall <rjmccall@apple.com> Allow classes to befriend implicitly-declared members. Fixes PR6207 for
members of non-templated classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a3f8137d9f7cd1af7a6cbe736b9419f7eb99e86c 13-Apr-2010 John McCall <rjmccall@apple.com> Diagnose declarations of conversion functions with declarators other than '()'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6275e0cac39b76204644154fd99a449f57c589d4 12-Apr-2010 Douglas Gregor <dgregor@apple.com> When creating the implicitly-declared special member functions, be
sure to introduce them into the current Scope (when we have one) in
addition to the DeclContext for the class, so that they can be found
by name lookup for inline members of the class. Fixes PR6570.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
80638c5e6395344c1e6096542b0ff3b8bfb2139e 12-Apr-2010 Anders Carlsson <andersca@mac.com> Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3c3ccdbe73cb43bdf39a9102f5f7eb842fb71952 10-Apr-2010 John McCall <rjmccall@apple.com> Diagnose more cases of initializing distinct members of an anonymous union
member. Use a better diagnostic for this case. Also fix a bug with nested
anonymous structs/unions for -Wreorder; this last was PR6575.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6ca8da0f5a4115813055729faaa5128e994806d 10-Apr-2010 John McCall <rjmccall@apple.com> Diagnose misordered initializers in constructor templates immediately instead of
when they're instantiated. Merge the note into the -Wreorder warning; it
doesn't really contribute much, and it was splitting a thought across diagnostics
anyway. Don't crash in the parser when a constructor's initializers end in a
comma and there's no body; the recovery here is still terrible, but anything's
better than a crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fd2254405de977dcc706a4dc7775c44a4218a27b 09-Apr-2010 John McCall <rjmccall@apple.com> Suppress access control diagnostics when looking up a base or member name
fails to find a type. There are no cases where it's valid for this to produce
an error.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
af2094e7cecadf36667deb61a83587ffdd979bd3 08-Apr-2010 John McCall <rjmccall@apple.com> Implement dependent friend function template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
216c278982ea8dd76d5d7d1ad0dcb39d3c5226e3 08-Apr-2010 Sean Hunt <rideau3@gmail.com> Implement checking for template literal operator functions. This
code won't actually get used yet because we don't handle non-type
parameter packs, but when we do, this code should jump in and work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
30019c062178ee9cc564352602436a3fd5bf540e 08-Apr-2010 Sean Hunt <rideau3@gmail.com> Updated comment to reflect changes made in the most recent draft.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
06245bfb3ae40bb24a8bfb17eafeb266a4daf5ca 07-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic
analysis on the resulting type.
- Downgrade the errors concerning friend type declarations that do
not refer to classes to ExtWarns in C++98/03. C++0x allows
practically any type to be befriended, and ignores the friend
declaration if the type is not a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1d8693580133d6c783b9a56808e61f98005e0be1 07-Apr-2010 Douglas Gregor <dgregor@apple.com> Split Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
semantic analysis) and Sema::ActOnFriendTypeDecl (the action
callback). This is a prerequisite for improving template instantiation
of friend type declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
bcc12fdaa7b3276b46c8e1349d5c99fd42d6a0a1 02-Apr-2010 Anders Carlsson <andersca@mac.com> If a constructor is a dependent context, just set the base and member initializers as they are written. Fixes a bug where we wouldn't show initialization order warnings when instantiating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ea356fb65cc844abeab1176f6333a86b69644735 02-Apr-2010 Anders Carlsson <andersca@mac.com> Diagnose multiple base and member initializers in class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ec3332bcae6466dc69227742d2c4145fbe88e975 02-Apr-2010 Anders Carlsson <andersca@mac.com> More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
071d61043ab85112e65f336ae35692eba834810c 02-Apr-2010 Anders Carlsson <andersca@mac.com> Constify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
58cfbdef4dfcc82e98b935d8848411b84d7d6167 02-Apr-2010 Anders Carlsson <andersca@mac.com> Minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4033642464e8ba0982f88f34cffad808d247b393 01-Apr-2010 Douglas Gregor <dgregor@apple.com> Change the representation of dependent elaborated-type-specifiers
(such as "class T::foo") from an ElaboratedType of a TypenameType to a
DependentNameType, which more accurately models the underlying
concept.

Improve template instantiation for DependentNameType nodes that
represent nested-name-specifiers, by performing tag name lookup and
checking the resulting tag appropriately. Fixes PR5681.

There is still much testing and cleanup to do in this area.



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ee11b2dd530f3fb873e108f21341626168758a45 30-Mar-2010 Anders Carlsson <andersca@mac.com> Fix a bug where we would incorrectly report an error about initializing two fields in an anonymous struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8f1a24071faabf5796eb7dc1b19be52dc1a2d324 30-Mar-2010 Anders Carlsson <andersca@mac.com> Reduce nesting.

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

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

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cb9bafeb9bcd8c92ab9647a4a3f074180ce6dedb 29-Mar-2010 Douglas Gregor <dgregor@apple.com> Exit early from the simple form of Sema::RequireNonAbstractType(), for
a 2.47% speedup in 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0b4c9b5834a0a5520d2cd32227a53cf7f73fedca 29-Mar-2010 Douglas Gregor <dgregor@apple.com> Support __attribute__((packed)) (along with other attributes) at the
end of a struct/class/union in C++, from Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c67b03260dbf4127e09b03302ff844a24e41394f 26-Mar-2010 Douglas Gregor <dgregor@apple.com> Compare namespaces properly when looking for redeclarations of
namespace aliases. Fixes PR6341.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6068482648a366ac9fc297a84780e922ab63a7a 26-Mar-2010 Douglas Gregor <dgregor@apple.com> When adding initializers to a constructor, be sure that we are looking
through the bases and fields of the definition of the class in which
the constructor is declared, rather than some other declaration of
that class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3e1ae9381b11ed565df6c4f2cbd22a6479af742e 26-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Mark virtual methods that are used in tables included in VTTs as used.
Fixes PR6706.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99582 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
32f2fb53d9d7c28c94d8569fd0fcf06cccee0c3d 25-Mar-2010 John McCall <rjmccall@apple.com> Preserve type-source information in friend declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a418147c61a14cd21d4cce8f9c7a8750d2a59803 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Make sure to properly track the anonymous namespace that lives inside
each namespace, even when the outer namespace has multiple
definitions. As part of this, collapsed two pointers worth of storage
(original namespace and inner anonymous namespace) into a single
pointer with a distinguishing bit, since the two are mutually
exclusive, saving a pointer per NamespaceDecl. Fixes PR6620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7b2fc9d3c97f2526528a8b686af1589054025ca0 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement computation of the final overriders for each virtual
function within a class hierarchy (C++ [class.virtual]p2).

We use the final-overrider computation to determine when a particular
class is ill-formed because it has multiple final overriders for a
given virtual function (e.g., because two virtual functions override
the same virtual function in the same virtual base class). Fixes
PR5973.

We also use the final-overrider computation to determine which virtual
member functions are pure when determining whether a class is
abstract or diagnosing the improper use of an abstract class. The
prior approach to determining whether there were any pure virtual
functions in a class didn't cope with virtual base class subobjects
properly, and could not easily be fixed to deal with the oddities of
subobject hiding. Fixes PR6631.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b0f65ca9853d1148211a38736141c8ccf2aa4a1d 23-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> A fixed version of r99174 which also includes a test that we emit vtables when
we see an specialization definition ever if we then see a extern template declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
89db1455a28af887f64bf56ffc8aaf3b7acadda5 22-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> revert r99174. It caused PR6677. Will try to debug why tonight.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c24d72154e95545dcd6d74c893082d11fd51053d 22-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> When handling a TSK_ExplicitInstantiationDefinition after a
TSK_ExplicitInstantiationDeclaration make sure we call
MaybeMarkVirtualMembersReferenced with a method attached to the definition.

Remove the hack that forced vtable emition with declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
ef027fe748894522653558d9475a220482395094 16-Mar-2010 John McCall <rjmccall@apple.com> Perform access control for the implicit calls to base and member destructors
that occur in constructors (on the unwind path).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b020748a9954c995f2e616f50bb9ed4fe2df1f72 16-Mar-2010 John McCall <rjmccall@apple.com> Access control for implicit calls to copy assignment operators and copy
constructors from implicitly-defined members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6c790eac94101407acfd2c664400924cab45c0b1 16-Mar-2010 John McCall <rjmccall@apple.com> Perform access control even for the implicit destructor calls from implicit
destructor definitions. Remove some code duplication.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
961b167bcea8fe37465b2770c90bf9bf6b349470 13-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR6562. If a type is dependent, we don't know if it will have implicit
destructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bf73b352acb7a2d041ce8b50171dd7f8e2b2c1bb 12-Mar-2010 John McCall <rjmccall@apple.com> Remember whether a ParmVarDecl was spelled with a default argument or
whether it inherited one from a previous declaration.

Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
21ef0fa27b0783ec0bc6aa5b524feb2ec840f952 11-Mar-2010 John McCall <rjmccall@apple.com> Maintain type source information for functions through template
instantiation. Based on a patch by Enea Zaffanella! I found a way to
reduce some of the redundancy between TreeTransform's "standard"
FunctionProtoType transformation and TemplateInstantiator's override,
and I killed off the old SubstFunctionType by adding type source info
for the last cases where we were creating FunctionDecls without TSI
(at least that get passed through template instantiation).



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bbf58bb1b8dd8c5e0f07547a6c20ffd55385fcf6 10-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Delay codegen of vtables when handling implicit instantiations.

This fixes PR6474.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a2762918ecc636c9af207ce2a9ce705edad2a444 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Downgrade errors when trying to catch a pointer or reference to
incomplete type to warnings; GCC (and EDG in GCC compatibility mode)
permit such handles. Fixes PR6527.

(For real this time)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a50ce325b1ddd2bcbbfc1082ac93f3861d0a3a3d 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Robustify callers that rebuild typename type nodes again NULL return
types. Fixes PR6463.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
6d1828949df82e2f2bb2606ea7a3b40029a7f9e2 06-Mar-2010 Douglas Gregor <dgregor@apple.com> When declaring a catch block in C++, make sure that the type being
caught can be copy-initialized and destructed. Fixes PR6518.


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

Change Sema to avoid these asserts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5fe8c04009eff540ebaa0cceb2e75c3908322e11 27-Feb-2010 Douglas Gregor <dgregor@apple.com> Skip dependent virtual base classes; fixes PR6413.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
333de066a0c018170142150d563f3acdb2ad80f2 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Don't try to finalize an ill-formed variable or one whose class type is ill-formed. Fixes PR6421

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



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3dbd3d5c04cd5abd7dfd83b15f51d7c610a3c512 16-Feb-2010 John McCall <rjmccall@apple.com> Support local namespace aliases and permit them to be instantiated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7385779796f48e234b4fbea27ff205d7dfb34ce8 15-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Defer covariance checks for dependent types. Add test cases that also ensure
they are re-checked on instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e13ad837709cd7730e18d8af1cf6b7d35a56d6b7 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Work around an annoying, non-standard optimization in the glibc
headers, where malloc (and many other libc functions) are declared
with empty throw specifications, e.g.,

extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__
((__malloc__)) ;

The C++ standard doesn't seem to allow this, and redeclaring malloc as
the standard permits (as follows) resulted in Clang (rightfully!)
complaining about mis-matched exception specifications.

void *malloc(size_t size);

We work around this by silently propagating an empty throw
specification "throw()" from a function with C linkage declared in a
system header to a redeclaration that has no throw specifier.

Ick.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4dffad64c5c7106dc5ac506be94944299c8f7bc3 11-Feb-2010 Douglas Gregor <dgregor@apple.com> When we have a dependent direct initializer but not a dependent
variable type, we can (and should) still check for completeness of the
variable's type. Do so, to work around an assertion that shows up in
Boost's shared_ptr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2d5b70386d6f5553b667b6e407ca781b4ca2009e 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Remove another redundant ASTContext parameter

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
952b017601f9c82b51119c3a1600f1312a833db9 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
2a3503d85374ecc2b8e862a8ed9cec8f10f72e84 07-Feb-2010 Anders Carlsson <andersca@mac.com> Add attributes to namespace decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6f7a17b718385464966251ee421b314570d32731 05-Feb-2010 Douglas Gregor <dgregor@apple.com> A function declarator with a non-identifier name in an anonymous class
is a constructor for that class, right? Fixes PR6238.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
68c6c9a21e2d9d587477e07522fe55769d3aa26a 02-Feb-2010 John McCall <rjmccall@apple.com> Mark dtors for parameter variables and eliminate some redundant type munging.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4f9506a27cb6b865bf38beea48eadfa9dc93f510 02-Feb-2010 John McCall <rjmccall@apple.com> Access control for implicit destructor calls. Diagnostic could be orders of
magnitude clearer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
31310a21fb2a9f13950f864f681c86080b05d5b2 01-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> In C++, an initializer on a variable doesn't necessarily mean it's the definition. With that in mind, rename getDefinition to getAnyInitializer (to distinguish it from getInit) and reimplement it in terms of isThisDeclarationADefinition. Update all code to use this new function.

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



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



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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
f2a04bf1689cd88dd04012c311ba86e9d8b2b1b2 22-Jan-2010 Anders Carlsson <andersca@mac.com> No need to canonicalize the type and use dyn_cast. Also, correctly diagnose trying to override a function returning an lvalue reference with a function overriding an rvalue reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ceb7e001c488a7ea09dc631518515290518db47a 22-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Fix an obvious goof that caused us to only see the top level of return types
when checking for covariance. Added some fun test cases, fixes PR6110.

This felt obvious enough to just commit. ;] Let me know if anything needs
tweaking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
7a886e1a12ded84f49181cac9423e9db645cc452 19-Jan-2010 Douglas Gregor <dgregor@apple.com> In a mem-initializer, a nested-name-specifier followed by an
identifier always names a type. In the case of a dependent
nested-name-specifier, build a TypenameType to describe the dependent
base type. I'd like to move more of this behavior up into the parser,
but this fixes PR6062.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0efc2c1716be4f1c5f1343cad3b047e74861f030 13-Jan-2010 Douglas Gregor <dgregor@apple.com> Reimplement constructor declarator parsing to cope with template-ids
that name constructors, the endless joys of out-of-line constructor
definitions, and various other corner cases that the previous hack
never imagined. Fixes PR5688 and tightens up semantic analysis for
constructor names.

Additionally, fixed a problem where we wouldn't properly enter the
declarator scope of a parenthesized declarator. We were entering the
scope, then leaving it when we saw the ")"; now, we re-enter the
declarator scope before parsing the parameter list.

Note that we are forced to perform some tentative parsing within a
class (call it C) to tell the difference between

C(int); // constructor

and

C (f)(int); // member function

which is rather unfortunate. And, although it isn't necessary for
correctness, we use the same tentative-parsing mechanism for
out-of-line constructors to improve diagnostics in icky cases like:

C::C C::f(int); // error: C::C refers to the constructor name, but
// we complain nicely and recover by treating it as
// a type.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a6c058dd75c5563cced821fc16766a7cc179e00c 13-Jan-2010 Sean Hunt <rideau3@gmail.com> Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4f123ffe49764759db2e6f88880a1b1c3a13eecb 13-Jan-2010 Douglas Gregor <dgregor@apple.com> Remove broken fix-it when a default function argument has been
redefined. There's a FIXME with an apology about why we don't try to
do better here. Fixes <rdar://problem/7513023>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
b862b8f93424a583fc912ab37bbbac1c231e852e 12-Jan-2010 Douglas Gregor <dgregor@apple.com> Eliminate an embarrassing performance regression in C/ObjC, where we
were performing name lookup for template names in C/ObjC and always
finding nothing. Turn off such lookup unless we're in C++ mode, along
with the check that determines whether the given identifier is a
"current class name", and assert that we don't make this mistake
again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0c55106cf91a8aaa82199eeae6db0c5f8696b791 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Add support for out-of-line definitions of conversion function
templates. Previously, a little thinko in the code that replaced a
conversion function template with its redeclaration was causing some
very weird lookup behavior.



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

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

when we call

x.operator int*();

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
0d535c89c5d02017153fb971e1ef080cd80cb4b8 07-Jan-2010 Douglas Gregor <dgregor@apple.com> When we typo-correct a base class initializer, point to the base class
specifier that we corrected to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
4b0f21c0f8bed0e2a7dc62d73be64e7e277d6c9a 06-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class

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

Adjust a lot of tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
159ef1ed9f024f73028aa3c9b27ae0717e43786c 06-Jan-2010 Douglas Gregor <dgregor@apple.com> Make our marking of virtual members functions in a class be
deterministic and work properly with templates. Once a class that
needs a vtable has been defined, we now do one if two things:

- If the class has no key function, we place the class on a list of
classes whose virtual functions will need to be "marked" at the
end of the translation unit. The delay until the end of the
translation unit is needed because we might see template
specializations of these virtual functions.
- If the class has a key function, we do nothing; when the key
function is defined, the class will be placed on the
aforementioned list.

At the end of the translation unit, we "mark" all of the virtual
functions of the classes on the list as used, possibly causing
template instantiation and other classes to be added to the
list. This gets LLVM's lib/Support/CommandLine.cpp compiling again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bd6d6197fcfc98356ea60e816365eb0648b69556 05-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve key-function computation for templates. In particular:
- All classes can have a key function; templates don't change that.
non-template classes when computing the key function.
- We always mark all of the virtual member functions of class
template instantiations.
- The vtable for an instantiation of a class template has weak
linkage.

We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ac4c939c2dfca2dc5b785169670125511ea5bb62 31-Dec-2009 Anders Carlsson <andersca@mac.com> It's OK for a return type to be incomplete if it's being defined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
be2e205add4c1f6375bb430e847b712a88581e46 31-Dec-2009 Anders Carlsson <andersca@mac.com> Make sure that an overriding return type is complete before checking if it's covariant. Fixes PR5920.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fe0241e31dd2d1af60116adf6f71dedc88cd1f68 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for C++ base and member initializers, e.g.,

test/FixIt/typo.cpp:41:15: error: initializer 'base' does not name a non-static
data member or base class; did you mean the base class 'Base'?
Derived() : base(),
^~~~
Base
test/FixIt/typo.cpp:42:15: error: initializer 'ember' does not name a non-static
data member or base class; did you mean the member 'member'?
ember() { }
^~~~~
member



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c3f89032c8822c443fb8a1633d297b60e5ca90c 31-Dec-2009 Chris Lattner <sabre@nondot.org> improve diagnostics for case when a field type is unknown by
not emitting a follow-on error about 'int', which the user
never wrote. PR5924.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e6d11b75f68980645fa695b56dc24487ecf13c32 26-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Attempted fix for PR5884; this code will be dead soon, but this fix should
help for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
54d76db0aa7107597cac0b80d8e138a37e6d1de9 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cb48f8a60ad26b56d299cca9a57f8ea683d8a909 25-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make copy constructor elimination work in more cases; the case in question
here affects clang-on-clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7557a1348d2821dce126a778aa7acd7a00b814fd 24-Dec-2009 Douglas Gregor <dgregor@apple.com> Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
51846265634fe593bfe8046d82b4f8fbe335e791 24-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix -Asserts warning.

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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4a2c19bf2330e31851330423187ec48035cab1a5 22-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Switch default arguments over to InitializationSequence.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a236a5584732c7c285316d7608168f771fac2059 22-Dec-2009 John McCall <rjmccall@apple.com> Stop diagnosing the use of inner classes as friends. ddunbar asked whether
this was useful, and on review Doug and I decided it was probably on the level
of a bug in the standard and therefore not worth a warning even in -pedantic.
If someone disagrees and urgently wants clang++ to warn about this in strict
c++98 mode, we can talk about it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
2b194418b83ecbe670a6e5a8e57b84f32d8b123b 21-Dec-2009 John McCall <rjmccall@apple.com> Reorganize the base-lookup bits of ActOnMemInitializer in order to better
support diagnostics and error recovery.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7a1dc562d4ad59237ed9fe7e8cef56f9eaa7a26c 19-Dec-2009 John McCall <rjmccall@apple.com> Refactor to remove more dependencies on PreDeclaratorDC. I seem to have made
the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can
live with that; they'll need to be fixed more holistically anyhow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
731ad843b7bf1862f6547ac79539f0f5b4c539bd 19-Dec-2009 John McCall <rjmccall@apple.com> Just push a new scope when parsing an out-of-line variable definition.
Magically fixes all the terrible lookup problems associated with not pushing
a new scope. Resolves an ancient xfail and an LLVM misparse.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
ff2d87840df9f269d8a2f9df27518548da3d40f1 16-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Correctly calcluate abstract-ness in the case where an implicitly declared
method overrides a pure virtual method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
5fdd7643ae81af4ace04f8be888f225b9fcc64b7 16-Dec-2009 John McCall <rjmccall@apple.com> Successive anonymous namespaces name the same scope. I misinterpreted the
standard the last time. Fixes PR5766.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5cc07df89ab9afa9079baeec1243ee90c3f84d9d 15-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix some diagnostic-related FIXMEs, from Nicola Gigante

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
156c78e4ef14e5f7ba251554ea8f2dbec573fef3 13-Dec-2009 Anders Carlsson <andersca@mac.com> More improvements to checking allocation and deallocation functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fcfdb2ba4275183c1b018b4afe05e1ef1178c1ef 12-Dec-2009 Anders Carlsson <andersca@mac.com> Fix tyop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
20d45d2a9ebb8e20683b11287878a7e341bfea1a 12-Dec-2009 Anders Carlsson <andersca@mac.com> Correctly diagnose [basic.stc.dynamic.allocation]p1

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a3ccda58913cc1a4b8564e349448b12acc462da7 12-Dec-2009 Anders Carlsson <andersca@mac.com> Factor operator new declaration checking out into a separate function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
46991d63642c5a29f62d8b92456f62b0fe564fd0 12-Dec-2009 Anders Carlsson <andersca@mac.com> More work on improving the operator delete diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1152c39c8a9849f437ccac68391db7845e7c42b9 12-Dec-2009 Anders Carlsson <andersca@mac.com> Fix build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9d59ecb4d2c2e8efdb214589753826b662246d82 12-Dec-2009 Anders Carlsson <andersca@mac.com> Improve diagnostics for malformed delete operator function declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d04258483be6583f0865464234d014807a3e1cc 11-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Random string-related cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d7533ec10b618d360eb8952e62edb5657199acd3 11-Dec-2009 John McCall <rjmccall@apple.com> Check if the target of a using decl is already declared in this scope before
doing any of the other redeclaration checks. We were missing a few cases.
Fixes PR 5752.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
60fa3cfd7aa63c29f9fc2d593bac56a3646337cc 11-Dec-2009 John McCall <rjmccall@apple.com> Implement access declarations. Most of the work here is parsing them, which
is difficult because they're so terribly, terribly ambiguous.


We implement access declarations in terms of using declarations, which is
quite reasonable. However, we should really persist the access/using
distinction in the AST and use the appropriate name in diagnostics. This
isn't a priority, so I'll just file a PR and hope someone else does it. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
41ce66f8e20159d8bd39fff54ae01608da06c294 10-Dec-2009 John McCall <rjmccall@apple.com> Improve the diagnostic when a new declaration conflicts with a using shadow
declaration. Rename note_using_decl to note_using, which is possibly less confusing.
Add a test for non-class-scope using decl collisions and be sure to note the case
we can't diagnose yet.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
b6cc91be4da4f55c7e3dca87ecfdb532b33c83ca 09-Dec-2009 Anders Carlsson <andersca@mac.com> Pass the current SourceLocation to getAssignOperatorMethod, fixing a crash when the assign operator method needs to be instantiated. Doug, please review the updated default-assignment-operator.cpp change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
604e7f14d672af80ca5b9044f30f3dc23d37ddd5 08-Dec-2009 John McCall <rjmccall@apple.com> Correctly implement the C++03 and 0x restrictions on class-member using
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6a637f8c8a93863509fc1bc555513ff6504957d 07-Dec-2009 Anders Carlsson <andersca@mac.com> Rework how virtual member functions are marked. If a class has no key function, we now wait until the end of the translation unit to mark its virtual member functions as references. This lays the groundwork for fixing PR5557.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f53df2398e07d13be9962b95aebc19b31706fa33 07-Dec-2009 Anders Carlsson <andersca@mac.com> Move key functions to a separate map.

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

For posterity, I did:

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0336843eb0d04f2d4423189c26ec55b7654b1dec 06-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix a slight oversight in computing whether a copy constructor is elidable.
Fixes PR5695.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d013733c73507674b5db55d1686339e45c9e6edf 06-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5693: shift some code into SetClassDeclAttributesFromBase so that
it gets called during template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ed97649e9574b9d854fa4d6109c9333ae0993554 04-Dec-2009 John McCall <rjmccall@apple.com> Fix "using typename" and the instantiation of non-dependent using declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1ab537be683c31afba3272a61ddd13811967d3be 03-Dec-2009 Douglas Gregor <dgregor@apple.com> Unify the end-of-class code paths used by the parser and template
instantiation, to ensure that we mark class template specilizations as
abstract when we need to and perform checking of abstract classes.

Also, move the checking that determines whether we are creating a
variable of abstract class type *after* we check whether the type is
complete. Otherwise, we won't see when we have an abstract class
template specialization that is implicitly instantiated by this
declaration. This is the "something else" that Sebastian had noted
earlier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
51f940457ab20f82c62c2093389763bb9f5187eb 03-Dec-2009 Anders Carlsson <andersca@mac.com> When instantiating a class, if a base specifier is not dependent we still need to copy its attributes down to the instantiated class.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
802ab45fea51beff12f386329d4928811a479c6e 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Improve source location information for C++ member initializers in a
constructor, by keeping the DeclaratorInfo* rather than just the type
and a single location.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ca6affd01612fa1e4db78ae40509ac01d661730d 02-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure to call AddOverriddenMethods for implicit copy assignment operators;
it's rare, but possible, for the difference to be significant.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4ba3136b3eb9740a07bd61d0ab23ce9a8d894dee 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Move the checking of overridden virtual functions into the code path
common to both parsing and template instantiation, so that we'll find
overridden virtuals for member functions of class templates when they
are instantiated.

Additionally, factor out the checking for pure virtual functions, so
that it will be executed both at parsing time and at template
instantiation time.

These changes fix PR5656 (for real), although one more tweak
w.r.t. member function templates will be coming along shortly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9af2f52fbcb993350f54e57d498e7849ba29c75d 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Don't automatically assume that an id-expression refers to a
ValueDecl, because that isn't always the case in ill-formed
code. Diagnose a common mistake (forgetting to provide a template
argument list for a class template, PR5655) and dyn_cast so that we
handle the general problem of referring to a non-value declaration
gracefully.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
37909808416da93703cecc83091e2b9eab0053d6 30-Nov-2009 Anders Carlsson <andersca@mac.com> When we're trying to define an implicit virtual destructor, make sure that we have a valid delete operator.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0486d746019f8310589b1f0d92edcc4bb3916b33 28-Nov-2009 Sean Hunt <rideau3@gmail.com> Add Parser support for C++0x literal operators ('operator "" i').
DeclarationName can't handle them yet, so right now Parser just errors out on them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d5a942b9118d2dea65b5bfdf0803ef5716a3e68b 26-Nov-2009 Anders Carlsson <andersca@mac.com> When adding an implicit destructor, make sure to mark it as virtual if it overrides existing destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6a587cbd6913117b0eec47bd5e60831607577270 25-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Better diagnostic on deleted constructor when no
initializer name is available.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5b6d70e2dece713de82612ffbac2f2bc5c367f73 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Diagnose ill-formed uses of default template arguments in
function templates (in C++98), friend function templates, and
out-of-line definitions of members of class templates.

Also handles merging of default template arguments from previous
declarations of function templates, for C++0x. However, we don't yet
make use of those default template arguments.


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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d1a7846699a82f85ff3ce6b2e383409537c3f5c5 25-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Have the parser tell sema whether a member declaration is a function definition. This allows sema to not emit spurious diagnostics in some invalid code.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb0d8c95b43549ebf1acbb78d597901ace6dc8b7 23-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Let using directives refer to namespace aliases. Fixes PR5479.

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

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

My fingers hurt.



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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bbd37c62e34db3f5a95c899723484a76c71d7757 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7ba107a1863ddfa1664555854f0d7bdb3c491c92 18-Nov-2009 John McCall <rjmccall@apple.com> Incremental progress on using declarations. Split UnresolvedUsingDecl into
two classes, one for typenames and one for values; this seems to have some
support from Doug if not necessarily from the extremely-vague-on-this-point
standard. Track the location of the 'typename' keyword in a using-typename
decl. Make a new lookup result for unresolved values and deal with it in
most places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6490ae5003226cae28f980648948bea8b21a8638 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Silence some warnings produced by Clang, and add a missing header

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9488ea120e093068021f944176c3d610dd540914 17-Nov-2009 John McCall <rjmccall@apple.com> Instead of hanging a using declaration's target decls directly off the using
decl, create shadow declarations and put them in scope like normal.
Work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9f853df0d3c25c646907a7b7ef22398370def00f 17-Nov-2009 Anders Carlsson <andersca@mac.com> Unify the way destructor epilogues are generated for synthesized and regular destructors. Also fix PR5529.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e73d3bc991d752b80dc97a156463e02bd06841cb 17-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Simplify the AST a bit by skipping creating member initializers for members
with a trivial constructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
6d7013940a37f03fd324ef438ff984a5369013b0 15-Nov-2009 Anders Carlsson <andersca@mac.com> Make sure that virtual destructors have delete operators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c07a494b376f75f33759cf09ad188b11ef3fa9d5 15-Nov-2009 Douglas Gregor <dgregor@apple.com> Don't gratuitously mark the default constructors of base or member initializers as used

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
19aeac6ea4897c542b21c9f53a0a51762d8ddf83 14-Nov-2009 Douglas Gregor <dgregor@apple.com> When type-checking a static cast (or the static_cast part of a C-style
cast) that is converting to a class type, enumerate its constructors
as in any other direct initialization. This ensures that we get the
proper conversion sequence.



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8db68da43086c4205b1df1c35a3778c0ea32b9cd 13-Nov-2009 Anders Carlsson <andersca@mac.com> Clear temporaries in more places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f8a9a797a4328ca0422a3eff600e1a2074343bc9 13-Nov-2009 Anders Carlsson <andersca@mac.com> Fix bug Doug noticed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
afe7ec28b1880335daba5f7310fe5191e14c4e76 13-Nov-2009 Douglas Gregor <dgregor@apple.com> When transforming an expression statement (e.g., for template
instantiation), be sure to finish the expression statement by
providing a FullExprArg, making sure that temporaries get
destroyed. Fixes an obscure failure when parsing
llvm/LinkAllPasses.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cffecd08f1974dc7cc328bd620b2f69daf442fda 12-Nov-2009 Douglas Gregor <dgregor@apple.com> Give CanQual<T> an implicit conversion to bool, so that it can be used
in "if" statements like:

if (CanQual<ReferenceType> RefType = T.getAs<ReferenceType>())

Thanks to Clang for pointing out this mistake :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
af8e6ed61b5e80ab95632b63f583af79dcb62590 12-Nov-2009 John McCall <rjmccall@apple.com> Random const correctness, and incidentally use computeDeclContext when building
a using declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b03bfa55d03ca38922ffedac19225d0832e8d911 11-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose illegally typed operator new/new[].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
314b97f8c564b465af605efaee23f91ec18a982b 10-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve parsing of template arguments to lay the foundation for
handling template template parameters properly. This refactoring:

- Parses template template arguments as id-expressions, representing
the result of the parse as a template name (Action::TemplateTy)
rather than as an expression (lame!).

- Represents all parsed template arguments via a new parser-specific
type, ParsedTemplateArgument, which stores the kind of template
argument (type, non-type, template) along with all of the source
information about the template argument. This replaces an ad hoc
set of 3 vectors (one for a void*, which was either a type or an
expression; one for a bit telling whether the first was a type or
an expression; and one for a single source location pointing at
the template argument).

- Moves TemplateIdAnnotation into the new Parse/Template.h. It never
belonged in the Basic library anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4881b99bc830d4432c171b0a00348711bb863eea 10-Nov-2009 Anders Carlsson <andersca@mac.com> Use PP.getLocForEndOfToken as suggested by John.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ad26b7376b6fd71d14b9b893eaa1ba79e029c830 10-Nov-2009 Anders Carlsson <andersca@mac.com> If a function with a default argument is redefined and the new function also has a defualt argument then add a fixit hint that removes the default argument. Fixes PR5444.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
80c30dad6c6fca077293125a96f464b6c8857171 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add additional note to mark the cause of synthesized constructors. Mark
declaration invalid if the constructor can't be properly built. Addresses
remaining review comments from Fariborz for r86500.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f8db4771d4f61f4ecfbe202400e10e36e883191b 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Remove a useless variable that got left behind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
49c16da71b9c95cc53b4af6de2833a022cb69b6a 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Unify the codepaths used to verify base and member initializers for explicitly
and implicitly defined constructors. This has a number of benefits:

1. Less code.

2. Explicit and implicit constructors get the same diagnostics.

3. The AST explicitly contains constructor calls from implicit default
constructors. This allows handing some cases that previously weren't handled
correctly in IRGen without any additional code. Specifically, implicit default
constructors containing calls to constructors with default arguments are now
handled correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3eaa9ffa176e5d240a0b140b35cc104ee3d63936 08-Nov-2009 Douglas Gregor <dgregor@apple.com> Always make sure we're using an unqualified type when building a
constructor name. Fixes PR5418.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
88fad6310d3104e3ac4ab685227beabaa76faf7b 07-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Make sure isCopyAssignment is only true for actual copy assignment operators,
instead of all assignment operators. The mistake messes up IRGen because
it ends up assuming that the assignment operator is actually the implicit
copy assignment operator, and therefore tries to emit the RHS as an lvalue.



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



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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6aee62129150e5fbe34f8d6e8a2e89f03d000d92 05-Nov-2009 John McCall <rjmccall@apple.com> Comments, formatting. Based on patch by Brandon Pearcy!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b41900410fae8cba4bc02db2e3e44142e7f4c625 05-Nov-2009 John McCall <rjmccall@apple.com> Diagnose using a field to initialize itself. Patch by Brandon Pearcy!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1fe6b919f70bed58bd8bd43de1a79530b0d55a53 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Don't try to check the initialization of fields with dependent
types. Fixes PR5352.

Fariborz, please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
12c118a8ff9f61a4d63146fe1a5c0d60987f99bb 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Switch parsing of using declarations over to ParseUnqualifiedId.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3f9a0566e6793151b99a65ab936220971cf96c1b 03-Nov-2009 Douglas Gregor <dgregor@apple.com> Introduce a new class, UnqualifiedId, that provides a parsed
representation of a C++ unqualified-id, along with a single parsing
function (Parser::ParseUnqualifiedId) that will parse all of the
various forms of unqualified-id in C++.

Replace the representation of the declarator name in Declarator with
the new UnqualifiedId class, simplifying declarator-id parsing
considerably and providing more source-location information to
Sema. In the future, I hope to migrate all of the other
unqualified-id-parsing code over to this single representation, then
begin to merge actions that are currently only different because we
didn't have a unqualified notion of the name in the parser.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ebb6d391d2e29ed48a880517e2ba919bf7016d9 29-Oct-2009 Anders Carlsson <andersca@mac.com> Make sure to call CompleteConstructorCall for bases and members that are initialized implicitly in constructors so that default arguments etc are set correctly. Fixes PR5283.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
680a3f3581fe9f17802522eeafa403b9c9dfa34a 28-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Use array's base element type in getting to its
constructor. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c0fcce461435fb906fbc0352484d0011a3c2957c 28-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Removed an unnecessary arguement passed to InitializeVarWithConstructor
which should come from the variable and wasn't correct for arrays in any case.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5a597a9d1c5ad409eb48b821e1ceb95057701214 25-Oct-2009 Chris Lattner <sabre@nondot.org> remove a nonsensical todo


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c7f1904474600aa74f5f014941d2ed5c4cf462aa 25-Oct-2009 Chris Lattner <sabre@nondot.org> change Sema::ActOnFriendTypeDecl to use GetTypeForDeclarator instead
of ConvertDeclSpecToType, which I'd like to keep private to SemaType.cpp.
We do this by cons'ing up a trivial Declarator for the type.

John, please review.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
54e14c4db764c0636160d26c5bbf491637c83a76 23-Oct-2009 John McCall <rjmccall@apple.com> When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
reference type. Also, preserve the original spelling of the reference type.
Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
the various ObjC TypeLocs. Preserve the spelling of protocol lists except in
the canonical form.
* Preserve some level of source type structure on parameter types, but
canonicalize on the canonical function type. This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.



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


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2782302961b6f57316b1ece494c7135b65e18b30 18-Oct-2009 Anders Carlsson <andersca@mac.com> It's OK for a pure virtual function to override another pure virtual function. Fixes PR5222.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
663b5a0be7261c29bc4c526a71cffcfa02d4153e 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Testing and some minor fixes for explicit template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d9290cb5ad9eae8d10487cea5392331cf6a47142 14-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Handle ambiguity of reference initialization.
Removes a FIXME.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c638ab9e76e92674a3f415248326d3c5ffc8216 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Remove some non-ASCII characters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3f09327b26033d0a9676d52d80cf92c48f581aff 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Unify our diagnostic printing for errors of the form, "we didn't like
what we found when we looked into <blah>", where <blah> is a
DeclContext*. We can now format DeclContext*'s in nice ways, e.g.,
"namespace N", "the global namespace", "'class Foo'".

This is part of PR3990, but we're not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
096ebfda90b35a5cd6e399920fca7d9b5b0859f3 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Diagnose attempts to add default function arguments to a
specialization. This completes C++ [temp.expl.spec]!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a735b206fdb5c15767a45289e1ffb3b568f70f2b 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve the internal representation and semantic analysis of friend
function templates.

This commit ensures that friend function templates are constructed as
FunctionTemplateDecls rather than partial FunctionDecls (as they
previously were). It then implements template instantiation for friend
function templates, injecting the friend function template only when
no previous declaration exists at the time of instantiation.

Oh, and make sure that explicit specialization declarations are not
friends.



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

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0c728f1eb2e8e6e5adc2501c6fdcd87105b34d5c 09-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Fix up error reporting when object cannot be constructed
because of missing default constructor of a member.
Fixes pr5154.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e3af0235ce6548e221e04c2ae5aeb0fb413ba736 08-Oct-2009 John McCall <rjmccall@apple.com> Refactoring around friend class templates. Better error message for friend enums.
Don't create a new declaration for friend classes if a declaration already exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a8f32e0965ee19ecc53cd796e34268377a20357c 06-Oct-2009 Douglas Gregor <dgregor@apple.com> Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9aeed32282fe8a775c24c01c923717ca86695685 01-Oct-2009 John McCall <rjmccall@apple.com> Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
893f955321cdf49dd0ceaf4ff821632e9b265000 30-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue good diagnostics when initializing a refernce type with
a bad initializer. Fixes pr4274.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bf1cc05907ceb2081e8158b26f3d3f48b31caad3 30-Sep-2009 John McCall <rjmccall@apple.com> Desugaring optimizations. Add single-step desugaring methods to all
concrete types. Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate. Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f352bddf015e537350416c296dd2963524f554f9 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListLoc for keeping source location information for protocol references.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
182ddf0e5dc5667e6683a58b483a2e52564f4303 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve handling of friend function templates somewhat

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d85bea2affdd59d83d1be7d24b97f436484c3625 26-Sep-2009 Douglas Gregor <dgregor@apple.com> Rework the Parse-Sema interaction for friends to better support friend
class templates. We now treat friend class templates much more like
normal class templates, except that they still get special name lookup
rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in
<iostream>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7ad2d562e8423f71143c33d63e11ce77b2117643 24-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Use Doug's DeclLoc to pinpoint location of the declaration
in a reference initialization diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
8f489d692fedeafbb572103d6edca71d7762e83d 24-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> patch to ir-gen conversion function call used in
initializing a reference class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2b51138433969b163e6899836bba6c14ec2397cb 23-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Remove the FIXME as I said.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
d85cef5a54074a5f647f45c2218675f7774a909d 17-Sep-2009 Douglas Gregor <dgregor@apple.com> Merge uninstantiated default arguments more carefully, and try not to
complain about specializations of member functions that are not
definitions. Fixes PR4995.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dd4a3b0065b9a7e7b00073df415a798886c090f3 17-Sep-2009 John McCall <rjmccall@apple.com> Improved representation and support for friend class templates. Angst about same.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7adb10fa317cd7eacb0959f775e77353d4f24ad1 16-Sep-2009 Douglas Gregor <dgregor@apple.com> When implicitly declaring operators new, new[], delete, and delete[],
give them the appropriate exception specifications. This,
unfortunately, requires us to maintain and/or implicitly generate
handles to namespace "std" and the class "std::bad_alloc". However,
every other approach I've come up with was more hackish, and this
standard requirement itself is quite the hack.

Fixes PR4829.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
71710113531a828679ce9b7deaca8d8df08c88da 15-Sep-2009 Anders Carlsson <andersca@mac.com> Add back the workaround since it lead to constructor conversion bugs :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f6c213a931f8eedf91531f3204cc828f18466fd5 15-Sep-2009 Anders Carlsson <andersca@mac.com> When performing an user defined conversion sequence, perform the initial standard conversion sequence. This lets us remove a workaround in SemaCompleteConstructorCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
05b23ea2119b4c411719bd6631e5d679ba5e7ef1 14-Sep-2009 John McCall <rjmccall@apple.com> Skeletal support for friend class templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
debc629300e4c6c774b7d2a1d3c665c2c719e803 12-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Removed Context argument from couple of methods which don't
need them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bbbcdd9cc06b6078939129330ecc9bda3310984d 11-Sep-2009 John McCall <rjmccall@apple.com> Alter Action's friend interface to prepare for templated friend declarations and
to stop making promises we can't currently keep.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6cc1518b9f15ca846b8c35518eeae9557935678d 11-Sep-2009 Douglas Gregor <dgregor@apple.com> Cleanup and test C++ default arguments. Improvements include:

- Diagnose attempts to add default arguments to templates (or member
functions of templates) after the initial declaration (DR217).
- Improve diagnostics when a default argument is redefined. Now, the
note will always point at the place where the default argument was
previously defined, rather than pointing to the most recent
declaration of the function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1cdcc579df30dba1b2e1e9909125bb9c61898e05 10-Sep-2009 Douglas Gregor <dgregor@apple.com> When re-entering a template scope, we may be entering a class template
partial specialization rather than a subclass of TemplateDecl. Fixes a
crash in libstdc++ 4.2's <map>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
6b2becfc434b0bdced8560802c4d0e03148c61b8 08-Sep-2009 John McCall <rjmccall@apple.com> Support templateids in friend declarations. Fixes bug 4859.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d74d4149f759b8abec15fb8163a4206e8c7068c8 08-Sep-2009 Anders Carlsson <andersca@mac.com> Handle variadic constructors better. Share code between BuildCXXConstructExpr and BuildCXXTemporaryObjectExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
21e1c4ea0a96bcecfe5976304d84779949058648 06-Sep-2009 Anders Carlsson <andersca@mac.com> Reapply 81096, now with a fix. Spot the bug:

for (unsigned i = numargs; i < NumArgs; ++i)
Args[0] = 0;

;)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4355be0758856cf7645e264d4813831dc27ce78c 06-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
destroying the CXXConstructExpr.", this is causing test failures across the
board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
657bff7ff399d08812a3b3324dbbebf68b0df07d 06-Sep-2009 Anders Carlsson <andersca@mac.com> Initialize default CXXConstructExpr arguments to 0. Fixes a crash when destroying the CXXConstructExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
4fe95f99a2693f1145785ea5835ba6937e49c730 04-Sep-2009 Douglas Gregor <dgregor@apple.com> Don't generate any code for an explicit call to a trivial destructor.

Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
34374e6ce5710a91c478f69379220ff20c3e7f15 04-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to instantiate destructors used to destruct
base and data members when they are needed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9d436205be3e4c05854530134be61b46b13136ff 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Mark constructors used in initialization of base(s) and fields
as referecned with location where they are used. Still
need to look at destructor aspects of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
80545ad0f9b8e52177a8c37bd140bae0ffbd0cc6 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics in variety of situations involving
reference/const data members when user has declared
the constructor. This necessitated some non-minor
refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
916a5ed560c015f6399909b1672ebe90d7f65635 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Minor refactoring of my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cf1b9c790ad9c944131e7150ef13e2d421f79e88 03-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Referenced instatiated default constructors
must be defined. Fixed pr4853.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
636a0ffbd2bda998236ddc9bb14b9222f7b49359 02-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Allow null initialization of scalara data members
in constructors's initializer list. pr4854



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cdc83c777973fa56b6f828bfe88210290ca58d62 01-Sep-2009 Anders Carlsson <andersca@mac.com> Don't assume that a base is always a RecordType, it can also be a TemplateSpecializationType. Also, make sure to get the instantiated union member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ab88d97734f1260402a0c6a8f6b77bed7ed4e295 01-Sep-2009 John McCall <rjmccall@apple.com> Fix bug 4784 and allow friend declarations to properly extend
existing declaration chains.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
05180afbf4b55c8ee8894df0bb77ac41ea3a41fa 30-Aug-2009 Anders Carlsson <andersca@mac.com> Use DiagnoseMissingMember for UsingDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f4d84b663ef7dda959cbe45561d90e59760cbb74 30-Aug-2009 Anders Carlsson <andersca@mac.com> Improve diagnostics for missing members. This renames the err_typecheck_no_member to err_typecheck_no_member_deprecated. The idea is that err_typecheck_no_member_deprecated should be phased out and any call sites that reference it should call DiagnoseMissingMember instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
595adc1795cc2c079ef5876100e01acd10a0504a 29-Aug-2009 Anders Carlsson <andersca@mac.com> Set the access specifier for using decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5fee110ac106370f75592df024001de73edced2a 29-Aug-2009 John McCall <rjmccall@apple.com> For consistency, just make friend declarations AS_public.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8c57a66a2aa59939a902ffa8c4ad0ddd5b949a21 29-Aug-2009 Anders Carlsson <andersca@mac.com> Store the SourceLocation of right parentheses in member initializers. Patch by Anders Johnsen!


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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0dde18e5a713bc186062ca1ebc9967500b07faee 28-Aug-2009 Anders Carlsson <andersca@mac.com> Instantiate unresolved using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
02cace78cf48cc26686bd5b07c78606abca13bcd 28-Aug-2009 John McCall <rjmccall@apple.com> Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not. Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
550b14b410eaed037c9b791806194e6cea1ebe90 28-Aug-2009 Anders Carlsson <andersca@mac.com> Create UnresolvedUsingDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c72160ba4ce3f82784888aa64415b9ef72bf44ea 28-Aug-2009 Anders Carlsson <andersca@mac.com> Factor declaration building out to Sema::BuildUsingDeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
73b39cf02eaa346c6d7a76c32bf13759de7516db 28-Aug-2009 Anders Carlsson <andersca@mac.com> More work on using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cf9f921268e67703d9cddcf9f2d6ac057c4c3cc8 28-Aug-2009 Anders Carlsson <andersca@mac.com> Many improvements to using declarations.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d4c5ea0ee899d3e916d79cde98f16fb47810c4f 27-Aug-2009 Anders Carlsson <andersca@mac.com> Don't check member and base initializers if the constructor is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5c36fb22d9984c74855e8049ae0bd15d3a3080b8 27-Aug-2009 Anders Carlsson <andersca@mac.com> Use early returns to avoid indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2a16a138812f2f725f645cca95c41e6bd12ad14f 27-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Stub out an error so we don't crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e7624a75b74633ff9c54d1c60ace2707fe298008 27-Aug-2009 Anders Carlsson <andersca@mac.com> Add a BuildCXXTemporaryObjectExpr and use it so default arguments will be instantiated correctly for temporary object expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a6ec7ad25a137fd42d84e6b6d44b32976cae440c 27-Aug-2009 Anders Carlsson <andersca@mac.com> New RequireNonAbstractType function.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
83ddad3ab513f5d73698cf9fbeb4ed3f011bc3b9 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement support for C++ direct initializers that involve dependent
types or type-dependent expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5653ca5088b799ada71b5043a0a2cd71c727da83 25-Aug-2009 Anders Carlsson <andersca@mac.com> If a parameter has a default argument expression, make sure to instantiate the parameter type before checking that the expression is a valid initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8644aecd4383ce829d1eed81e96399904a948362 25-Aug-2009 Anders Carlsson <andersca@mac.com> Improved support for default arguments in constructors for class templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fe2de492d00c9698e2f98568bbb72964d50ed467 25-Aug-2009 Anders Carlsson <andersca@mac.com> InitializeVarWithConstructor now returns true on failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
9351c173cd538f7f7c28af1494ac7e68b815b0e8 25-Aug-2009 Anders Carlsson <andersca@mac.com> Basic support for default argument expressions for function templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ed961f989e7153733d352505f239f0de4e060629 25-Aug-2009 Anders Carlsson <andersca@mac.com> Factor setting default arguments out into SetParamDefaultArgument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5f49a0c693188a4d9c4165bd5227399475a31426 25-Aug-2009 Anders Carlsson <andersca@mac.com> Use hasDefaultArg instead of getDefaultArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
66e3067d9821c75f3119e07f087cfb0d30f9c2ed 25-Aug-2009 Anders Carlsson <andersca@mac.com> Check that the default argument is well-formed before checking the initializer types.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
efd5bdad3c2b746db46452c6b13bd3c462dd761d 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Make sure to adjust function template declarations to their templated
declarations (e.g., FunctionTemplateDecl -> CXXConstructorDecl) before
performing semantic analysis on the declarations. Fixes PR4761.


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ac373c4ca596a144d906570f284d46d702e10719 22-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix parsing for out-of-line definitions of constructors and
destructors of class templates.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a5d82000f7b173a0a5ce34dc8c09a03f98d9e439 21-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
37b372b76a3fafe77186d7e6079e5642e2017478 21-Aug-2009 Douglas Gregor <dgregor@apple.com> Initial support for parsing and representation of member function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f18970d1dd3a88b7a50e9abd4fd4ceef675a8a2e 20-Aug-2009 John McCall <rjmccall@apple.com> Add syntax examples for the friend declaration types.

Remove an assert trivialized by dominating code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e8661906d49ef6c9694a9cc845ca62a85dbc016d 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use Sema's LocInfoType to pass and preserve type source info through the Parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a1d5662d96465f0fddf8819d245da4d19b892eff 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
88232aadbe3e9b6dde2a9b0d7c91e677305de06a 18-Aug-2009 John McCall <rjmccall@apple.com> Teach Sema how to pop out of friend function definitions in nested classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
1d954f6a0057cb55a3a5d483904a3c57d03c996f 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Implement __is_empty. Patch by Sean Hunt.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ad25883a644dd6b52c7923dd128a7d05fb26213c 13-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to force synthesis of copy assignment operator
function in the order according to c++03. ir-gen
for copy assignment in the trivial case and the first
test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0270b8aa3f9b50ec3acd1abfd2b97377a3e1bb05 13-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> More toward synthesizing copy assignments. SWIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2198ba12b73a8e6801d13f25de38031da6df46b6 12-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for synthesizing copy assignment operator.
WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c48fbdfb83a5e50fed693f0bdda3396e5b67051d 11-Aug-2009 John McCall <rjmccall@apple.com> Add a FriendClassDecl type for holding declarations of friend types in
the AST, and create such declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e64941280877d065a27e8cefd2a9038256d0e3ac 11-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3f9a8a60614b763785d54ad08821745d03a4af70 11-Aug-2009 John McCall <rjmccall@apple.com> Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air; you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
470c2a9ab6807be8a695e583a41b20ed69082260 06-Aug-2009 John McCall <rjmccall@apple.com> Drop the friend-inner-class diagnostic from an extwarn to an ext and don't
guard its report on GNUMode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7f27d92006936b16a29ca0a5c442476b4f585b21 06-Aug-2009 John McCall <rjmccall@apple.com> Permit a class to friend its members in C++0x, without restriction.
Permit a class to friend its class members in C++ 98, as long as extensions
are enabled (and even when they aren't, only give an extwarn about it).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
67d1a67f3db2f1aa69083c5c94164d6e0ee05b32 06-Aug-2009 John McCall <rjmccall@apple.com> First pass at friend semantics.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
50d62d1b4a98adbc83de8f8cd1379ea1c25656f7 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2eeed7bc4fd457ac57ff32ab3b02674588545f65 05-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Support for use of default argument in constructors.
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
a83f7ed3de1ce98d633dfb6bb223bb7711893dce 03-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Minor renaming/refactoring. No change in functionality.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
59c04373c6a4fef5c6341a21ac847d4b3a25ee36 29-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Refactor base/member initializers, and construct them correctly in cases
with dependent types. Fixes PR4621 and PR4627.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7252f5110de3163a465aa50a2114c1fef9e848e8 24-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> More Sema check for constructor's member initializer along
with type conversion to fix ir-gen crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
87595e46ccd61c9b7c08074c2c64b66b5c0fc694 24-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose when base classes and members to be intialized
with constructors don't have a matching constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d7b27e1c17d40c72a1ccf8868315bf0c5271aa54 23-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Add constructor used to initialize base/member in
CXXBaseOrMemberInitializer AST node. Needed by
its clients to do the initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2aef06d3447f048ac4c9c3d2c67d643523a74993 22-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix some memory allocation/deallocation issues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1f2023ab8b35e0f665eb6c0f11dd6d9b9bca12b8 22-Jul-2009 Douglas Gregor <dgregor@apple.com> "This patch implements the restrictions on union members detailed in
[class.union]p1", from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
71c6e714778740d98cd01252101d0aaf1efa1553 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Allocate BaseOrMemberInitializers and CXXBaseSpecifier nodes
via ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
393612e6c7727f1fee50039254d9f434364cc0b2 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6347f420ee0b097c0e642dc6c51afee5f1b14235 21-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Misc fixes for -Wreorder:

1. Make it work correctly with anonymous unions.
2. Don't compute it if the warning isn't enabled.
3. Optimize the algorithm slightly to make it linear time in the
case where we don't produce any warnings.



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


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

The motivation behind this change is twofold:

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

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

Along with this patch:

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
560de45ccbf21c5e4dbeef3fc49f932e499cc181 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added ASTs to destructor decl AST for default destruction of object's
base/members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d01c915dda27bb0045687f0a08bbcab1dd40e652 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build AST for ctor's initializer list according to
semantics of order of construction [class.init].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
40c072f44ff081293f79909ecc518af23938108e 10-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to build list of inherited virtual base classes
in their order of construction for each class and use it
to to check on propery order of base class construction
under -Wreorder option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb96e1275206b888eee484aac8b1b693417c6521 09-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Sema check on out of order object initialization of
class object's base and members under -Wreorder flag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5e09d4c96dc2846cc1fc75f80f5632612247354b 09-Jul-2009 Anders Carlsson <andersca@mac.com> Use getDeclName in DefineImplicitOverloadedAssign as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5eda81624ff3b9f617fa377f43d89f36741460a7 09-Jul-2009 Anders Carlsson <andersca@mac.com> Pass the DeclName to the diagnostic builder so that member names will be quoted correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
23c7d061367dd2fc1631e867cffc3d6aae24e799 07-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement checking of exception spec compatibility for overriding virtual functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4994d2d50ceacdc8908f750c55589c0a20942a0a 04-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Catch function redeclarations with incompatible exception specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5ffcd7b1ba8bfcb253f0a0bdf7c94c4d0270a4ab 02-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to allocate list of bases in CXXRecordDecl
using ASTContxt allocation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
73b85f3d7ccdff37bab7adafc6b06dfd03740058 02-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Use Destroy for member initializer list clean up.
Per Doug's comments. Doug please review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
961743326fd18776f897bf4461345dba680ef637 01-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to implement template types in ctor-initializer list.
Also has fix for bugzilla-4469.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bcfad54a43e5570e09daddd976bd4545933e75b1 01-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to support optional nested-name-specifier in in ctor-initializer
list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5ac3dfc24bd2d8c5c0d9955f5de33c97e6aaaadf 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose multiple initialization of anonymous union
fields in the ctor-initializer list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9da7201adeab345fc7da72bcfcf30e11774fb8c4 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> More diagnostics related to initialization of direct bases
in ctor-initializer list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
514b7b153bc9aa381e73f853ac37b62ab8995fd6 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Compute ending of iterator in for-loop once.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
16dbdce02366c372fe934c0528148fc38906f21a 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Take care of Chris's comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
47deacfa43625c6cc1b2008a0396ccb3af725fde 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> A more detailed diagnosis of ill-formed ctor-initializer
list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7881a0565893f1da6faafbd86377f5b50e4376a5 30-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose multiple initialzation of data-member/base
in the ctor-initializer list. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f8d736ca54191c3cf9395ca41ed9b03777774321 27-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed MarcDestructorReferenced -> MarkDestructorReferenced


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5d39dee0cca8d675120791234cd39a622b986f1b 27-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix a bogus error overloading an operator where the only class
parameter has a dependent type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0c6139d0c2497c4e8780340e0dc097de041f248e 27-Jun-2009 Anders Carlsson <andersca@mac.com> Make it possible for using decls to point to operators. Fixes PR4441.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d2b35630d4afc474b766eeab1f1bef469cf633a 27-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to mark destructors when they are used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c6249b9230e1821b0d28f6f2d5c2d793508606fd 26-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Minor change per Doug's comments.
- Fariborz


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

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c75bc2d1f6f637098abc5db4caf0551f9437471e 25-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to diagnose and Mark use of implicit default assignment operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6887e63ff533d46046c47a2f0ea8765914fbfb76 25-Jun-2009 Duncan Sands <baldrick@free.fr> Explicit braces to avoid ambiguous ‘else’.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
220a0f3412dad46d7dadf8b6042783016c029564 24-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Some changes to accomodate Doug's comment for
implicit copy constructor definition determination.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
485f087407849a8989053122f52b8c07d1191b45 23-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> patch to mark use of implicit copy constructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4c4f7cb3a5b692bbc28ff6c5042f540a8e2bf6ac 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Robustify a bunch of C++-related declaration actions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d7f37bf8b9a211455c5037df7b7e88e5a9510119 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Implement implicit instantiation of the member functions of a class template
specialization. At present, all implicit instantiations occur at the
end of the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
05a5c45507243b88ee9e1b3f1ac2fb05b611d7d2 22-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Changes made per Doug's comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b7f4cc09ead099c1306d06db53e258d648d0f652 22-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Remove ImplicitMustBeDefined, use universal 'Used' flag
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3da83eb7bcfa6bd476ab804ecb6cf755b39a6f92 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Made improvements in c++'s object model patch on Doug's review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9cfbe48a7a20a217fdb2920b29b67ae7941cb116 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST support for using declarations, from John Thompson!


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f8dcb866d344aa9355595e14c429852830b63095 19-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Patch for implementation of C++'s object model. This is
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1d1755348d3790ebf019c1c6de58cd1f1fa5295a 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Factor out some common code into Sema::EnterDeclaratorContext/ExitDeclaratorContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0ffd9ffb633ca4886c7db4dd12dc36bdad3d797c 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement correct name lookup inside an initializer of a C++ class static data member.

Fixes "test/CXX/basic/basic.lookup/basic.lookup.unqual/p13.cpp" test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8bc3fa4eb6bcb307bef7965a9578afffe22eab4b 18-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Removed deadcode related to addition of constructor
decls to a class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9cdda0cf8528e3d595be9bfa002f0450074beb4d 17-Jun-2009 Douglas Gregor <dgregor@apple.com> Support dependent extended vector types and template instantiation
thereof. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f54741e6465692d3bdbae974ac3beeeab92e4a95 16-Jun-2009 Anders Carlsson <andersca@mac.com> Handle temporaries in default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5e300d1a8e37f24e71f8cf204b982f20f85cf91a 12-Jun-2009 Anders Carlsson <andersca@mac.com> It's an error to use a function declared in a class definition as a default argument before the function has been declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ae0b4e7be78cf0dc2a6a333e865c2be9265774f9 06-Jun-2009 Anders Carlsson <andersca@mac.com> Make ParmVarDecl::getDefaultArg() more robust, it now asserts that the argument is not unparsed. Add a new hasDefaultArg() and use it in places where getDefaultArg() was called when the argument was unparsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
6c9c94053132e5ca0655124b70f1c386a332e71d 30-May-2009 Douglas Gregor <dgregor@apple.com> Pretty printing and improved representation for namespace alias declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8419fa3af97208eb00f0cd6c62354ce4ff986677 30-May-2009 Douglas Gregor <dgregor@apple.com> Printing for using directives, e.g.,

using namespace std::debug;

Extended UsingDirectiveDecl to store the nested-name-specifier that
precedes the nominated namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6569d68745c8213709740337d2be52b031384f58 28-May-2009 Douglas Gregor <dgregor@apple.com> Reimplement much of the way that we track nested classes in the
parser. Rather than placing all of the delayed member function
declarations and inline definitions into a single bucket corresponding
to the top-level class, we instead mirror the nesting structure of the
nested classes and place the delayed member functions into their
appropriate place. Then, when we actually parse the delayed member
function declarations, set up the scope stack the same way as it was
when we originally saw the declaration, so that we can find, e.g.,
template parameters that are in scope.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
465226e23a3008bd68973513dda1f9e3cd27dbdd 28-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
78d1583d0b36b7d6d8d10234cdc19ab94adf765a 26-May-2009 Douglas Gregor <dgregor@apple.com> When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6865480f0ccf049ef53bd1e058aaacc4f77beebe 19-May-2009 Anders Carlsson <andersca@mac.com> When assigning from an rvalue to a const reference, the implicit cast from T -> const T is not an lvalue cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2f2433f2c4965640e3eea62c87deb7292492b10f 18-May-2009 Douglas Gregor <dgregor@apple.com> Deal with an icky corner case where we were complaining that a catch
statement was using an rvalue reference during the template
definition. However, template instantiations based on an lvalue
reference type are well-formed, so we delay checking of these property
until template instantiation time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d308e6201afd3a8a198c52ba034d35ed19d4bafe 18-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ try/catch statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8ff8c2278cf5ef26e40314dfbb363e32542da032 17-May-2009 Anders Carlsson <andersca@mac.com> Rewrite PureVirtualMethodCollector to use the overridden methods. Fixes <rdar://problem/6854087>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
c3a68b25cdd687d4beb59f083fcb22afe173286f 14-May-2009 Anders Carlsson <andersca@mac.com> Better diagnostics for covariance when checking overriding return types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d7ba27dc562e1837703fa8696531c1f21a5fdb36 14-May-2009 Anders Carlsson <andersca@mac.com> Add return type checking for overriding virtual functions. We currently don't check covariance but that's next.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0033836b3c4bb578ef999813de4f5f1a24862d18 12-May-2009 Anders Carlsson <andersca@mac.com> Friend declarations are only valid inside class definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
42af25f865a82022a04bedeb483ac251c4412e29 11-May-2009 Douglas Gregor <dgregor@apple.com> Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:

template<typename T, typename U>
struct X {
typedef T type;

X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
bfa2fcba545fb270f31205d616846c2bfaf4e47e 07-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f1b1d59a3f0650ab97b04235a14ae4549ca1c656 01-May-2009 Anders Carlsson <andersca@mac.com> Replace a bunch of static_cast + release with takeAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7786d1c5d752b90ff74093bd1ffda37daf0dbe6e 01-May-2009 Anders Carlsson <andersca@mac.com> C++ destructors can have a single unnamed void parameter. Fixes <rdar://problem/6841210>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4649cac75c3cb80d543c6d90269388277228508d 01-May-2009 Anders Carlsson <andersca@mac.com> Rework the way we handle constructor decls to be less hacky and fix PR3948 completely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7b9a2ee5a4393001bdec7dec841eb7c811da492c 30-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make a home for exception specs in the AST. Now Sema can hook them up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
13e8854b186265a601545ca88f8f495fb3fb5654 27-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Track down return statements in the handlers of a function-try-block of constructors. Meh ...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fef9f59e80275cc7515676ee6d8cc539ef155b47 27-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Don't allow catch declarations to name an abstract class

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6e4750188e836e119f8605cbd34023d0a3b18011 25-Apr-2009 Chris Lattner <sabre@nondot.org> change a couple more c++ sema methods to be based on isinvalid bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6540180c2fd7a5b4963b22dc81461b73927499a8 25-Apr-2009 Chris Lattner <sabre@nondot.org> various "is invalid" cleanups for C++ ctors/dtors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eaaebc7cf10dc1a2016183a262ad3256bc468759 25-Apr-2009 Chris Lattner <sabre@nondot.org> This is a pretty big cleanup for how invalid decl/type are handle.
This gets rid of a bunch of random InvalidDecl bools in sema, changing
us to use the following approach:

1. When analyzing a declspec or declarator, if an error is found, we
set a bit in Declarator saying that it is invalid.
2. Once the Decl is created by sema, we immediately set the isInvalid
bit on it from what is in the declarator. From this point on, sema
consistently looks at and sets the bit on the decl.

This gives a very clear separation of concerns and simplifies a bunch
of code. In addition to this, this patch makes these changes:

1. it renames DeclSpec::getInvalidType() -> isInvalidType().
2. various "merge" functions no longer return bools: they just set the
invalid bit on the dest decl if invalid.
3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator
methods now set invalid on the decl returned instead of returning an
invalid bit byref.
4. In SemaType, refering to a typedef that was invalid now propagates the
bit into the resultant type. Stuff declared with the invalid typedef
will now be marked invalid.
5. Various methods like CheckVariableDeclaration now return void and set the
invalid bit on the decl they check.


There are a few minor changes to tests with this, but the only major bad
result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this
next.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
49d44018436761c0cfdda80d609b7dcdf8431064 24-Apr-2009 Anders Carlsson <andersca@mac.com> Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithConstructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
76458501a8963fa11b91c9337a487de6871169b4 17-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement lvalue test for conditional expressions.
Add a few commented lines to the test case that point out things that don't work yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
072abefcddea5fb65e435cea60921b3c21c1279d 17-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for the __has_trivial_destructor type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
930e8d0c2f0b30da3a6a9c440503976d8250e7cf 17-Apr-2009 Anders Carlsson <andersca@mac.com> If a class has a non-trivial constructor that doesn't take any arguments, we will now make an implicit CXXTemporaryObjectExpr. So

struct S {
S();
};

void f() {
S s;
}

's' here will implicitly be declared as.

S s = S();



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
098a3df455346a4c2ee3e0372dbb8ca7ff230f04 16-Apr-2009 Anders Carlsson <andersca@mac.com> When we create an implicit CXXTemporaryObjectExpr we don't need to check that it's a valid init. Instead, just set it as the VarDecl's initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3cbc3cf55059f50ade9d47a4b222bfbe047638d2 16-Apr-2009 Anders Carlsson <andersca@mac.com> Disable the code I added before until I understand what's causing default2.cpp to fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
347ba89dec89091868982434154c3508085b727a 16-Apr-2009 Anders Carlsson <andersca@mac.com> Add support for the __has_trivial_constructor type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ca29ad9fea0fd51ac622c3f2db1890fdc5dae201 15-Apr-2009 Anders Carlsson <andersca@mac.com> When declaring a variable that has a constructor and a direct initializer, for example:

struct X {
X(int, int);
};

X x(10, 10);

we model that as

X x = X(10, 10);

inserting a temporary object expr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b6688e02d2cea9a1e2519654133ac2aa81fd8055 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix some out of date comments pointed out by Sebastian


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
558cb56caf8906e0adbe643e3febbef0b7af1b9f 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Introduce a "-fixit" mode to clang-cc that applies code-modification hints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
682bf92db408a6cbc3d37b5496a99b6ef85041ec 29-Mar-2009 Chris Lattner <sabre@nondot.org> Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc). These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
64540d71b4aaab07d93cb3593ce462d26a83d326 29-Mar-2009 Chris Lattner <sabre@nondot.org> various cleanups


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
81c85c421197a602523781a6ef730639c4c6ea51 29-Mar-2009 Anders Carlsson <andersca@mac.com> More improvements to namespace aliases. We now support everything except aliases in using directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dd729fce03899ed03a212a49d7b03e043ce6ed40 29-Mar-2009 Anders Carlsson <andersca@mac.com> Fix lookup bug

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
68771c73f4293620dc1a99154ec02111e6490e28 28-Mar-2009 Anders Carlsson <andersca@mac.com> Create AST nodes for namespace aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
03bd5a1e9a54b62b10ae8aeb6eb5245e2031d98b 28-Mar-2009 Anders Carlsson <andersca@mac.com> Parse the location of the 'namespace' token to ActOnNamespaceAliasDef. No functionality change.

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a1a1b306946e5730f7a47f7be920061cfd7e7259 28-Mar-2009 Anders Carlsson <andersca@mac.com> As Eli pointed out, it is possible that a namespace lookup is ambiguous!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5721c68299edddd6d6dc32f6ea5441bcfa20dfd8 28-Mar-2009 Anders Carlsson <andersca@mac.com> Check that the alias points to a valid namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8d7ba402ba062994e242c97719685d6d66a056dd 28-Mar-2009 Anders Carlsson <andersca@mac.com> Check that the namespace alias doesn't conflict with a previous declaration in this scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dbb0094f441d2f15dd6eee581e1569244a26009f 28-Mar-2009 Anders Carlsson <andersca@mac.com> Add an ActOnNamespaceAliasDef action and have the parser call it.

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

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



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c60e88819a273d54faa71a2cd6c3d79dd48c12e0 27-Mar-2009 Anders Carlsson <andersca@mac.com> Move Sema::SetMemberAccessSpecifier to SemaAccess.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
332975661d287082f64d260ef6ac5f36499d478f 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve recovery when a constructor fails to type-check. Test case from Anders

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ab452ba8323d1985e08bade2bced588cddf2cc28 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Revamp our representation of C++ nested-name-specifiers. We now have a
uniqued representation that should both save some memory and make it
far easier to properly build canonical types for types involving
dependent nested-name-specifiers, e.g., "typename T::Nested::type".

This approach will greatly simplify the representation of
CXXScopeSpec. That'll be next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
05bf2c79770927c66ca725e9bb589048ed3f069e 27-Mar-2009 Anders Carlsson <andersca@mac.com> Add

const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
AccessSpecifier AS);

so we can easily add access specifiers to diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0cf8830a45115176ef5ba5416b7ad7aa9d5cb255 26-Mar-2009 Anders Carlsson <andersca@mac.com> Factor the member access specifier setting code into its own function. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a7b3521ef52d983bd0e7fa562bb9ef1393f14634 25-Mar-2009 Anders Carlsson <andersca@mac.com> Improve handling of base initializers. We now parse initializers in out of line decls, such as:

class C {
C() { }

int a;
};

C::C() : a(10) { }

We also diagnose when initializers are used on declarations that aren't constructors:

t.cpp:1:10: error: only constructors take base initializers
void f() : a(10) { }
^

Doug and/or Sebastian: I'd appreciate a review, especially the nested-name-spec test results (from the looks of it we now match gcc in that test.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
50de12f5783b57c74fd30ebfa3945181313625ff 24-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Parse deleted function definitions and hook them up to Doug's machinery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e65a3c8f181adc42786e0a409cd1e827f4ab37ff 24-Mar-2009 Anders Carlsson <andersca@mac.com> Fix the bug that Eli noticed where we wouldn't look at function decls outside the class declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
615c5d4674355ba830b9978f462ca7a8c5d15f85 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5eff73c7679349f39e3602e05fff1ff347a28858 24-Mar-2009 Anders Carlsson <andersca@mac.com> Handle pointers to arrays of abstract types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8211effbd3abc5948a5d6924c87e72323016a376 24-Mar-2009 Anders Carlsson <andersca@mac.com> More work on diagnosing abstract classes. We can now handle cases like

class C {
void g(C c);

virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
11f21a08cd40caec93e088c404bbf3136917a035 23-Mar-2009 Anders Carlsson <andersca@mac.com> More improvements to abstract type checking. Handle arrays correctly, and make sure to check parameter types before they decay.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b9bbe49f513080b3307e88bdee0d383f4b8c1d4e 23-Mar-2009 Anders Carlsson <andersca@mac.com> It's an error to try to allocate an abstract object using new.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
dfe292dbebe84bc3a19dba83e9eef52d56492b0a 22-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix build from r67476 and address the easy part of Doug's comments on rvalue refs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4681ebd429846ed98e7beaf49934fa347ff22152 22-Mar-2009 Anders Carlsson <andersca@mac.com> Disallow abstract types where appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
67e4dd2e9936d828d68b20e01922b6442c6ce31b 22-Mar-2009 Anders Carlsson <andersca@mac.com> Keep track of whether a class is abstract or not. This is currently only used for the __is_abstract type trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a representation for types that we referred to via a
qualified name, e.g.,

foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in

::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ca5e77fefc4ac06aa787d7e777957ba6b7a03c60 18-Mar-2009 Douglas Gregor <dgregor@apple.com> The scope representation can now be either a DeclContext pointer or a
Type pointer. This allows our nested-name-specifiers to retain more
information about the actual spelling (e.g., which typedef did the
user name, or what exact template arguments were used in the
template-id?). It will also allow us to have dependent
nested-name-specifiers that don't map to any DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
94b15fbc3a10cdfb1639528a8a773b66a1e7cd9e 15-Mar-2009 Anders Carlsson <andersca@mac.com> Handle static_asserts when instantiating structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f53597fb16142bdb4a66901f8c0b768db4f2a548 15-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
77d81422f8db885bbe4740eb90debf4248478890 15-Mar-2009 Anders Carlsson <andersca@mac.com> Make sure to release the expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c3082413e4207173b32c118e922d63149df6261f 14-Mar-2009 Anders Carlsson <andersca@mac.com> Handle dependent types/exprs in static_assert expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
fb311762bb52dc015c02cb257d2913f104b556f8 14-Mar-2009 Anders Carlsson <andersca@mac.com> More static_assert work. Check that the assert expr is valid and show an error if it's false. Create the declaration and add it to the current context.

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
021c3b372c58f5423b4fa2a5be6933d1c7ecc663 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Move most of the checking from ActOnCXXMemberDeclarator to other, more general routines. This is a step toward separating the checking logic from Declarators, which in turn is required for template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4dd55f511d1fba732f2968f430ce999fc8293896 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Make sure that we set the access specifier for an instantiated FieldDecl, and that the aggregate and POD flags for an instantiated class template are updated based on instantiation of a FieldDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ff7fea809bab2badd0cb241703b14ac20ac258cb 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXClassMemberWrapper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2d2e9cfdc1dbb6e4a22f8c0b1abcd30437e3795d 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXClassVarDecl. It doesn't add anything

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3cf538d5c49bbebac1afa6f4a5010e3d877440bb 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement basic template instantiation for fields. Reshuffle checking
for FieldDecls so that the parser and the template instantiation make
use of the same semantic checking module.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
26dce44534602660ea9f4152bffc5436fc5fe3b2 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Limit the template instantiation depth to some user-configurable value
(default: 99). Beyond this limit, produce an error and consider the
current template instantiation a failure.

The stack we're building to track the instantiations will, eventually,
be used to produce instantiation backtraces from diagnostics within
template instantiation. However, we're not quite there yet.

This adds a new Clang driver option -ftemplate-depth=NNN, which should
eventually be generated from the GCC command-line operation
-ftemplate-depth-NNN (note the '-' rather than the '='!). I did not
make the driver changes to do this mapping.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
40808ce6ac04b102c3b56244a635d6b98eed6d97 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for ClassTemplateSpecializationTypes,
such as replacing 'T' in vector<T>. There are a few aspects to this:

- Extend TemplateArgument to allow arbitrary expressions (an
Expr*), and switch ClassTemplateSpecializationType to store
TemplateArguments rather than it's own type-or-expression
representation.

- ClassTemplateSpecializationType can now store dependent types. In
that case, the canonical type is another
ClassTemplateSpecializationType (with default template arguments
expanded) rather than a declaration (we don't build Decls for
dependent types).

- Split ActOnClassTemplateId into ActOnClassTemplateId (called from
the parser) and CheckClassTemplateId (called from
ActOnClassTemplateId and InstantiateType). They're smart enough to
handle dependent types, now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
86447ec25fa34aa3c2f48ebc49ec09bc1f03f002 09-Mar-2009 Douglas Gregor <dgregor@apple.com> Rename DiagnoseIncompleteType to RequireCompleteType, and update the documentation to reflect the fact that we can instantiate templates here

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6f8ce146b52eace27f33bf6e0788f4be4f104404 06-Mar-2009 Chris Lattner <sabre@nondot.org> more minor simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8b963ef99be6235f1e9fe866180fff7dbbe5e85b 06-Mar-2009 Chris Lattner <sabre@nondot.org> refactor C++ bitfield checking a bit (haha)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
247936605913c718f4141f845aec6cb6e169fb37 05-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR3607 and a fixme, by checking bitfield constraints
more consistently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2943aed177b33ae3f14273b11a7b398e5276ec62 03-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement the basics of implicit instantiation of class templates, in
response to attempts to diagnose an "incomplete" type. This will force
us to use DiagnoseIncompleteType more regularly (rather than looking at
isIncompleteType), but that's also a good thing.

Implicit instantiation is still very simplistic, and will create a new
definition for the class template specialization (as it should) but it
only actually instantiates the base classes and attaches
those. Actually instantiating class members will follow.

Also, instantiate the types of non-type template parameters before
checking them, allowing, e.g.,

template<typename T, T Value> struct Constant;

to work properly.



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

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

As part of this, some types have been renamed:

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

There shouldn't be any functionality change...


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

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

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



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cda9c674998aedeb9319e95a0284f4d266dcef32 16-Feb-2009 Douglas Gregor <dgregor@apple.com> Adopt a more principled approach to invalid declarations:
- If a declaration is an invalid redeclaration of an existing name,
complain about the invalid redeclaration then avoid adding it to
the AST (we can still parse the definition or initializer, if any).
- If the declaration is invalid but there is no prior declaration
with that name, introduce the invalid declaration into the AST
(for later error recovery).
- If the declaration is an invalid redeclaration of a builtin that
starts with __builtin_, we produce an error and drop the
redeclaration. If it is an invalid redeclaration of a library
builtin (e.g., malloc, printf), warn (don't error!) and drop the
redeclaration.

If a user attempts to define a builtin, produce an error and (if it's
a library builtin like malloc) suggest -ffreestanding.

This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is
still going to cause some problems when builtins are redeclared
without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1a51b4a11b7db25cac2134249711ecaaf9d1c0a8 09-Feb-2009 Douglas Gregor <dgregor@apple.com> Make Sema::getTypeName return the opaque pointer of a QualType rather
than a Decl, which gives us some more flexibility to express the
results with the type system. There are no clients using this
flexibility yet, but it's meant to be able to describe qualified names
as written in the source (e.g., "foo::type") or template-ids that name
a class template specialization (e.g., "std::vector<INT>").

DeclSpec's TST_typedef has become TST_typename, to reflect its use to
describe types found by name (that may or may not be typedefs). The
type representation of a DeclSpec with TST_typename is an opaque
QualType pointer. All users of TST_typedef, both direct and indirect,
have been updated for these changes.



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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
aaba5e346dffdbad5d1c42765a89e4a7afb0da67 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
47b9a1ca55e61e37f5a368740e29de190345acc6 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Some name-lookup-related fixes, from Piotr Rak!

- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b696ea3a0693798daeafd896d77f0b8f1fec3cc5 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Diagnose ambiguities in getTypeName. Fixes http://llvm.org/bugs/show_bug.cgi?id=3475

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2a3009a432bdcec59e6383d7b2b17494d6f91649 03-Feb-2009 Douglas Gregor <dgregor@apple.com> Semantic analysis, ASTs, and unqualified name lookup support for C++
using directives, from Piotr Rak!


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

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



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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
3e8ffd2e96e7842245f1ae0cb631eba75da1a6f7 29-Jan-2009 Steve Naroff <snaroff@apple.com> Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInContext().

The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert.

The plan is to eventually deprecate both of these functions. For now, I'm focused on performance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b43a50ff1b0b171ece84425b0ad83a9a31f038fa 28-Jan-2009 Steve Naroff <snaroff@apple.com> Name change (isTypeName->getTypeName).
Since it doesn't return a bool, is shouldn't be prefixed with 'is'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
939837f67e0558668be9afec67f2e51eb40d86f0 28-Jan-2009 Steve Naroff <snaroff@apple.com> Remove 'enableLazyBuiltinCreation' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
1833a83368bda46b76388069e52b27f12e60dc9c 20-Jan-2009 Chris Lattner <sabre@nondot.org> Fix a crash Anders' was seeing due to free'ing an invalid pointer
caused by my previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4afa39deaa245592977136d367251ee2c173dd8d 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4ec339f43c0cae2678334850c90926bea10999c7 19-Jan-2009 Douglas Gregor <dgregor@apple.com> Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type).
Fixes <rdar://problem/6500531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb11cd078ba8682bbb9b082f8f6ead8be5c98581 14-Jan-2009 Douglas Gregor <dgregor@apple.com> Refactor name lookup.

This change refactors and cleans up our handling of name lookup with
LookupDecl. There are several aspects to this refactoring:

- The criteria for name lookup is now encapsulated into the class
LookupCriteria, which replaces the hideous set of boolean values
that LookupDecl currently has.

- The results of name lookup are returned in a new class
LookupResult, which can lazily build OverloadedFunctionDecls for
overloaded function sets (and, eventually, eliminate the need to
allocate member for OverloadedFunctionDecls) and contains a
placeholder for handling ambiguous name lookup (for C++).

- The primary entry points for name lookup are now LookupName (for
unqualified name lookup) and LookupQualifiedName (for qualified
name lookup). There is also a convenience function
LookupParsedName that handles qualified/unqualified name lookup
when given a scope specifier. Together, these routines are meant
to gradually replace the kludgy LookupDecl, but this won't happen
until after we have base class lookup (which forces us to cope
with ambiguities).

- Documented the heck out of name lookup. Experimenting a little
with using Doxygen's member groups to make some sense of the Sema
class. Feedback welcome!

- Fixes some lingering issues with name lookup for
nested-name-specifiers, which now goes through
LookupName/LookupQualifiedName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
fc767615bc67d3a7587b1fb2e0494c32c9dbd7a5 14-Jan-2009 Ted Kremenek <kremenek@apple.com> FunctionDecl::setParams() now uses the allocator associated with ASTContext to allocate the array of ParmVarDecl*'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
482b77d1cb4ca08391d1f749436f092a4cc24427 13-Jan-2009 Douglas Gregor <dgregor@apple.com> Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c9b580a4de1824b3155048d31aaa153316e150c2 09-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add some comments to the virtual work. Thanks to Doug Gregor for the review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9ba73ad65446f6bc876f40cced866d85dff754da 09-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Very basic support for pure virtual functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
72de6676bd30f9081ee4166bbe07b4c270258ce6 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Unify the code for defining tags in C and C++, so that we always
introduce a Scope for the body of a tag. This reduces the number of
semantic differences between C and C++ structs and unions, and will
help with other features (e.g., anonymous unions) in C. Some important
points:

- Fields are now in the "member" namespace (IDNS_Member), to keep
them separate from tags and ordinary names in C. See the new test
in Sema/member-reference.c for an example of why this matters. In
C++, ordinary and member name lookup will find members in both the
ordinary and member namespace, so the difference between
IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
only in C++!).
- We always introduce a Scope and push a DeclContext when we're
defining a tag, in both C and C++. Previously, we had different
actions and different Scope/CurContext behavior for enums, C
structs/unions, and C++ structs/unions/classes. Now, it's one pair
of actions. (Yay!)

There's still some fuzziness in the handling of struct/union/enum
definitions within other struct/union/enum definitions in C. We'll
need to do some more cleanup to eliminate some reliance on CurContext
before we can solve this issue for real. What we want is for something
like this:

struct X {
struct T { int x; } t;
};

to introduce T into translation unit scope (placing it at the
appropriate point in the IdentifierResolver chain, too), but it should
still have struct X as its lexical declaration
context. PushOnScopeChains isn't smart enough to do that yet, though,
so there's a FIXME test in nested-redef.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0701bbb228dfd87e1fe82a0a4b7b9facfecb43da 08-Jan-2009 Steve Naroff <snaroff@apple.com> This is a large/messy diff that unifies the ObjC AST's with DeclContext.

- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.

This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6b3945f4bc757bdadd3e443180cf32c2cccb52a0 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Finished semantic analysis of anonymous unions in C++.

Duplicate-member checking within classes is still a little messy, and
anonymous unions are still completely broken in C. We'll need to unify
the handling of fields in C and C++ to make this code applicable in
both languages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ead013e4a89d8a51acacebe541b922b309867642 06-Jan-2009 Chris Lattner <sabre@nondot.org> it is ok to insert empty source ranges into diagnostics, declare variable in an if.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
64b45f7e0d3167f040841ac2920aead7f080730d 05-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> PODness and Type Traits

Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
074149e11baf5f7db12f84efd5c34ba6e35d5cdf 05-Jan-2009 Douglas Gregor <dgregor@apple.com> Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.

Only enumerations and linkage specifications currently use transparent
DeclContexts.

Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f780abc21c39cd4731b9e38f2d2d9f7d1510bd7b 30-Dec-2008 Douglas Gregor <dgregor@apple.com> Parser support for C++ using directives, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
70316a065bcf11c88143e22c88d530ebd320832f 26-Dec-2008 Douglas Gregor <dgregor@apple.com> Add support for out-of-line definitions of conversion functions and member operators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
61366e9cd41a6dbde4e66416dac21269c8ac1d94 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Correct the order in which we cope with end-of-class-definition
semantics and improve our handling of default arguments. Specifically,
we follow this order:

- As soon as the see the '}' in the class definition, the class is
complete and we add any implicit declarations (default constructor,
copy constructor, etc.) to the class.
- If there are any default function arguments, parse them
- If there were any inline member function definitions, parse them

As part of this change, we now keep track of the the fact that we've
seen unparsed default function arguments within the AST. See the new
ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly
cope with calls inside default function arguments to other functions
where we're making use of the default arguments.

Made some C++ error messages regarding failed initializations more
specific.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3fc749d899dfc194162128c1a88933148a39b68d 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't explicitly represent OverloadedFunctionDecls within
DeclContext. Instead, just keep the list of currently-active
declarations and only build the OverloadedFunctionDecl when we
absolutely need it.

This is a half-step toward eliminating the need to explicitly build
OverloadedFunctionDecls that store sets of overloaded
functions. This was suggested by Argiris a while back, and it's a good
thing for several reasons: first, it eliminates the messy logic that
currently tries to keep the OverloadedFunctionDecl in sync with the
declarations that are being added. Second, it will (eventually)
eliminate the need to allocate memory for overload sets, which could
help performance. Finally, it helps set us up for when name lookup can
return multiple (possibly ambiguous) results, as can happen with
lookup of class members in C++.

Next steps: make the IdentifierResolver store overloads as separate
entries in its list rather than replacing them with an
OverloadedFunctionDecl now, then see how far we can go toward
eliminating OverloadedFunctionDecl entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8351da06ca3082dfd49dd8e3c1785a986920f57c 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Full AST support and better Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
4b07b2968f87f3cd5a3d8c76145f1cbfd718d42d 22-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Partial AST and Sema support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
45920e82bd87454545642ee2612e656a4140889d 19-Dec-2008 Douglas Gregor <dgregor@apple.com> Allow downcasts of pointers to Objective-C interfaces, with a
warning. This matches GCC's behavior and addresses
<rdar://problem/6458293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
510ffaefd48b0784367693e823768ac49e288781 17-Dec-2008 Douglas Gregor <dgregor@apple.com> Make the injected-class-name of a C++ class a separate RecordDecl from the class itself, with a different scope. This eliminates some ownership issues, so that the RecordDecl only lives in a single context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cc98eac383718899462b9b1361c46eea8dddfb2b 17-Dec-2008 Chris Lattner <sabre@nondot.org> Move the other Sema::ActOnLinkageSpec to SemaDeclCXX.
Move Sema::ActOnDefs to SemaDeclObjC


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5a003a4b1bddc06d5695ee8a7eb88ae22bb3afbf 17-Dec-2008 Chris Lattner <sabre@nondot.org> Move Sema::ActOnLinkageSpec to SemaDeclCXX.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
72b505b7904b3c9320a1312998800ba76e4f5841 16-Dec-2008 Douglas Gregor <dgregor@apple.com> Delay parsing of default arguments of member functions until the class
is completely defined (C++ [class.mem]p2).

Reverse the order in which we process the definitions of member
functions specified inline. This way, we'll get diagnostics in the
order in which the member functions were declared in the class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9e7d9de3ef538c1473248238b76a6d7b16f5f684 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Place constructors and destructors into the DeclContext of the class,
just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.

Diagnose the redeclaration of member functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0874bd31984529b71aa4ffaac73be948e2402222 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't double-destroy constructors defined out-of-line. This is a
half-solution; the real solution is coming when constructors and
destructors are treated like all other functions by ActOnDeclarator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
798d119415323ebcd029ffe1e0fb442a4ca8adbb 13-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Some utilities for using the smart pointers in Actions, especially Sema. Convert a few functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9d35097bc0fefb2f77638be513cac72d1c09d840 12-Dec-2008 Douglas Gregor <dgregor@apple.com> Enable out-of-line definitions of C++ constructors and destructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
a75023d60fc22cef8c5c0e6ea79758233f4d2e2d 06-Dec-2008 Anders Carlsson <andersca@mac.com> Simplify some diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
d9d22dd9c94618490dbffb0e2caf222530ca39d3 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5f4a6829dc58cab2f76e2b98492859aa3b91e3f2 24-Nov-2008 Chris Lattner <sabre@nondot.org> Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
08631c5fa053867146b5ee8be658c229f6bf127c 23-Nov-2008 Chris Lattner <sabre@nondot.org> Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:

Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e4c452c4c7b9124fe94a96f559ff077d59cdf996 22-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
416e46febcb7084e715fbe0b9bf2cab7a85f5242 21-Nov-2008 Chris Lattner <sabre@nondot.org> merge 3 more diagnostics into 1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
af7ae4e8160fc5c23e471f2125b3fe5911e3532a 21-Nov-2008 Chris Lattner <sabre@nondot.org> Add the concept of "modifiers" to the clang diagnostic format
strings. This allows us to have considerable flexibility in how
these things are displayed and provides extra information that
allows us to merge away diagnostics that are very similar.

Diagnostic modifiers are a string of characters with the regex
[-a-z]+ that occur between the % and digit. They may
optionally have an argument that can parameterize them.

For now, I've added two example modifiers. One is a very useful
tool that allows you to factor commonality across diagnostics
that need single words or phrases combined. Basically you can
use %select{a|b|c}4 with with an integer argument that selects
either a/b/c based on an integer value in the range [0..3).

The second modifier is also an integer modifier, aimed to help
English diagnostics handle plurality. "%s3" prints to 's' if
integer argument #3 is not 1, otherwise it prints to nothing.
I'm fully aware that 's' is an English concept and doesn't
apply to all situations (mouse vs mice). However, this is very
useful and we can add other crazy modifiers once we add support
for polish! ;-)

I converted a couple C++ diagnostics over to use this as an
example, I'd appreciate it if others could merge the other
likely candiates. If you have other modifiers that you want,
lets talk on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
621b3933e570792810386b891264c78e3bd7b169 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't print canonical types in overloading-related diagnostics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
5dc266abe0e8de69788ba67e38047a919f4bc383 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove another old Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d3a94e24ddf3fb90de76b17bd176d9ed61e66f2c 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove another old-school Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3c73c41cefcfe76f36b7bed72c9f1ec195490951 19-Nov-2008 Chris Lattner <sabre@nondot.org> stop calling II::getName() unnecesarily in sema


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
43b628cd47ecdc3caf640d79b3ad7ecef0f2c285 19-Nov-2008 Chris Lattner <sabre@nondot.org> Allow sending IdentifierInfo*'s into Diagnostics without turning them into strings
first. This should allow removal of a bunch of II->getName() calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8365223e5498255a1285b6bb206f5894fe5b83c6 19-Nov-2008 Chris Lattner <sabre@nondot.org> convert some diags to use numbers instead of strings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
fa25bbb351f4fdd977f51254119cdfc2b525ce90 19-Nov-2008 Chris Lattner <sabre@nondot.org> Switch several more Sema Diag methods over. This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59588 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c9c7c4e06bba5dce053162ea1ead5743d7bba35b 18-Nov-2008 Chris Lattner <sabre@nondot.org> start converting Sema over to using its canonical Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a11f42f4bca694b9be91350d0a74815f119e3fbf 18-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement effects of 'mutable', and a few comments from Chris on its parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
10bd36882406cdf4805e35add1ce2f11ab9ae152 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
43c7bad105f742988e7ca40564285c83bea854a5 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Some cleanups for C++ operator overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1adbab67751f44147a0d259b684cf52bae142ef3 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Simplify error messages for two-parameter overloaded increment/decrement operators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2e1cd4264d363ca869bf37ef160902f211d21b8c 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
669d5d74b880a8497b92a3ec159145713f4d6519 15-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement parsing and semantic checking of the 'mutable' keyword.
Thanks to Doug for the review. Actual effects of mutable to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7d7e6727a5de032c86dcb58ae734e7c1603c26e6 13-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't build identifiers for C++ constructors, destructors, or
conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.

This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb8f3063257a392f15aea48d42fb73ec51afc548 12-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

struct X {
operator int const*();
} x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
904eed3f6148758d39a2d3c88f3133274460d645 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Basic support for taking the address of an overloaded function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
cb9b977d5989efc1e5bc7684091912ca2915aacb 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Allow user-defined conversions during reference binding

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
55c60954c273c225777276cbd9db477939c6f073 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Don't create a typedef for the injected-class-name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
02bcd4cd1a19121da12884aa4943226f72a81e6c 10-Nov-2008 Douglas Gregor <dgregor@apple.com> Some cleanups to the declaration/checking of overloaded operators in C++. Thanks to Sebastian for the review

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ef6e647b8d3268a765c2c4dd7f8a73cad281a8e6 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement Sema support for C++ nested-name-specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb83ecde1a822b1c38cd060a85a08c1ac9f82cf8 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2f1bc5285ccd40f411af5f5993f013e27e74ab78 07-Nov-2008 Douglas Gregor <dgregor@apple.com> Parsing, ASTs, and semantic analysis for the declaration of conversion
functions in C++, e.g.,

struct X {
operator bool() const;
};

Note that these conversions don't actually do anything, since we don't
yet have the ability to use them for implicit or explicit conversions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1cd1b1e987f5e2f060d7972b13d83239b36d77d6 06-Nov-2008 Douglas Gregor <dgregor@apple.com> Parsing, ASTs, and semantic analysis for the declaration of overloaded
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d93f0ddba0965ded252e228134b30ce30e863fb0 06-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Sema-check virtual declarations. Complete dynamic_cast checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
42a552f8200ba5948661aee0106fce0c04e39818 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Parsing, representation, and preliminary semantic analysis of destructors.

Implicit declaration of destructors (when necessary).

Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
64bffa9a6f40e5a3d5556f994f09f7bf45eecd4c 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Keep track of whether a C++ class is an aggregate. Don't allow initialization of non-aggregates with initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f03d7c7af2ca8555c513ba7667acffb667445ecd 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Implement C++ copy-initialization for declarations. There is now some
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
7ad8390f7992ab7f19b1460c5f0b9d96f165c4e9 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
796da18402f286b897782a298ae3b20c459c102e 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Create a new expression class, CXXThisExpr, to handle the C++ 'this' primary expression. Remove CXXThis from PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
eb704f22ef00a2b41ff1ccf1b20016d7cd4c5c85 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Now that we have copy initialization support, use it for checking the default arguments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3996f23ac20de411e0b5931a451bd05142f0b712 04-Nov-2008 Douglas Gregor <dgregor@apple.com> Diagnose use of 'this' in a C++ default argument. Thanks to Eli for correcting my bogus assertion about it already being handled

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
30c5436856b33e15387ec7a14bcd10c49236e340 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Check that this cannot be used in a default argument. Happily, it was already implemented

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
18fe56863be253a27b940022d27a3101778adaf6 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Implicit support for direct initialization of objects of class type, e.g.,

X x(5, 7);




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
225c41eb3e960fd2e1d1b547f0f19a278d608bc5 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Standard conversion sequences now have a CopyConstructor field, to
cope with the case where a user-defined conversion is actually a copy
construction, and therefore can be compared against other standard
conversion sequences. While I called this a hack before, now I'm
convinced that it's the right way to go.

Compare overloads based on derived-to-base conversions that invoke
copy constructors.

Suppress user-defined conversions when attempting to call a
user-defined conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
396b7cd9f6b35d87d17ae03e9448b5c1f2184598 03-Nov-2008 Douglas Gregor <dgregor@apple.com> Add implicitly-declared default and copy constructors to C++ classes,
when appropriate.

Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
030ff0cdad79b9e0602e143e0669364d2bad8bd2 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Semantic checking of constructor declarations and classification of default/copy constructors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
60d62c29d260596454aaf4cb50cbc756ac08875e 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement basic support for converting constructors in user-defined
conversions.

Notes:
- Overload resolution for converting constructors need to prohibit
user-defined conversions (hence, the test isn't -verify safe yet).
- We still use hacks for conversions from a class type to itself.
This will be the case until we start implicitly declaring the appropriate
special member functions. (That's next on my list)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
31fc07df7f0fc89ebf83ca05a20b29de45a7598d 31-Oct-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
etc more generic. For some targets, long may not be equal to pointer size. For
example: PIC16 has int as i16, ptr as i16 but long as i32.

Also fixed a few build warnings in assert() functions in CFRefCount.cpp,
CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b48fe3812047e84164925c8938ce82be0624c40c 31-Oct-2008 Douglas Gregor <dgregor@apple.com> Add support for parsing and representing C++ constructor declarations.

Notes:
- Constructors are never found by name lookup, so they'll never get
pushed into any scope. Instead, they are stored as an
OverloadedFunctionDecl in CXXRecordDecl for easy overloading.
- There's a new action isCurrentClassName that determines whether an
identifier is the name of the innermost class currently being defined;
we use this to identify the declarator-id grammar rule that refers to
a type-name.
- MinimalAction does *not* support parsing constructors.
- We now handle virtual and explicit function specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3205a7821dc5bb33a9cc4f51a500bc4e79ac967e 30-Oct-2008 Douglas Gregor <dgregor@apple.com> Improve documentation for Sema::CheckReferenceInit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f70bdb9463a6e3ea2c6307b2c7a5f3e2c6b7e489 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement overloading rules for reference binding

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
15da57e66cade0c2cab752f925e838b22daadafc 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Tweak Sema::CheckReferenceInit so that it (optionally) computes an
ImplicitConversionSequence and, when doing so, following the specific
rules of [over.best.ics].

The computation of the implicit conversion sequences implements C++
[over.ics.ref], but we do not (yet) have ranking for implicit
conversion sequences that use reference binding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
27c8dc06f65d7abcf6a7e7f64a7960c9a150ca01 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
57c856b96e6bbfc64c2d61b950b116b523dc3e46 23-Oct-2008 Douglas Gregor <dgregor@apple.com> Clean up and document the representation of C++ base classes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
0218936235b137bbdcd29a6c36d61d9215bb4edd 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Added GraphViz visualization of C++ inheritance hierarchies.

Factored the QualTypeOrdering predicate into its own header
(TypeOrdering.h), now that it is used in two places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f8268ae3196002bbab6adb830302e79b0f368f13 22-Oct-2008 Douglas Gregor <dgregor@apple.com> Add representation of base classes in the AST, and verify that we
don't have duplicated direct base classes.

Seriliazation of base class specifiers is not yet implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8e9bebdea69c590dedfbf27374114cb76fe12fbd 21-Oct-2008 Douglas Gregor <dgregor@apple.com> Preliminary support for function overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
d6caa9ef4cc68290b0bf33432934cc11dd5594e6 15-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix this bug:

typedef int f();
struct S {
f *x; // incorrectly assuming this is function decl, leading to failed assertions.
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
154d8e2280b82dbffea2565dec5b22cebb4ba7a9 14-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert my previous change, got stupidly confused with my local changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
be6e3101e79abb65e1d9016565a39eaa36084ce9 14-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix a call to Sema::LookupDecl that had incorrect parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
de933f025e839bde4b119f3437c320c2137bbe1f 09-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix a bug that crashed clang when parsing this:

class C {
static const int number = 50;
static int arr[number];
};

Here's how it worked:
-GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator and Sema::ActOnDeclarator.
-VariableArrayTypes are not uniqued so two VariableArrayTypes were created with the same DeclRefExpr.
-On exit they both tried to destroy that one DeclRefExpr.

The fix is not to use GetTypeForDeclarator from the Sema::ActOnCXXMemberDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
ce8e2926d8922bff7dc2661ec9c043dd619dcc82 07-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr.
Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization.

In the case of "int x( expression );":
-The Init expression of VarDecl 'x' will be the expression inside the parentheses.
-VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
15f613987a24198468a5a696adcca49f4e363ae3 06-Oct-2008 Ted Kremenek <kremenek@apple.com> Use "unsigned" instead of "int" for i to remove a "comparison between unsigned and signed" warning (potential integer overflow).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
06ad1f5d7349442687d5116ec8ea38786ee71735 06-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> The current semantic process for direct initializers won't work properly for class types.
Add a FIXME until class constructors are supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
73a0d889eda0f000a441319e39540509175b8e81 06-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for C++ direct initializers in declarations, e.g. "int x(1);".

This is how this kind of initializers appear in the AST:
-The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
-The new VarDecl::hasCXXDirectInitializer() returns true.

e.g, for "int x(1);":
-VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
-hasCXXDirectInitializer() of VarDecl 'x' returns true.

A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
Note that codegening works now for "int x(1);" without any changes to CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
1bfe1c2129771c06fb58ae5e8c079ae30e138309 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Pass postfix attributes to ActOnFields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2fac626e2ab4093d4b49c09ab475c5ed8bc9e3e8 10-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use Sema::isDeclInScope instead of IdentifierResolver::isDeclInScope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.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/SemaDeclCXX.cpp
a4755c6ffab02586162170199d0c0594efaa273c 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> When in C++, invoke ASTConsumer::HandleTagDeclDefinition in Sema::ActOnFinishCXXClassDef,
at which point the C++ struct/class/union is fully parsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
5b7f0c8f470f0b23ee95e467b5951e2bed733be1 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
914701ed49f31323176a784b49df05a0d177d1ad 05-Aug-2008 Daniel Dunbar <daniel@zuster.org> Move AsmLabel into Declarator instead of just a parameter to
ActOnDeclarator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
a80f8749f2968d19595ca2544114932bf0ca2c11 05-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add more Parser/Sema support for GCC asm-label extension.
- ActOnDeclarator now takes an additional parameter which is the
AsmLabel if used. Its unfortunate that this bubbles up this high,
but we cannot just lump it in as an attribute without mistakenly
*accepting* it as an attribute.
- The actual asm-label itself is, however, encoded as an AsmLabelAttr
on the FunctionDecl.
- Slightly improved parser error recovery on malformed asm-labels.
- CodeGen support still missing...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
39caa088097dbd2c805041bfd964b3fb9026d0be 01-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Wherever a type is used/returned from the Action module, use TypeTy instead of DeclTy or void.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
b77792eabf5882cf9af8cc810599b20432fda6c2 27-Jul-2008 Chris Lattner <sabre@nondot.org> change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
07952324dda0e758c17f8bc3015793c65c51c48c 01-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add Sema support for C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.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/SemaDeclCXX.cpp
c9a9200de60042a6142f0e37fa6d8f86fd1000f6 06-Jun-2008 Steve Naroff <snaroff@apple.com> Oops...remove weird printf:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
c7333881dcd00be87814d03c349dd96c815f2f05 06-Jun-2008 Steve Naroff <snaroff@apple.com> Second half of "fix" for <rdar://problem/5986085> clang on xcode: error: redefinition of 'XCElementToggler' as different kind of symbol


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
f494b579b22f9950f5af021f0bf9879a91bb8b41 29-May-2008 Steve Naroff <snaroff@apple.com> - Move ObjC Expresssion AST's from Expr.h => ExprObjC.h
- #include ExprObjC.h in many places


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
00bc645d154f8f30bfbfb2fe508caf087793157c 10-May-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Implement proper name lookup for namespaces.
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
6d6eb57225b53fb627c565861d1d0e90645400d1 07-May-2008 Douglas Gregor <dgregor@apple.com> Diagnose attempts to use C++ default arguments outside of a function declaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
2d1c5d313cd0c229cc614e74baa4c5756a4b46f4 27-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parsing of namespaces:

-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
248a753f6b670692523c99afaeb8fe98f7ae3ca7 16-Apr-2008 Steve Naroff <snaroff@apple.com> Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
e37ac4ff1620ed2d7026f52baccbfa022d79ced1 13-Apr-2008 Douglas Gregor <dgregor@apple.com> This patch adds very basic support for parsing and type-checking class
inheritance in C++. It'll parse the base-specifier list, e.g.,

class D : public B1, virtual public B2 { };

and do some of the simpler semantic checks (B1 and B2 are classes;
they aren't unions or incomplete types, etc).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
9e979557eea3875c9e3d100c68188233dd7f46c0 13-Apr-2008 Chris Lattner <sabre@nondot.org> Default argument cleanups and minor improvements, patch by
Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
8123a95c33b792d35c2e4992ba6e27882748fb0d 10-Apr-2008 Chris Lattner <sabre@nondot.org> Several improvements from Doug Gregor related to default
argument handling. I'll fix up the c89 (void) thing next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDeclCXX.cpp
3d1cee369820dba83d7fccc605b91e838cf412b4 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


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