History log of /external/clang/lib/Sema/SemaDecl.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9f55983d966bbf3e6916b5cf5b35acfab2944887 10-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: Improving diagnostocs for missing call to
super's annotated methods. // rdar://6386358


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
841011373b345cf79d0da4b7242dcf2869a43502 08-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C: introduce __attribute((objc_requires_super)) on method
in classes. Use it to flag those method implementations which don't
contain call to 'super' if they have 'super' class and it has the method
with this attribute set. This is wip. // rdar://6386358


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
31ba6135375433b617a8587ea6cc836a014ebd86 06-Sep-2012 Roman Divacky <rdivacky@freebsd.org> Dont cast away const needlessly. Found by gcc48 -Wcast-qual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
69e4826edc1858d9e2cdef508b469af750ec2b09 06-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13775: When checking for a tag type being shadowed by some other declaration,
don't trample over the caller's LookupResult in the case where the check fails.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
37c765a5ccf69fb9a467c8499675ae568811afe3 05-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> c error recovery. treat an invalid redeclaration
of a c-function for what it is. Otherwise, this func
is treated as an overloadable c-function resulting in
a crash much later. // rdar://11743706


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
ccc4f283cf0e892e19a097a2aa4ec4491682b15f 30-Aug-2012 Douglas Gregor <dgregor@apple.com> The presence of a user-*declared* constructor makes the default
constructor not user provided (and, therefore, non-trivial). Fixes
<rdar://problem/11736429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9f6419f96d6cad3f7bd39f444cfc784ccbbdcd65 30-Aug-2012 Richard Trieu <rtrieu@google.com> Add -Wduplicate-enum warning. Clang will emit this warning when an implicitly
initiated enum constant has the same value as another enum constant.

For instance:
enum test { A, B, C = -1, D, E = 1 };
Clang will warn that:
A and D both have value 0
B and E both have value 1

A few exceptions are made to keep the noise down. Enum constants which are
initialized to another enum constant, or an enum constant plus or minus 1 will
not trigger this warning. Also, anonymous enums are not checked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c0c00664887f5d99780c9b3e33e2f204712823b7 28-Aug-2012 Peter Collingbourne <peter@pcc.me.uk> CUDA: give static storage class to __shared__ and __constant__
variables without a storage class within a function, to implement
CUDA B.2.5: "__shared__ and __constant__ variables have implied static
storage [duration]."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fb609141376e0d53646a71948861ebae18aba06e 25-Aug-2012 John McCall <rjmccall@apple.com> Fix the CC-matching logic for instance methods in the MS ABI.
Patch by Timur Iskhodzhanov!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
0576681bac125be07f77f66b02a3dba2c3a24557 18-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and
nested names as id-expressions, using the annot_primary_expr annotation, where
possible. This removes some redundant lookups, and also allows us to
typo-correct within tentative parsing, and to carry on disambiguating past an
identifier which we can determine will fail lookup as both a type and as a
non-type, allowing us to disambiguate more declarations (and thus offer
improved error recovery for such cases).

This also introduces to the parser the notion of a tentatively-declared name,
which is an identifier which we *might* have seen a declaration for in a
tentative parse (but only if we end up disambiguating the tokens as a
declaration). This is necessary to correctly disambiguate cases where a
variable is used within its own initializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
767a1a2391e60e358ed7d793e091cc1731a5e186 17-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: privide deprecated warning when __private_extern__ storage
specifier is unsed in a declaration; as it may not make the symbol
local to linkage unit as intended. Suggest using "hidden" visibility
attribute instead. // rdar://7703982


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8be9e77f7e532866fa0ef2bc8c3cd549f0cc8da2 17-Aug-2012 Hans Wennborg <hans@hanshq.net> Warn about self-initialization of references.

Initializing a reference with itself, e.g. "int &a = a;" seems like a
very bad idea.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0d5a069f66df09b3308ccfdce84a88170034c657 17-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Add support for "type safety" attributes that allow checking that 'void *'
function arguments and arguments for variadic functions are of a particular
type which is determined by some other argument to the same function call.

Usecases include:
* MPI library implementations, where these attributes enable checking that
buffer type matches the passed MPI_Datatype;
* for HDF5 library there is a similar usecase as MPI;
* checking types of variadic functions' arguments for functions like
fcntl() and ioctl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7f90b531818ad772f6e407f88101dc618c738fa4 17-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C++: issue diagnostic when ivar type is
an abstract c++ class. // rdar://12095239


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4cc83c2b0aed5ab06081ea3250426c3a7e58df93 15-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> Patch to warn about __private_extern__ on tentative definitions
as it does something unexpected (but gcc compatible).
Suggest use of __attribute__((visibility("hidden")))
on declaration instead. // rdar://7703982


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1b4b1461da093bfcb85edfb67710d21f79c7f16c 15-Aug-2012 Richard Trieu <rtrieu@google.com> Check local static variables for self reference on initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c41ace950dcf2254c9aa48e73647b89c35109f80 14-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to redeclarations: fix wrong assumptions

The reason for the recent fallout for "attaching comments to any redeclaration"
change are two false assumptions:
(1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y'
where we want the comment to be attached to both X and Y);
(2) the whole redeclaration chain has only a single comment (obviously false, the
user can put a separate comment for each redeclaration).

To fix (1) I revert the part of the recent change where a 'Decl*' member was
introduced to RawComment. Now ASTContext has a separate DenseMap for mapping
'Decl*' to 'FullComment*'.

To fix (2) I just removed the test with this assumption. We might not parse
every comment in redecl chain if we already parsed at least one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4ef832ffc1147ce2f9777f9fad650cb3139a1d00 10-Aug-2012 David Blaikie <dblaikie@gmail.com> Provide isConst/Volatile on CXXMethodDecl.

This also provides isConst/Volatile/Restrict on FunctionTypes to coalesce
the implementation with other callers (& update those other callers).

Patch contributed by Sam Panzer (panzer@google.com).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8a64f88aa9c97f031727ce145be1a76fd52470a6 08-Aug-2012 Jordan Rose <jordan_rose@apple.com> Implicitly annotate __CFStringMakeConstantString with format_arg(1).

We handled the builtin version of this function in r157968, but the builtin
isn't used when compiling as -fno-constant-cfstrings.

This should complete <rdar://problem/6157200>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2016c8c4a2ebf528c54c42045bc6a30ae590147c 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531. <rdar://problem/12048621>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
06808f1b880f461c396450db4c6a9c6d6c6c2efc 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Get rid of an early return in Sema::ActOnFields which doesn't make sense anymore.
Fixes a crash (<rdar://problem/11067144>), and generally seems to improve
recovery in other cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b38b49140990ae123b5290a54c500013bf614b8b 07-Aug-2012 Douglas Gregor <dgregor@apple.com> Objective-C pointer types don't have C-linkage, even though they are
non-POD. Fixes <rdar://problem/12031870>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e27a08aa814cb2fe9367163edd612c90aad57789 06-Aug-2012 Richard Trieu <rtrieu@google.com> For global record types, the self reference checker was called twice, resulting
in duplicate -Wuninitialized warnings. Change so that only the check in
TryConstructorInitialization() will be used and a single warning be emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
95aac15936e8362aeb4813f95bc255dee6473592 01-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Fix an assertion failure instantiating a constexpr function from within a -dealloc method. PR13401.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
96b098674908eaa59a9128f3305cda6fbbdad563 01-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add support for \tparam command on all levels.

The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b9c6261d02f688d0a9a36b736ad5956fbc737854 30-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e5e8f4d2db48ec21f537fd6452276c1fe26bc726 30-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Use the location of the copy assignment when diagnosing classes that are nontrivial because of it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
a95b4f73c4a2c7ab31f0dc4c8c74d041d1504939 26-Jul-2012 Tanya Lattner <tonic@nondot.org> Disable the warning for missing prototypes for OpenCL kernels. Includes testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
168c07b93510aabd2a19af323d1132fffe498ee4 24-Jul-2012 Hans Wennborg <hans@hanshq.net> Tweak warning text for returning incomplete type from extern "C" functions.

A warning was added in r150128 for returning non-C compatible
user-defined types from functions with C linkage.

This makes the text more clear for the case when the type isn't
decidedly non-C compatible, but incomplete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6dba4a1bc3c257bee0812a130c468917ea210e05 20-Jul-2012 Eric Christopher <echristo@apple.com> Reset the layout of an ObjC class if we see an ivar in a category
or implementation since we've now got a different layout.

Fixes rdar://11842763

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9d9cf5097e5f7907c1d2b042cc5d0e4377a4f156 19-Jul-2012 Aaron Ballman <aaron@aaronballman.com> Removing a spurious comment, no functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f81678707e936cf04a2a9f7c21d51a77ffc1f6c9 19-Jul-2012 Aaron Ballman <aaron@aaronballman.com> Relaxed enumeration constant naming rules for scoped enumerators so they no longer emit a diagnostic when the enumeration's name matches that of the class. Fixes PR13128.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
71adc5b587e4612e23d5ba234967b77a5f74b773 17-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge visibility from previous decls before looking at visibility pragma. This
is a bit fuzzy, but matches gcc behavior and existing code bases seem to
depend on it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
becfc2325c9b645d2208b2a5389b709fd3d75576 17-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Record visibility pragmas when we see a tag declaration. We might use it
to build a type before seeing the definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d320ffc0f58df23eb0e698c79105a68de9c0e37a 15-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Without this patch clang warns on

struct __attribute__((visibility("hidden"))) zed {
};
struct __attribute__((visibility("hidden"))) zed;

Which is a bit silly and got a lot noisier now that we correctly handle
visibility pragmas. This patch fixes that and also has some extra quality
improvements:

* We now produce an error instead of a warning for

struct __attribute__((visibility("hidden"))) zed {
};
struct __attribute__((visibility("default"))) zed;

* The "after definition" warning now points to the new attribute that is
ignored instead of pointing to the declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4b044c6bc71d1fdce8998af09cf08b026fdd2189 15-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Make const the argument of getDefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2b884a873afac6b766dc7fff26a645b77b97dfcd 15-Jul-2012 Eric Christopher <echristo@apple.com> Use llvm::APSInt::isSameValue to compare for the same value.

Finishes rdar://11875995

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
838925dc841f0968ac5daf941aed5d2331775a59 13-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Provide a special-case diagnostic when two class member functions instantiate
to the same signature. Fix a bug in the type printer which would cause this
diagnostic to print wonderful types like 'const const int *'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
abd56c816e9164b17bb3e7154a511b0c9896ffdb 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations during parsing: handle more Objective-C declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5e06529f3bbb4459be21b57dd918880a02f95cb2 12-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Process #pragma visibility early in the parsing of class definitions. Fixes
pr13338.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
8d71918ec9899b07a649ba3a3de2fb6a2e07ec4a 11-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Handle #pragma visibility in explicit specializations and enums.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f2f15b3bc6820469024db170c87ffe885ec53cf9 11-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Don't process #pragma visibility during instantiation. The visibility of the
instantiation depends on the template, its arguments and parameters, but not
where it is instantiated.

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


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

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4ac5751efb9de1065c71b0db587185d552803e2f 29-Jun-2012 Kaelyn Uhrain <rikka@google.com> In Sema::ClassifyName, try to avoid nonsensical corrections to
keywords when doing type correction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
04ca19b97e85381920df7214f2c31b6833b314ce 29-Jun-2012 Richard Trieu <rtrieu@google.com> Add a fix-it hint note to -Wunique-enum to suggest that the last element gets
initialized with the next to last element to silence the warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6b02009359a462ffe633696a4441313b462e6566 25-Jun-2012 Nico Weber <nicolasweber@gmx.de> Make explicit specializations at class scope work
for non-type template parameters in microsoft mode.
PR12709.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c1fb54265614845ee1e09856af6e46961c6209f4 23-Jun-2012 Kaelyn Uhrain <rikka@google.com> Perform typo correction for base class specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
16ae9de07730832945204877d752db7f1c070962 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: making \param docs match the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
efce31f51d6e7e31e125f96c20f6cdab3ead0a47 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Primarily fixed \param commands with names not matching any actual
parameters of the documented functions. In many cases this consists
just of fixing up the parameter name in the \param to match the code,
in some it means deleting obsolete documentation and occasionally it
means documenting the parameter that has replaced the older one that
was documented, which sometimes means some simple reverse-engineering
of the docs from the implementation;
* Fixed \param ParamName [out] to the correct format with [out] before
the parameter name;
* Fixed some \brief summaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
5e94d6fa2e1d5ca606e060406adee13b96849f2a 20-Jun-2012 Tanya Lattner <tonic@nondot.org> Extend the support for cl-std to include 1.2.
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature.
Added test case for 1.2 static storage class feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7e58ad5a6756f31b48a0d54d5f5c367328150a46 18-Jun-2012 Joerg Sonnenberger <joerg@bec.de> Don't warn about address-to-member used as part of initialisation, if
the member expression is in parentheses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c5613b26a24a33d7450e3d0bf315c6ccc920ce7b 16-Jun-2012 Meador Inge <meadori@codesourcery.com> Explicitly build __builtin_va_list.

The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a0cff720d40f239fee0e5ecc8378122b456c1991 16-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [AST/libclang] Fix the selector locations that are reported for a
method definition that has its '{' attached to the method name without
a space.

With a method like:

-(id)meth{
.....
}

the logic in ObjCMethodDecl that determined the selector locations got
confused because it was initialized based on an end location for '{' but
that end location changed to '}' after the method was finished.

Fix this by having an immutable end location for the declarator and
for getLocEnd() get the end location from the body itself.

Fixes rdar://11659739.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
50dc12ad05d4a3a57e83852756498afce4307a77 16-Jun-2012 Kaelyn Uhrain <rikka@google.com> Recover when correcting an unknown type name to a keyword like "struct".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7bf33401acf506b0039222834d7259acb80f6311 16-Jun-2012 Kaelyn Uhrain <rikka@google.com> Move isCXXSimpleTypeSpecifier from Parser to Sema and tweak it for wider use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
54655be65585ed6618fdd7a19fa6c70efc321d3a 12-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> If parsing a trailing-return-type fails, don't pretend we didn't have one at
all. Suppresses follow-on errors mentioned in PR13074.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
0abbdfe561377b7af8eba6fc87757a46342f7a10 09-Jun-2012 Jordan Rose <jordan_rose@apple.com> Warn in ObjC++ when an 'auto' variable deduces type 'id'.

This could happen for cases like this:

- (NSArray *)getAllNames:(NSArray *)images {
NSMutableArray *results = [NSMutableArray array];
for (auto img in images) {
[results addObject:img.name];
}
return results;
}

Here the property access will fail because 'img' has type 'id', rather than,
say, NSImage.

This warning will not fire in templated code, since the 'id' could have
come from a template parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f4fe843aac730e2202b3c9c6c52649ee186ba788 08-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow friend declarations of defaulted special member functions. Only
definitions of such members are prohibited, not mere declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b7fe579968a2fad25d95514f96c6649aae519c81 08-Jun-2012 Kaelyn Uhrain <rikka@google.com> Teach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ef094a1ab79c57269b627cb19748384d9a26fb31 08-Jun-2012 Kaelyn Uhrain <rikka@google.com> Ignore corrections to functions with bodies when deciding which
correction to use for an invalid function redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1ea6744b3da4b052acb7ed67e717cd70df5b5977 05-Jun-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: merge deprecated/unavailable attributes to
the overriding deprecated/unavailable method.
// rdar://11475360


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
abe21e36d789cfe800562a1e889738addfd2ac5b 30-May-2012 David Blaikie <dblaikie@gmail.com> Disable -Wunique-enum for anonymous enums.

This is a large class of false positives where anonymous enums are used to
declare constants (see Clang's Diagnostics.h for example). A small number of
true positives could probably be found in this bucket by still warning if the
anonymous enum is used in a declarator (enum { ... } x;) but so far we don't
believe this to be a source of significant benefit so I haven't bothered to
preserve those cases.

General offline review/acknowledgment by rtrieu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7af7de7d6b121132dfe8c3b9b5febe2b37aafd62 30-May-2012 Richard Trieu <rtrieu@google.com> Add new -Wunique-enum which will warn on enums which all elements have the
same value and were initialized with literals. Clang will warn on code like
this:

enum A {
FIRST = 1,
SECOND = 1
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7f7c42b12ecb1560055a2c087d9ca5187ad357c3 26-May-2012 David Blaikie <dblaikie@gmail.com> Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3f664061e58aabd01996f01b96eb9f5c9e45c3e2 18-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Centralize the handling of the "attribute declaration must precede definition"
warning. This also makes us warn on tags, which, ironically, is the only case
gcc warns on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0a4a23a6afd6db4bdcedd4e9f39d8baf4a446f15 18-May-2012 Douglas Gregor <dgregor@apple.com> A selector match between two Objective-C methods does *not* guarantee
that the methods have the same number of parameters, although we
certainly assumed this in many places. Objective-C can be insane
sometimes. Fixes <rdar://problem/11460990>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dc3eb6abb0f5d4c97a2bc141231cd759b701ab8a 15-May-2012 Fariborz Jahanian <fjahanian@apple.com> Remove word 'block' from option and diagnostic I added
in r156825.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8f674a80529b327a88be665defcc0163089916e4 15-May-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c nonfragile abi: discourage ivar declarations
in @interface by issuing warning (off by default) under
opt'ed in flag -Winterface-block-ivar. // rdar://10763173


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0cd00be2813db976d62fb88fa26ccca8d6791823 15-May-2012 Fariborz Jahanian <fjahanian@apple.com> objc: allow typedef'ing an id to a pointer to a c-struct only.
// rdar://11356439


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
599f1b7100745efacb7ded6c176cb7feade114a5 13-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Refactor all the

if (Inherited)
Attr->setInherited(true);

To a central location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
420efd83934ee78f04d73880e2ed1b7fdef3328c 13-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Produce a warning for mismatched section attributes. Completest pr9356.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bf9da1f8292bb66720ada94a050ede9dca17f60a 11-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a recent regression with the merging of format attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
98ae834a3e289f84f0765d0d0ca7ff22ccaba458 10-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix an old (2009) FIXME:

// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.

This was already being done for variables, but for functions we were merging
then first and then applying the attributes. To avoid duplicating merging
logic, some of the helpers in SemaDeclAttr.cpp become methods that can
handle merging two attributes in one decl or inheriting attributes from one
decl to another.

With this change we are now able to produce errors for variables with
incompatible visibility attributes or warn about unused dllimports in
variables.

This changes the attribute list iteration back to being in reverse source
code order, as that matches what decl merging does and avoids differentiating
the two cases is the merge*Attr methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1de6a6cb485fb58b4fb100282bb3cf298eedacd9 09-May-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c. Fixes a 'fixit' where location of
'*' on objective-c class name was misplaced.
// rdar://11311333


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7e9f8af453598292cb57ba8e4dd63b9a5814b9ac 09-May-2012 Richard Trieu <rtrieu@google.com> Update the SelfReferenceChecker. Refactored some of the visitor methods.
Added support for conditional operators and tightened the exclusion of the
unary operator from all operators to only the address of operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3b294360febd89e3383143af086efe2014571afa 06-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Split mergeAvailabilityAttr out of handleAvailabilityAttr. This is important
for having a uniform logic for adding attributes to a decl. This in turn
is needed to fix the FIXME:

// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.
ProcessDeclAttributes(S, NewFD, D,
/*NonInheritable=*/false, /*Inheritable=*/true);

The idea is that mergeAvailabilityAttr will become a method. Once attributes
are processed before merging, it will be called from handleAvailabilityAttr to
handle multiple attributes in one decl:

void f(int) __attribute__((availability(ios,deprecated=3.0),
availability(ios,introduced=2.0)));

and from SemaDecl.cpp to handle multiple decls:

void f(int) __attribute__((availability(ios,deprecated=3.0)));
void f(int) __attribute__((availability(ios,introduced=2.0)));

As a bonus, use the new structure to diagnose incompatible availability
attributes added to different decls (see included testcases).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
12f3297fbef1673b32c8987da9933687996c65b3 02-May-2012 Kaelyn Uhrain <rikka@google.com> Try harder to recognize hidden tag type names in potential declarations instead
of giving unhelpful errors about undeclared identifers and missing semicolons.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2c0abf4ae33ab2ba690ccae724b8d6f196e7cfda 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Add FixItHint for -Wnull-conversion to initialize with an appropriate literal.

Reviewed by Doug Gregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e7be1090e8cc8bfcda4f73fcad35d29e9e58b1c4 30-Apr-2012 Douglas Gregor <dgregor@apple.com> HandleDeclarator() returns NULL for semantic disasters. Deal with it
when we're in an Objective-C container context. Fixes
<rdar://problem/11286701>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
392b3f5798a62fe038082df0a5e2244b08b917d8 27-Apr-2012 Kaelyn Uhrain <rikka@google.com> Imrpove the note text for when a non-type decl hides a tag type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
aec2ac67e7190bdb88abb1d427b82ae3284ea756 27-Apr-2012 Kaelyn Uhrain <rikka@google.com> Add note to help explain why a tag such as 'struct' is needed to refer
to a given type, when the reason is that there is a non-type decl with
the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
87162c2e528921aabb84e96fe7272348a4b3354e 18-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12569: Instantiate exception specifications of explicit instantiations
and explicit specializations of function templates appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
a1c4f7c833093f87d5187c4449a3d4534cfa40a4 13-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12500: Improve the wording of the diagnostic for a redefinition of a name
in the wrong namespace scope. Patch by Jonathan Sauer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cf2fa2f0c9d67adb98b282ec0eaa88f08df29804 06-Apr-2012 DeLesley Hutchins <delesley@google.com> Fixed scoping error for late parsed attributes in nested classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6d858d96ea294baecdf3e7ad3f3c5395c00dec8e 03-Apr-2012 Kaelyn Uhrain <rikka@google.com> Replace the workaround from r153445 with a proper fix.

Infinite recursion was happening when DiagnoseInvalidRedeclaration
called ActOnFunctionDeclarator to check if a typo correction works when
the correction was just to the nested-name-specifier because the wrong
DeclContext was being passed in. Unlike a number of functions
surrounding typo correction, the DeclContext passed in for a function is
the context of the function name after applying any nested name
specifiers, not the lexical DeclContext where the
function+nested-name-specifier appears.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
0179868cce096101236261ff64eca30224b1f233 26-Mar-2012 Douglas Gregor <dgregor@apple.com> When diagnosing an invalid out-of-line redeclaration, don't permit
typo correction to introduce a nested-name-specifier; we aren't
prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4ca93d9978aac02b01814b4f749d6903a1f87ee5 26-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Delay checking of dependent underlying types for redeclarations of member
enumerations in templates until the template is instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3343fad1f1ec81af43674b76eddbe9ab10e344eb 24-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> When defining a forward-declared enum, don't try to attach the definition to
a previous declaration if the redeclaration is invalid. That way lies madness.
Fixes a crash-on-invalid reported by Abramo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1af83c444e5a2f6f50a6e1c15e6ebc618ae18a5f 23-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
42aceadbc3806868cee8ac576347d258ac99e1f6 18-Mar-2012 Douglas Gregor <dgregor@apple.com> Diagnose tag and class template declarations with qualified
declarator-ids that occur at class scope. Fixes PR8019.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0961a01ebec0e31664bfe464bf4a0ac7b0891a1f 16-Mar-2012 David Chisnall <csdavec@swan.ac.uk> Warn on flexible array members when in C89 mode, with -pedantic.
This fixes PR 4307.

Patch by Eitan Adler!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
878416d37b5cc82444b4f96d1b58f044a181fc16 15-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove a variable rendered unused by r152750.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f1c66b40213784a1c4612f04c14cafa2b0e89988 15-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Instantiating a class template should not instantiate the definition of any
scoped enumeration members. Later uses of an enumeration temploid as a nested
name specifier should cause its instantiation. Plus some groundwork for
explicit specialization of member enumerations of class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b03a9df68140a393cbef73a23115a0818aff6010 13-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11925: A function can't have a variably-modified return type. Not even in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
1659c3758b4b2dbd618aed9ff8d1863f11b1bd9b 10-Mar-2012 Nick Lewycky <nicholas@mxc.ca> Slightly tweak this condition. "isTransparentContext()" was checking whether an
enum is scoped or not, which is not relevant here. Instead, phrase the loop in
the same terms that the standard uses, instead of this awkward set of
conditions that is *nearly* equal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8d17681906209923fad4a02d829a857a447f137b 10-Mar-2012 Nick Lewycky <nicholas@mxc.ca> Could not find this in C99. Perhaps this rule comes from a DR, but in any case
please annotate it with a note explaining why this wrong-seeming behaviour is
correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
216f78b7333dbc89f58fa69066396ae3237da6da 09-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve our semantic error recovery.

When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:

struct A {
~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".

This weird state was impending lookups in the records and hitting assertion in the ASTWriter.

Part of rdar://11007039

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
509fb3e2cdf31a0be375eb74bedfddeb648f7d36 09-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//10988847



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ffea6b4560cee39bd2a26f478e57da19fc3b47b2 08-Mar-2012 Richard Trieu <rtrieu@google.com> Fix -Wuninitialized to catch the case of a class being initialized with a call
to its own member function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
16f1f717af196b1448258857b2e6dcfe144b39d0 29-Feb-2012 James Molloy <james.molloy@arm.com> Reapply r151638 and r151641.

The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation.

These are now fixed, with regression tests added to catch them both (not Darwin-specific).

Original log:
====================

Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

====================




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
32a9a7543f0296b0ae141899005f788bbe4262ca 29-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bf359c9683fd56260d6860c7d1a8abc26a190a2b 28-Feb-2012 James Molloy <james.molloy@arm.com> Un-break clang based on r151638 - What was meant to be a trivial variable name change went horribly wrong and I forgot to retest afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fbcf0405b7da1c8606e4223b4f91835643ecd5b4 28-Feb-2012 James Molloy <james.molloy@arm.com> Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ea7c1e24f33c554aeac07dc4f6dc7493dd98e272 26-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't assert when trying to diagnose why a class with a constructor template is
non-trivial.


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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
af300298ab86752fa64e339ba34195888a830756 20-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> modern objc translator. Finish off first cut of the
modern meta-data translation by commenting out private ivar
declarations in user source. Also, added several tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ee18803f163c4ffcbc8f55a1aae48514d4f80521 20-Feb-2012 Douglas Gregor <dgregor@apple.com> When we resolve the type of an 'auto' variable, clear out the linkage
of that variable; it will need to be recomputed with the resolved
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d41854a18cf7dde667d22c8dc4bff4ce4b2e7170 18-Feb-2012 David Chisnall <csdavec@swan.ac.uk> Remove a debugging line accidentally left in the last commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5f3c163b7b19a0c7e02509a0984ee1256bca890d 18-Feb-2012 David Chisnall <csdavec@swan.ac.uk> Implement #pragma redefine_extname.

This fixes PR5172 and allows clang to compile C++ programs on Solaris using the system headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3336353578a02eb7dc35926c2440577993196e36 16-Feb-2012 Kaelyn Uhrain <rikka@google.com> Avoid infinite mutual recursion in DiagnoseInvalidRedeclaration.

Don't try to typo-correct a method redeclaration to declarations not in
the current record as it could lead to infinite recursion if CorrectTypo
finds more than one correction candidate in a parent record.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b9c64d84ea3edd5e2fffb0a2e85ca1308be4f429 16-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> C++11 allows unions to have static data members. Remove the corresponding
restriction and add some tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a2d7dfab309375fbf016b650fa74f9b5d03a9752 16-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Shift Microsoft enum extensions from -fms-extensions to -fms-compatibility, so -fms-extensions doesn't affect enum semantics in incompatible ways. <rdar://problem/10657186>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
75d8ba38965998a07a057c6d1d72359d2cc62c09 14-Feb-2012 John McCall <rjmccall@apple.com> Warn about non-int main() results in GNU C mode instead of erroring.

Based on a patch by Vasiliy Korchagin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7ca4850a3e3530fa6c93b64b740446e32c97f992 13-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Deal with a horrible C++11 special case. If a non-literal type has a constexpr
constructor, and that constructor is used to initialize an object of static
storage duration such that all members and bases are initialized by constant
expressions, constant initialization is performed. In this case, the object
can still have a non-trivial destructor, and if it does, we must emit a dynamic
initializer which performs no initialization and instead simply registers that
destructor.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d37b360bf9f954af119c9805fdc79ab9d30e06c6 10-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11684, core issue 1417:

o Correct the handling of the restrictions on usage of cv-qualified and
ref-qualified function types.
o Fix a bug where such types were rejected in template type parameter default
arguments, due to such arguments not being treated as a template type arg
context.
o Remove the ExtWarn for usage of such types as template arguments; that was
a standard defect, not a GCC extension.
o Improve the wording and unify the code for diagnosing cv-qualifiers with the
code for diagnosing ref-qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2c0bf2437089f9a297cf18530361a185e76f2150 09-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Adding support for warning when a non-C compatible user-defined type is returned from an extern "C" function.

Fixes bug 6143

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
11e70d7fe2eb11874c3619ad26dc2b525b81074f 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a bug in semantic analysis involving anonymous structs and flexible arrays.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
04ca25276245fbcf0a353e965de476080fa01b99 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a couple of nasty bugs involving negative enum constants. <rdar://problem/10760113>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
a506586ad3cb0f3635b0e77b86e5e9e5fb2ccc17 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Disallow constexpr main.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
acbabf177079ed41c055b1484465082f9f1d3d06 03-Feb-2012 Hans Wennborg <hans@hanshq.net> Don't warn about anonymous struct/union in C11.

Also, in C, call this a C11 extension rather than a GNU extension.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c645ddf240efb112ff8f17371811deb3ebc1a5b5 02-Feb-2012 Fariborz Jahanian <fjahanian@apple.com> objc: don't crash if primary class is missing and continuation class
is declaring ivars. // rdar://10752081



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ee625afea71ef5a9c1e386564919b86915d96b0d 01-Feb-2012 Nico Weber <nicolasweber@gmx.de> Fix crash on invalid in microsoft anonymous struct extension.

Fixes PR11847. Patch from Jason Haslam!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
fad03b75e0297546c5d12ec420b5b79d5b7baa2a 27-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Avoid redundant NNS qualification in constructor/destructor names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1acbe5e65631c7b52fa559df2bdcfdf76d4c410a 24-Jan-2012 Jean-Daniel Dupas <devlists@shadowlab.org> Replace a hack to handle NSLog/NSLogv in sema by declaring them as Library Builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a5ee6345b5af1c88262d02d248e76ad2423161a0 24-Jan-2012 Kaelyn Uhrain <rikka@google.com> Small code cleanup/simplification in Sema::ClassifyName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6b6fb4fe64684df35975fbe299d5085d70c5c178 22-Jan-2012 Francois Pichet <pichet2000@gmail.com> In Microsoft Mode, disable the C++11 strict integral conversion rules for enumerator that were introduced with r148439. Otherwise MSVC headers won't compile in C++ 11 mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7b9ff0c09025dcbe48ec7db71330e2066d1e1863 20-Jan-2012 DeLesley Hutchins <delesley@google.com> Instantiate dependent attributes when instantiating templates.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
43e875d2610afcf9e7017b71f46116dc86624fd9 18-Jan-2012 Kaelyn Uhrain <rikka@google.com> Convert SemaDecl.cpp to pass callback objects to CorrectTypo.

Includes tests highlighting the cases where accuracy has improved
(there is one call that does no filtering beyond selecting the set
of allowed keywords, and one call that only triggers for ObjC code
for which a test by someone who knows ObjC would be welcome). Also
fixes a small typo in one of the suggestion messages, and drops a
malformed "expected-note" for a suggestion that did not occur even
when the malformed note was committed as r145930.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6b81b0d82a78740b3fb69bacf5d729b6f9374dac 17-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc: fixes a bug where struct used inside an
objc class was not being exported to parent decl
context resulting in bogus mismatch warning later on.
// rdar://10655530


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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f037541d5c7dcf3553cf26e4b047be869980c23a 13-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash while trying to diagnose a function declared at block scope with an
incomplete return type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7984de35644701c0d94336da7f2215d4c26d9f5b 13-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:

- If the declarator is at the start of a line, and the previous line contained
another declarator and ended with a comma, then that comma was probably a
typo for a semicolon:

int n = 0, m = 1, l = 2, // k = 5;
myImportantFunctionCall(); // oops!

- If removing the parentheses would correctly initialize the object, then
produce a note suggesting that fix.

- Otherwise, if there is a simple initializer we can suggest which performs
value-initialization, then provide a note suggesting a correction to that
initializer.

Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3306f961fa940754dfa0e4e34c57e0c57bea3890 12-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: fixes a regression in looking up names
in class extensions and categories by recent refactoring
of objc class ASTs. // rdar://1066654


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ec3bd728cc6505c98543b001a1988c237f5fb9a9 11-Jan-2012 Douglas Gregor <dgregor@apple.com> Improve the diagnostic when trying to redefine a typedef with a
variably-modified type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c0004df84fca9225b66a50adc66cf21c34298227 11-Jan-2012 Douglas Gregor <dgregor@apple.com> C11 allows typedefs to be redefined. Implement this in C11 mode, and
downgrade the default-error warning to an ExtWarn in
C90/99. <rdar://problem/10668057>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d18840d1e27c1b9c27bb74923b87f8ae33ec4736 10-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Don't crash with -Wlarge-by-value-copy and a dependent type. PR11726.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c02d62f0b82c144f7db2a71c3b4565de8c6163e5 09-Jan-2012 Douglas Gregor <dgregor@apple.com> Always allow redefinition of typedefs when modules are enabled. This
is important because it's fairly common for headers (especially system
headers) to want to provide only those typedefs needed for that
particular header, based on some guard macro, e.g.,

#ifndef _SIZE_T
#define _SIZE_T
typedef long size_t;
#endif

which is repeated in a number of headers. The guard macro protects
against duplicate definitions. However, this means that only the first
occurrence of this pattern actually defines size_t, so the submodule
corresponding to this header has the only visible definition. If a
user then imports a different submodule from the same module, size_t
will be known but not visible, and therefore cannot be used.

By allowing redefinition of typedefs, each header that wants to define
size_t can do so independently, so it will be available in the
corresponding submodules.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
753a20001f136707d6cb40ef94ee87b39986a9f9 09-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Made unknown builtin diagnostic remappable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
06284c1dc56caed19850bc3766c89f51763724c3 07-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed TypeofExpr AST and code generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a5d35539a16f3b2eb2426f3f23a8376b190741c 06-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Improvements to the uninitialized variable warning: Check if the constructor
call is elidable or if the constructor is trivial instead of checking if it
is user declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2f0e88a87cea6d21429d9f5c0b1c53f24caf77cf 06-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> David Blaikie and Chandler would like us to diagnose

int f();

in function scopes under -Wvexing-parse, so now we do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1d7bcf4b35f8bc0a0a40f4ea7b06b55c63725108 06-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Tweak to r147599 for PR10828: Move the check from the parser into sema, and use
the Semantic Powers to only warn on class types (or dependent types), where the
constructor or destructor could do something interesting.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7a537404f039d4b7d063bbdc3c8c924be977dff2 04-Jan-2012 Douglas Gregor <dgregor@apple.com> Test "merging" of typedef types across distinct modules. At present,
the AST reader doesn't actually perform a merge, because name lookup
knows how to merge identical typedefs together.

As part of this, teach C/Objective-C name lookup to return multiple
results in all cases, rather than first digging through the attributes
to see if the value is overloadable. This way, we'll catch ambiguous
lookups in C/Objective-C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5948ae1021122164b22f74353bb7fe325a64f616 03-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce a non-uglified syntax for module imports in Objective-C:

@import identifier [. identifier]* ;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
27c6da284f90e32cda0ec8f52a2b6ba5a2613252 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Wire up redeclaration chains for Objective-C protocols, so that both
forward declarations and definitions of an Objective-C protocol are
represented within a single chain of ObjCProtocolDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
27b7ce6199bfd008ba8d10c8bd91d926e2274df3 01-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Use hasSameType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5df37bd0242e838e465f0bd51a70af424d152053 26-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Delay checking of typedefs of dependent types. Fixes PR11630.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dd4b350143c26c030a482f091908a2e077503411 25-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix constexpr handling to allow 'extern constexpr' variable declarations. We no
longer have access to the source locations we need to produce the
'replace constexpr with const' fixits, so they're gone for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8d2a701734f6e0aa778f6be4e6b6d561d8ba6fdb 25-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Remove unused variables.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2ccd89cff3f1c18b48f649240302446a7dae28b9 20-Dec-2011 Douglas Gregor <dgregor@apple.com> When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.

As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.

Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
099e7f647ccda915513f2b2ec53352dc756082d3 19-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

extern const int a;
const int n = a;
const int a = 5;
int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fc038e9ef8ed262724f42597ca5c844de97b1202 17-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Remove a non-gcc-compatible extension that would apply attributes on declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
05c272fed899b8d3142cf080e86a235fc6168862 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Move ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it only
applies to an actual definition. Plus, clarify the purpose of this
field and give the accessor a different name, since getLocEnd() is
supposed to be the same as getSourceRange().getEnd().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
018887209f51de943c17718a6f3bce904d612813 15-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactor and simplify AddInitializerToDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
76178ed0911797175b13ac733c390233f02bb841 14-Dec-2011 David Blaikie <dblaikie@gmail.com> Move & comment the 'decltype in declarator-id' as suggested by Doug Gregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
df512bfbc4b8c00202ea7a8c900c59ec55890676 13-Dec-2011 David Blaikie <dblaikie@gmail.com> Disallow decltype in qualified declarator-ids.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ba96ffcb2a444d12ffcc4781bd443279c7250d7e 13-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> objc-arc: better diagnostic when block is declared
inside a struct/union.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e3ca33aba226c7b5d50703df008ef0ef5f9ea7da 08-Dec-2011 Hans Wennborg <hans@hanshq.net> Only do typo correction for implicit function decls when
they are treated as errors.

Doing typo correction when these are just warnings slows down the
compilation of source which deliberately uses implicit function
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
aa9c3503867bc52e1f61c4da676116db1b1cdf01 07-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
122de3e131a6902d22c97471520ec9005cca6f03 06-Dec-2011 Hans Wennborg <hans@hanshq.net> Suggest typo corrections for implicit function declarations.

A mistyped function call becomes an inmplicit function declaration in C.
Suggest typo correction when one can be found.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
19efa3ee5a7f2232884f9cca6871329ffe85653c 06-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Make sure we perform lvalue-to-rvalue conversions for enum initializers. PR11484.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
93ebfa6139bbca4d446c7343e3afc8e5ec777484 03-Dec-2011 Douglas Gregor <dgregor@apple.com> When we treat an #include or #import as a module import, create an
implicit ImportDecl in the translation unit to record the presence of
the import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
15de72cf580840c61e5704c2f8a2b56f9d0638e1 03-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce a module import declaration, so that we properly represent, e.g.,

__import_module__ std.vector;

in the AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5e35693721364673f8196e4f5a370f56b92e6053 01-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce the notion of name visibility into modules. For a given
(sub)module, all of the names may be hidden, just the macro names may
be exposed (for example, after the preprocessor has seen the import of
the module but the parser has not), or all of the names may be
exposed. Importing a module makes its names, and the names in any of
its non-explicit submodules, visible to name lookup (transitively).

This commit only introduces the notion of name visible and marks
modules and submodules as visible when they are imported. The actual
name-hiding logic in the AST reader will follow (along with test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a4761edca58c6b559de825b9abfb66f7f1ba94a 01-Dec-2011 Douglas Gregor <dgregor@apple.com> Promote ModuleMap::Module to a namespace-scope class in the Basic
library, since modules cut across all of the libraries. Rename
serialization::Module to serialization::ModuleFile to side-step the
annoying naming conflict. Prune a bunch of ModuleMap.h includes that
are no longer needed (most files only needed the Module type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3d3589db579f7695667b913c5043dd264ebe546f 30-Nov-2011 Douglas Gregor <dgregor@apple.com> Switch the module-loading interfaces and parser from a simple
top-level module name to a module path (e.g., std.vector). We're still
missing a number of pieces for this actually to do something.



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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c14a03dffff69b5e1c55cc118fc52d8fd9f3a28d 23-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix operations (token annotation, getting cursor, etc.) with a file region
inside an objc container that "contains" other file-level declarations.

When getting the array of file-level declarations that overlap with a file region,
we failed to report that the region overlaps with an objc container, if
the container had other file-level declarations declared lexically inside it.

Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST
and handling them appropriately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e2d4f4ed44a32f179c6d48cd1dba8346ab2129d9 13-Nov-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix the signature of the getcontext builtin. Patch by Dimitry Andric.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
45fa560c72441069d9e4eb1e66efd87349caa552 07-Nov-2011 Douglas Gregor <dgregor@apple.com> When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3b25216a47681e7957c0e9ec37a3cf445ab24743 04-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> objc: fixed enum type is supported in objc mode.
Fixes a bug where enumerator type is not this
fixed type. // rdar://10381507


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eee242ff426bf79149f221798966e58688383c1e 27-Oct-2011 Douglas Gregor <dgregor@apple.com> Make the loading of information attached to an IdentifierInfo from an
AST file more lazy, so that we don't eagerly load that information for
all known identifiers each time a new AST file is loaded. The eager
reloading made some sense in the context of precompiled headers, since
very few identifiers were defined before PCH load time. With modules,
however, a huge amount of code can get parsed before we see an
@import, so laziness becomes important here.

The approach taken to make this information lazy is fairly simple:
when we load a new AST file, we mark all of the existing identifiers
as being out-of-date. Whenever we want to access information that may
come from an AST (e.g., whether the identifier has a macro definition,
or what top-level declarations have that name), we check the
out-of-date bit and, if it's set, ask the AST reader to update the
IdentifierInfo from the AST files. The update is a merge, and we now
take care to merge declarations before/after imports with declarations
from multiple imports.

The results of this optimization are fairly dramatic. On a small
application that brings in 14 non-trivial modules, this takes modules
from being > 3x slower than a "perfect" PCH file down to 30% slower
for a full rebuild. A partial rebuild (where the PCH file or modules
can be re-used) is down to 7% slower. Making the PCH file just a
little imperfect (e.g., adding two smallish modules used by a bunch of
.m files that aren't in the PCH file) tips the scales in favor of the
modules approach, with 24% faster partial rebuilds.

This is just a first step; the lazy scheme could possibly be improved
by adding versioning, so we don't search into modules we already
searched. Moreover, we'll need similar lazy schemes for all of the
other lookup data structures, such as DeclContexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4a7dc8a54b8c35c523e44f7711c9923f5463f43b 27-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make use of the parameter in Sema::ActOnObjCTemporaryExitContainerContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
458bacff986ed8d30e7ae191c823d4db6cfaf16b 27-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix crash on an @interface nested inside @implementation, rdar://10336158

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3bfb571bd4af9303781c40306a06bf70fe51fa75 26-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Compute the promoted integer type of fixed-width enums correctly. Found by inspection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0661bd0ccae381613c5967cdf2514255e1f92636 23-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Attach class template attributes to the templated CXXRecordDecl,
instead of silently discarding them.

As a side effect, this improves diagnostics for constexpr class
templates slightly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3ff86f79090a1f9317b2d9ac1a95a696701feb71 21-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Diagnose redeclaration of private
ivars in class extensions. // rdar://10309454


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
95e5510ee07c465abdcc458fabfd93cf09d90125 21-Oct-2011 Douglas Gregor <dgregor@apple.com> When performing name lookup for the previous declaration of a field,
be sure to consider all of the possible lookup results. We were
assert()'ing (but behaving correctly) for unresolved values. Fixes
PR11134 / <rdar://problem/10290422>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7a8a2e3c7ff283bc98b5292b6a579d4fca63e36b 21-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Permit auto SCS on parameter declarations, C++03 [dcl.stc]p2

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0e9e9814a7f8313c0c02b6afea71f0e4c411873e 20-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add -Wc++98-compat diagnostics for jumps which bypass initialization of non-POD
but trivially constructible and destructible variables in C++11 mode. Also
incidentally improve the precision of the wording for jump diagnostics in C++98
mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ef47d27b9c76ed2f20e6c342e66b5450ef7e96ee 20-Oct-2011 Douglas Gregor <dgregor@apple.com> When fixing up the storage class for an anonymous union, don't mark
the anonymous union as valid: our fixes have Fix-Its.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
82c8ca1eeba6ccdf34916803150df369df3b7ae5 20-Oct-2011 David Blaikie <dblaikie@gmail.com> FixIt insert 'static' for anonymous unions at global or namespace scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f6f876cb08449febc43a6baf7720b256846d01dc 20-Oct-2011 David Blaikie <dblaikie@gmail.com> Add a fixit to remove storage specifiers on anonymous enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d662a79f32b1c17dbb5aafcf5f939ca57360d7aa 20-Oct-2011 David Blaikie <dblaikie@gmail.com> 80 cols (one I created in my last commit, plus a bunch of others that were already there)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2b79c320b0801e0094df6c70ad8062da6c58bd1c 20-Oct-2011 David Blaikie <dblaikie@gmail.com> Don't provide errors for anonymous unions when they're actually anonymous classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e7d7c39be90bf654a8da0f53f6682d965426d081 19-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> -Wc++98-compat: warn on nontrivial types used in unions and anonymous structs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
43f5103f8051bbac19022e6edaf7d9138b0f3c0f 19-Oct-2011 Douglas Gregor <dgregor@apple.com> Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cb1c9c36b856ad24bd32ec673fb2490d9770ab5f 14-Oct-2011 Douglas Gregor <dgregor@apple.com> Under ARC, merge the bit corresponding to the ns_returns_retained
attribute from the first declaration to later declarations. Fixes
<rdar://problem/10142572>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2060650f2743650a815ce3daa414352911d408fd 14-Oct-2011 Douglas Gregor <dgregor@apple.com> When declaring an out-of-line template, attempt to rebuild any types
within the template parameter list that may have changed now that we
know the current instantiation. Fixes <rdar://problem/10194295>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6700415542121e2cb7d867728046ffa21e402019 12-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f11dbe9676832e599e046b2ed0f132a6bb858e0a 11-Oct-2011 Francois Pichet <pichet2000@gmail.com> [Microsoft] If -fms-compatibility, then downgrade missing typename error to warning at function prototype scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fac9467d1676dc05761e12e41e13e01a3a3da52b 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Add typo correction for type names.

The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f09ce394517f950e820623991bbb63d498329cfe 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Clean up DiagnoseInvalidRedeclaration a bit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d7e19ce8fbb9c6dfa2e634f36fd8f150c3268de2 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Move a couple chunks of ActOnFunctionDeclarator to separate functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2afd76618ee35193172c764d25f1f0996765b5e7 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Only accept a typo correction if it doesn't trigger additional errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1055393814ac989727aa7437a5f3c3c44b4f83e5 10-Oct-2011 Kaelyn Uhrain <rikka@google.com> Give nicer note when a member redeclaration has or lacks 'const'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6d0468b2d3aa37c699b697922cd991ae83b64a87 10-Oct-2011 Douglas Gregor <dgregor@apple.com> Push "out-of-line" declarations into scope when their lexical/semantic
redeclaration contexts are the same, as occurs within linkage
specifications. Fixes PR9162.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
33ab0da4b50c0868f0dbbbbb8d018b44acd2bd4d 09-Oct-2011 Douglas Gregor <dgregor@apple.com> A friend template specialization is also dependent if any of its
template arguments are dependent. Fixes PR10913.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
5e1cdac63c3d9c9b32fa41fa0b2d242a58a20d49 07-Oct-2011 John McCall <rjmccall@apple.com> Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().



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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b52c0dddffdb27b3a058913020001afcfc937d8d 06-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11067: A definition of a constexpr static variable doesn't need an initializer if the in-class declaration had one. Such a declaration must be initialized by a constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b8b0e75aeec85a7a268fdba311de4f1cd527fae1 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add a non-standard extension, cl_clang_storage_class_specifiers,
which enables support for C99 storage-class specifiers.

This extension is intended to be used by implementations to implement
OpenCL C built-in functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
175fb1070be0ee24a75064b118f0e13fbe354200 04-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> objc arc: Suppress certain arc diagnostics on unavailable
functions. // rdar://10186536


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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
717a20b9cebb0d261b74995f8ebf3a1c814bbc08 01-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Mark a TagDecl when it is free standing (e.g. "struct foo;")

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8dfac0baaf0f81d3945bcb306480e358ba8d1f08 30-Sep-2011 John McCall <rjmccall@apple.com> Add explicit attributes to mark functions as having had their
CoreFoundation object-transfer properties audited, and add a #pragma
to cause them to be automatically applied to functions in a particular
span of code. This has to be implemented largely in the preprocessor
because of the requirement that the region be entirely contained in
a single file; that's hard to impose from the parser without registering
for a ton of callbacks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2d23ec29805f54edb3243022c64d752b8fbe5f46 30-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Suggest adding 'constexpr' if the GNU extension for in-class initializers for static const float members is used in C++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
947be1941e9a1d4233116f51a45799d3904d4231 30-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Mark the ExtWarn for in-class initialization of static const float members as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2da7a51270a5f40e88d07750ebdadd774368b9f4 29-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> In C++0x, static const volatile data members cannot be initialized in-class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2246368b1061ef48e00bfc95d519d4393dff9926 27-Sep-2011 Bill Wendling <isanbard@gmail.com> Revert r140589. It was causing failures during llvm compilation:

llvm[1]: Compiling CommandLine.cpp for Debug+Asserts build
if /Users/void/llvm/llvm-opt.obj/Release+Asserts/bin/clang++ -I/Users/void/llvm/llvm.obj/include -I/Users/void/llvm/llvm.obj/lib/Support -I/Users/void/llvm/llvm.src/include -I/Users/void/llvm/llvm.src/lib/Support -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -m64 -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d" /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp -o /Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o ; \
then /bin/mv -f "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d"; else /bin/rm "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp"; exit 1; fi
In file included from /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp:25:
/Users/void/llvm/llvm.src/include/llvm/Support/system_error.h:690:14: error: unknown type name 'make_error_condition'; did you mean 'error_condition'?
{*this = make_error_condition(_e);}
^~~~~~~~~~~~~~~~~~~~
error_condition
...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
93476ddd9ce490f9c08d78b640efad812cb019d1 27-Sep-2011 Kaelyn Uhrain <rikka@google.com> Add typo correction for the type name in C++ "new" statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
c193dd84414c32b7c66f5b68176401665c0d2301 23-Sep-2011 Douglas Gregor <dgregor@apple.com> Don't propagate the 'availability' attribute through declaration
merging for overrides. One might want to make a method's availability
in a superclass different from that of its subclass. Fixes
<rdar://problem/10166223>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
036277e3e7bfa3ccef96fabf0b34a75d9a7c015b 21-Sep-2011 Francois Pichet <pichet2000@gmail.com> [microsoft] Move missing typename warning from -fms-extensions to -fms-compatibility. Also allow the missing typename warning at function scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8be0c74e4a779b13c2d8fd8482dcd438eeb089d3 20-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Remove redundant break statements, and replace asserts with llvm_unreachable

Per John's review comments for r140068.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8c25fc584ce27d59df9923f153e8a132dde58d04 19-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: introduce support for function scope __local variables

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
16ee8191ca6953e173c983e3175a8d7504b5baae 18-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR10531. Attach an initializer to anonymous unions, since the default constructor might not be trivial (if there is an in-class initializer for some member) and might be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
7c24334bedf59bd9af57ee53eb8f6d9f6a50ca9b 14-Sep-2011 Kaelyn Uhrain <rikka@google.com> Plug an abstraction leak and fix a crasher in DiagnoseInvalidRedeclaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e289d81369914678db386f6aa86faf8f178e245d 13-Sep-2011 Douglas Gregor <dgregor@apple.com> Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
48822fbd088c4821f15fee5a2957a69a1f98e746 12-Sep-2011 Douglas Gregor <dgregor@apple.com> Kill off an irrelevant FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e389585f8a40f80004d3b98b99f3980305ef78a0 12-Sep-2011 Douglas Gregor <dgregor@apple.com> Diagnose attempt to mark function-local declarations as __module_private__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
591dc84101228dc391fca05193be5870ec661edc 12-Sep-2011 Douglas Gregor <dgregor@apple.com> Allow __module_private__ on fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
77f68bb90af93b95045fb994e7cd68137adcc132 10-Sep-2011 Julien Lerouge <jlerouge@apple.com> Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d023aec8907831a18d3514a95b843a7ee06b6b5e 09-Sep-2011 Douglas Gregor <dgregor@apple.com> Specializations cannot be module-hidden. Diagnose attempts to do so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6311d2bb3db1ec1064f45a14983ae5806adc676a 09-Sep-2011 Douglas Gregor <dgregor@apple.com> Propagate __module_private__ from previous declarations to later
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
ed9d84a2112e2bd56befb5f4fa8fc5bdf71fafa3 08-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: added support for function scopes in attribute arguments.

This patch was written by DeLesley Hutchins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eff98fc3561f6b717f6348f04b3f4fe03e934466 08-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread Safety: Patch to implement delayed parsing of attributes within a
class scope.

This patch was also written by DeLesley Hutchins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
14068e83f30864ed278fa43c5954404b47e99e7d 08-Sep-2011 David Blaikie <dblaikie@gmail.com> Adding FixIts to static/inline main declaration diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
47eb89871e020babbaddeed4ee4447bc34824b9f 07-Sep-2011 Richard Trieu <rtrieu@google.com> Change the self-reference visitor (which gives the warning for self-reference oninitalization warning of -Wuninitialized) to exclude member variables that can decay into pointers. This will cause it to no longer warn on this code:

struct foo { char a[100], *e; } bar = { .e = bar.a };


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f7603f6ca76aec055cbf1644c89ce0dca9fa2c03 06-Sep-2011 Douglas Gregor <dgregor@apple.com> Implement the Named Return Value Optimization (NRVO) for Objective-C++
methods. Fixes PR10835 / <rdar://problem/10050178>.


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


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

struct S {};
S s(s);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8697d308c1bdd50e5c45757ac11be701c26e9e97 01-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: this patch (re)introduces objective-c's default property
synthesis. This new feature is currently placed under
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon.
// rdar://8843851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
10af87932fe4bffad539b24d512a33a1803daeae 29-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Minor clean up of objc's decl context stuff.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
80cb6e69d9e85231588ae604e4bc2bc9a07389af 29-Aug-2011 Nico Weber <nicolasweber@gmx.de> Warn on missing [super finalize] calls.

This matches gcc's logic. Second half of PR10661.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6aa52ec6b969faabf3764baf79d89810b8249a7e 27-Aug-2011 Douglas Gregor <dgregor@apple.com> Introduce support for a simple module import declaration, which
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
- Module imports are handled first by the preprocessor (to get macro
definitions) and then the same tokens are also handled by the parser
(to get declarations). If both happen (as in normal compilation),
the second one is redundant, because we currently have no way to
hide macros or declarations when loading a module. Chris gets credit
for this mad-but-workable scheme.
- The Preprocessor now holds on to a reference to a module loader,
which is responsible for loading named modules. CompilerInstance is
the only important module loader: it now knows how to create and
wire up an AST reader on demand to actually perform the module load.
- We search for modules in the include path, using the module name
with the suffix ".pcm" (precompiled module) for the file name. This
is a temporary hack; we hope to improve the situation in the
future.



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

Fixes PR10648 and another similar accepts-invalid bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
903d6dc86bf3b6346d23607c850d3bc83a36b826 23-Aug-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix an incorrect note.

For the test case added to function-redecl.cpp, we were previously complaining
about a mismatch in the parameter types, since the definition used the
typedef'd type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9a1ecf0522ccb7a45577f856150c15af0ee1df2a 22-Aug-2011 Nico Weber <nicolasweber@gmx.de> Warn on missing [super dealloc] calls.

This matches gcc's logic. Half of PR10661.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a28948f34817476d02412fa204cae038e228c827 22-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Restore patch I reversed in r138040. Known buildbot
failures are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6f07f538fd0eddd6c087fcc01d4e4ff19129c71 19-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Revers r138040. Need to look at a few buildbot failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3dbf2f5f00cfc8b25318c119c0d39f4a49d15ebe 19-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Bring objective-c handling of decl context
to modernity. Instead of passing down individual
context objects from parser to sema, establish decl
context in parser and have sema access current context
as needed. I still need to take of Doug's comment for
minor cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3d095febaa397fd4a5588210d5ecec1046085420 19-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Fix the rest of the indent goofiness here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
47eb2b6bafefb20f53d8186a90dceaaedcb6a18b 19-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Fix an egregious formatting goof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d2c8972726b14313508684245aa994cccbcef248 18-Aug-2011 Kaelyn Uhrain <rikka@google.com> Don't accept a typo correction if the corrected identifier is the same as the
uncorrected identifier. Fixes a problem pointed out by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
516116308007280f0dd6661cdd94112468c3c5fc 18-Aug-2011 Kaelyn Uhrain <rikka@google.com> Rework DiagnoseInvalidRedeclaration to add the ability to correct typos when
diagnosing invalid function redeclarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
37bee67ea7e8cec219cb7c0f9256a9aa96c0c476 12-Aug-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f80b0db7b131ce5bc9451b21d0555bd686e348f1 12-Aug-2011 Douglas Gregor <dgregor@apple.com> Overriding the predefined Protocol isn't something that's actually
done and is likely to not work well anyway; take away this unnecessary
complexity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
01a4cf11777bb34c35f5d251a9e95eb736d0842b 11-Aug-2011 Douglas Gregor <dgregor@apple.com> Encapsulate the Objective-C id/Class/SEL "redefinition" types in
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4d9d157afb35742bc6348defbe45bc6de780ec77 04-Aug-2011 Kaelyn Uhrain <rikka@google.com> Match type names and give more info for out-of-line function definition errors.

Having a function declaration and definition with different types for a
parameter where the types have same (textual) name can occur when an unqualified
type name resolves to types in different namespaces in each location.

The error messages have been extended by adding notes that point to the first
parameter of the function definition that doesn't match the declaration, instead
of a generic "member declaration nearly matches". The generic message is still
used in cases where the mismatch is not in the paramenter list, such as
mismatched cv qualifiers on the member function itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0bbea1b87ef3849f5a8591c480f114fb4393d493 03-Aug-2011 Douglas Gregor <dgregor@apple.com> Make the type of the IntegerLiteral for bitfield paddings an actual
integer, and initialise its TypeSourceInfo. The initialisation fixes a
crash when using pre-compiled preambles with C++ code-completion. From
Erik Verbruggen! Fixes PR10511.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d5612a235fdd5df145c485c6ac489fcfbf7120d3 28-Jul-2011 Anna Zaks <ganna@apple.com> Add a fixit for removal of unused label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ec12ce2f6da44bfc9048772327a3924498099d60 28-Jul-2011 Douglas Gregor <dgregor@apple.com> Make Sema::LocallyScopedExternalDecls lazily deserialized. In theory,
we could turn this into an on-disk hash table so we don't load the
whole thing the first time we need it. However, it tends to be very,
very small (i.e., empty) for most precompiled headers, so it isn't all
that interesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8eaefdc6aed76e26619caffed030a57438280897 26-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Provide fixit for static use of objective-c type
in few more places and in each instance, fix up
the type to the expected type. // rdar://9603056


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dcf1011876d8a472aeb05617c1a84c3d74fbd7ce 25-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Provide a 'fixit' when class was used
to declare a static object. // rdar://9603056


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135970 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6c2c250db1e2d0138bbfaadbbec3118db7e8a8c9 22-Jul-2011 John McCall <rjmccall@apple.com> In Objective-C, pull arbitrary attributes from overridden
methods, including indirectly overridden methods like those
declared in protocols and categories. There are mismatches
that we would like to diagnose but aren't yet, but this
is fine for now.

I looked at approaches that avoided doing this lookup
unless we needed it, but the infer-related-result-type
checks were doing it anyway, so I left it with the same
fast-path check for no previous declartions of that
selector.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3a348c86ffaebd3ba8bd9bbae342b6e9f5f62cd7 14-Jul-2011 Douglas Gregor <dgregor@apple.com> Add a hackaround to avoid the crash in PR10355. However, our recovery
is still terrible here because typo correction is not behaving well in
the presence of overloaded functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
90ebed0734fac9b464c9bdff53fbf85a86b27f32 13-Jul-2011 Douglas Gregor <dgregor@apple.com> Add 'mutable' to the function declarator chunk, to be used when
parsing lambda expressions, from John Freeman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1255aaf10285ca60f236b4fe7c326b629b5cf788 13-Jul-2011 Douglas Gregor <dgregor@apple.com> Fix an incorrect namespace typo-correction diagnostic, from Kaelyn
Uhrain! Fixes PR10318.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
79e6bd379773447a74cc3e579d9081e4c5cb6d63 12-Jul-2011 Douglas Gregor <dgregor@apple.com> Centralize the getCanonicalType() calls in the Itanium C++ mangling
code so that they only occur in a single place. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
15be9b0e50f9eed41d4b16e344c9050ed5197c3a 11-Jul-2011 Douglas Gregor <dgregor@apple.com> Don't complain about missing return statements for naked
functions. Fixes <rdar://problem/9731999>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3242ee01d43c6b6f5db968cd2c82e5d18d71283c 04-Jul-2011 Anders Carlsson <andersca@mac.com> Remove unused parameter from ActOnDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
25af091c5548f85e38dee5c8bfc1748efc06f88c 02-Jul-2011 Nick Lewycky <nicholas@mxc.ca> Fix a typo, remove a tab, canonicalize some spacing. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
304e233921bcd3b55f68c6e8a2960630edf17ff0 01-Jul-2011 Richard Trieu <rtrieu@google.com> Fix for PR7410. Allow functions in a derived class that improperly overwrite a virtual function in the base class to be inserted into the derived class function list to prevent extra errors every time the derived class is used.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c89edf5aaa08683f4afcf61a7a1d183c08b76498 01-Jul-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix AST representations of alias-declarations which define tag types. Inside classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e12a11f26b3ae5fca1178d415800b852d8d780ac 29-Jun-2011 Douglas Gregor <dgregor@apple.com> When redeclaring a local extern in the same scope, make sure that we
replace the existing declaration appropriately. Patch by Jordy Rose,
fixes PR10013 / <rdar://problem/9584157>.


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

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3215398dc9dac2be19a9fc1df929e6b7d83eafca 28-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Centralize the check for a tag definition in a Declarator::PrototypeContext inside GetTypeForDeclarator.
No functionality change.

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

rdar://9477613.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c3ca14d13741889a9b924d0ca32e818f07a9834a 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Remove multiple use of weak_import attribute on
same declaration. Templatize dropAttr for general use.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8785d115ebaf1a850f5e581e4acd2dbfb2b843cb 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Remove weak_import attribute on new declaration.
// rdar://9538608


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d543130a3009a350017e2e411ea43bb3e5459b96 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Issue warning if weak_import attribute is added to an already
declared variable and ignore it. // rdar://9538608


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ab27d6ea7b4ce2762a16905281de796db32bb6f2 20-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> llvm-gcc treats a tentative definition with a previous
(or follow up) extern declaration with weak_import as
an actual definition. make clang follows this behavior.
// rdar://9538608
llvm-gcc treats an extern declaration with weak_import


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0f9dc86a14068e04e0d2cc6b4ff15eca571236ce 17-Jun-2011 Douglas Gregor <dgregor@apple.com> When an explicit specialization has a storage specifier, error if that
storage specifier is different from the storage specifier on the
template. If that storage specifier is the same, then we only warn.

Thanks to John for the prodding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
51d7cdd4bfd11e0eeac55517419d0ebba0abb4cb 17-Jun-2011 Douglas Gregor <dgregor@apple.com> Downgrade the error complaining about presence of a storage class
specifier on an explicit specialization to a warning, since neither
EDG nor GCC diagnose this code as ill-formed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b30cd4a09bbf0adfa644b957a2b28fe31c5d45e4 15-Jun-2011 Douglas Gregor <dgregor@apple.com> Don't add redundant FormatAttr, ConstAttr, or NoThrowAttr attributes,
either imlicitly (for builtins) or explicitly (due to multiple
specification of the same attributes). Fixes <rdar://problem/9612060>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
24c38e1ff057ce49c866294bf486444255e18f31 14-Jun-2011 Chris Lattner <sabre@nondot.org> fix rdar://9204520 - Accept int(0.85 * 10) as an initializer in a class member
as an extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eca3ed7490300ae31dab178d11d70953e96a9e4e 14-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Make __gnu_inline__ functions in gnu99 mode work the same way as inline functions in gnu89 mode in terms of redefinitions.

rdar://9559708 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c2cdd5354aba8d6a74c45231829f3bbbbfeb2781 12-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Don't assert on initialized typedef declarations in classes:

struct {
typedef int A = 0;
};

According to the C++11 standard, this is not ill-formed, but does not have any ascribed meaning. We can't reasonably accept it, so treat it as ill-formed.

Also switch C++ from an incorrect 'fields can only be initialized in constructors' diagnostic for this case to C's 'illegal initializer (only variables can be initialized)'



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

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

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

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

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




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bbf34c024398e7bae825686dcff4c3b901ec9f89 10-Jun-2011 Richard Trieu <rtrieu@google.com> Made changes to how 'struct'/'class' mismatches are handled in -Wmismatched-tags.
- Removed fix-it hints from template instaniations since changes to the
templates are rarely helpful.
- Changed the caret in template instaniations from the class/struct name to the
class/struct keyword, matching the other warnings.
- Do not offer fix-it hints when multiple declarations disagree. Warnings are
still given.
- Once a definition is found, offer a fix-it hint to all previous declarations
with wrong tag.
- Declarations that disagree with a previous definition will get a fix-it hint
to change the declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
175df89a9794271669ec347c8c842a99271cbfce 07-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> More coherent diagnostic when a stack variable is
declared __weak objc-gc mode. // rdar://9666091.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
89b9f10cca9e2812b3e7943d3150fe6c9028bbe4 06-Jun-2011 Douglas Gregor <dgregor@apple.com> Diagnose the condition in C++ [temp.expl.spec]p16 that prohibits
specializing a member of an unspecialized template, and recover from
such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ab01add3825bff91bbed5f1cd4d5652ae1383148 03-Jun-2011 Francois Pichet <pichet2000@gmail.com> Revert r132544. Accidental commit. I got confused with the Tortoise SVN menu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
696df647c22b4bc632c68777eca1f667ae5dcad4 03-Jun-2011 Francois Pichet <pichet2000@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3f0556d8fb5f792e19cc79055a19fc7a0830533a 03-Jun-2011 Francois Pichet <pichet2000@gmail.com> Correctly revert r131347: function explicit specialization at class scope.
I'll try to implement this functionality again soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fb3f4aad0436a9c40e9130598162150890c405b5 02-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Implement -fgnu89-inline. Fixes PR10041.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b4746036322385bf27d33ec1fc3c82a8bb3d1e58 01-Jun-2011 Francois Pichet <pichet2000@gmail.com> Microsoft friend acting as a forward declaration; try#2. Now only 2 lines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5aecb786a32d321e8d3462cd49e50092e8d55cd3 01-Jun-2011 Francois Pichet <pichet2000@gmail.com> Revert 132332 (Microsoft friend as a forward declaration), John McCall pointed out a better/simpler way to do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fa6e63a06bf6d6bd10c6dfd38966adf4160bf979 31-May-2011 Francois Pichet <pichet2000@gmail.com> Recreate the DeclContext before adding the implicit friend forward declaration. This should fix the asserting buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8adc227de934e23c72eb8d9abf5c0e3dfffec131 31-May-2011 Francois Pichet <pichet2000@gmail.com> For compatibility with MSVC, a friend declaration also act as a forward declaration if the tag name is not already declared. The tag name is declared in the next outermost non record scope.
Example:

class A {
friend class B;
B* b;
};
B* global_b;


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f61103ef335fb273a98c1389e6fddaf796feb4b3 27-May-2011 Douglas Gregor <dgregor@apple.com> Clean up my changes to jump-diagnostic handling for local variables of
class type (or array thereof), eliminating some redundant checks
(thanks Eli!) and adding some tests where the behavior differs in
C++98/03 vs. C++0x.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
ca63c200346c0ca9e00194ec6e34a5a7b0ed9321 25-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a new type node, UnaryTransformType, designed to represent a
type that turns one type into another. This is used as the basis to
implement __underlying_type properly - with TypeSourceInfo and proper
behavior in the face of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
63fe6814f339df30b8463b39995947cbdf920e48 24-May-2011 Douglas Gregor <dgregor@apple.com> Implement the initial part of C++0x [expr.const]p2, which specifies
that the unevaluated subexpressions of &&, ||, and ? : are not
considered when determining whether the expression is a constant
expression. Also, turn the "used in its own initializer" warning into
a runtime-behavior warning, so that it doesn't fire when a variable is
used as part of an unevaluated subexpression of its own initializer.

Fixes PR9999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e885e188b25dc218132402d1f48fb35e175bfb2e 21-May-2011 Douglas Gregor <dgregor@apple.com> Diagnose the presence of storage-class-specifiers on explicit
instantiations and specializations. Fixes <rdar://problem/9126453> and PR8700.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4337dc776074ac0143b49823890303f952d3d9ae 21-May-2011 Douglas Gregor <dgregor@apple.com> Teach Sema::ActOnUninitializedDecl() not to try to interpret when one
should use a constructor to default-initialize a
variable. InitializationSequence knows the rules for default
initialization, better. Fixes <rdar://problem/8501008>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
575a1c9dc8dc5b4977194993e289f9eda7295c39 20-May-2011 Douglas Gregor <dgregor@apple.com> Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.

Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a0448264c7da395ca9416c6570bc43a7f49e436b 20-May-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Fix PR9941 for out-of-line template destructors too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
42bef03a0f0462a95eb66b9e63feab0bf596134d 19-May-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Fix PR9941 again, this time for templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
db5d44b775c60166074acd184ca9f1981c10c2a7 19-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement __underlying_type for libc++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
cf34e757b968f1fa7965cab1464212ade4d9f991 17-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement the new C++0x rules for non-trivial things in unions so that
my defaulted constructor tests stop yelling at me about them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e1e96a6201168c232a06ec81685f948e05fddd39 14-May-2011 Francois Pichet <pichet2000@gmail.com> Revert 131347. It asserts if the specialization in within a class template:

template<class U>
struct X1 {
template<class T> void f(T*);
template<> void f(int*) { }
};

Won't be so simple. I need to think more about it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1fa8028d9ff5de64f8b9d55731ca83a2d3423a77 14-May-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, allow template function explicit specialization at class scope.
Necessary to parse MFC and MSVC standard lib code.

Example:
struct X {
template<class T> void f(T) { }
template<> void f(int) { }
}


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
640c63cf4db3847b9d59878e9e5372332e2cd141 12-May-2011 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
6a24747beed797b2f1184c66ca45beb4db20eb08 11-May-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, allow pure specifier (=0) on inline functions declared at class scope.
This removes 2 errors when parsing MFC code with clang

Example:
class A {
virtual void f() = 0 { }
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
7604f64a865bdba86c05cab76bcd47fd10372eb8 10-May-2011 Douglas Gregor <dgregor@apple.com> Ignore const/volatile/restrict qualifiers on anonymous structs and
unions. Fixes PR8326.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
93b6bceb0f009942e8a9e97d8c5c316ad10338f2 09-May-2011 Douglas Gregor <dgregor@apple.com> Extend the tag-ambiguity hack I committed in r130810 for tag
definitions to also include tag declarations. Fixes PR8151.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
61c6c4415d0f73bd033128ac85f054a0211e7c42 04-May-2011 Douglas Gregor <dgregor@apple.com> When tag lookup finds something ambiguous, and we're defining a new
tag, filter out those ambiguous names that we found if they aren't
within the declaration context where this newly-defined tag will be
visible.

This is basically a hack, because we really need to fix the lookup of
tag declarations in this case to not find things it
shouldn't. However, it's better than what we had before, and it fixes
<rdar://problem/9168556>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130810 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0f4be74ff0273e505d383f89174ef539828424ed 03-May-2011 Chandler Carruth <chandlerc@gmail.com> When parsing a template friend declaration we dropped the template
parameters on the floor in certain cases:
class X {
template <typename T> friend typename A<T>::Foo;
};

This was parsed as a *non* template friend declaration some how, and
received an ExtWarn. Fixing the parser to actually provide the template
parameters to the freestanding declaration parse triggers the code which
specifically looks for such constructs and hard errors on them.

Along the way, this prevents us from trying to instantiate constructs
like the above inside of a outer template. This is important as loosing
the template parameters means we don't have a well formed declaration
and template instantiation will be unable to rebuild the AST. That fixes
a crash in the GCC test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fb44de956f27875def889482b5393475060392af 02-May-2011 John McCall <rjmccall@apple.com> Store a parameter index and function prototype depth in every
parameter node and use this to correctly mangle parameter
references in function template signatures.

A follow-up patch will improve the storage usage of these
fields; here I've just done the lazy thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3b887354b1b667c97d070ddc67b5354353c4c07b 27-Apr-2011 Douglas Gregor <dgregor@apple.com> Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
27766d2501259c7b12b1056e0c491a927b304e10 27-Apr-2011 Douglas Gregor <dgregor@apple.com> Improve diagnostics for typo correction via Sema::ClassifyName(), by
looking at the context and the correction and using a custom
diagnostic. Also, enable some Fix-It tests that were somewhat lamely
disabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c1a0a73c1fad684dd23e9aade02c4e00dbaeaee6 26-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Add ms_struct attribute on record typee
(and ignore it for now) - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
865dd8c8fe65d7743cfbc412316e59e6c149624d 25-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> 'extern' variables in functions don't shadow externs in global scope. Fixes rdar://8883302, this time for C++ as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ec385cf3c73434e42d03c321b05100ca64e0c90d 25-Apr-2011 Douglas Gregor <dgregor@apple.com> When Sema::ClassifyName() finds an invalid ivar reference, return an
invalid expression rather than the far-more-generic "error". Fixes a
mild regression in error recovery uncovered by the GCC testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
312eadb832cab4497a069409954500d8192b8f0d 24-Apr-2011 Douglas Gregor <dgregor@apple.com> Implement a new identifier-classification scheme where Sema
performs name lookup for an identifier and resolves it to a
type/expression/template/etc. in the same step. This scheme is
intended to improve both performance (by reducing the number of
redundant name lookups for a given identifier token) and error
recovery (by giving Sema a chance to correct type names before the
parser has decided that the identifier isn't a type name). For
example, this allows us to properly typo-correct type names at the
beginning of a statement:

t.c:6:3: error: use of undeclared identifier 'integer'; did you mean
'Integer'?
integer *i = 0;
^~~~~~~
Integer
t.c:1:13: note: 'Integer' declared here
typedef int Integer;
^


Previously, we wouldn't give a Fix-It because the typo correction
occurred after the parser had checked whether "integer" was a type
name (via Sema::getTypeName(), which isn't allowed to typo-correct)
and therefore decided to parse "integer * i = 0" as an expression. By
typo-correcting earlier, we typo-correct to the type name Integer and
parse this as a declaration.

Moreover, in this context, we can also typo-correct identifiers to
keywords, e.g.,

t.c:7:3: error: use of undeclared identifier 'vid'; did you mean
'void'?
vid *p = i;
^~~
void

and recover appropriately.

Note that this is very much a work-in-progress. The new
Sema::ClassifyName is only used for expression-or-declaration
disambiguation in C at the statement level. The next steps will be to
make this work for the same disambiguation in C++ (where
functional-style casts make some trouble), then push it
further into the parser to eliminate more redundant name lookups.

Fixes <rdar://problem/7963833> for C and starts us down the path of
<rdar://problem/8172000>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d4a0caf78e7c18e7aca65fbfd799a6c024ff51fb 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Correctly emit a diagnostic for multiple templated function definitions in -flate-template-parsing mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4bada2e3f20a3c76f5493e3163eafc02258c5902 22-Apr-2011 Francois Pichet <pichet2000@gmail.com> Do not return true from MergeFunctionDecl for a warn_static_non_static warning in Microsoft mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cfe38c4db48f188db3f48dc48030d8be6f6e3e03 22-Apr-2011 Chandler Carruth <chandlerc@gmail.com> I concur with DPG here. This does indeed apply in 0x mode. Added test
cases that demonstrates exactly why this does indeed apply in 0x mode.

If isPOD is currently broken in 0x mode, we should fix that directly
rather than papering over it here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2e510a0c0f7afa7951aa19c65a06c2da579535a8 22-Apr-2011 Francois Pichet <pichet2000@gmail.com> Downgrade error "static declaration of 'foo' follows non-static declaration" to a warning in Microsoft mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
db57a4cdb0a6abf3239f3a794a900ce312c5887b 19-Apr-2011 Daniel Dunbar <daniel@zuster.org> ADT/Triple: Switch to using .isOSDarwin() predicate.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3441a520c63a5609abdd35614753a6059ac134fc 13-Apr-2011 Francois Pichet <pichet2000@gmail.com> Still not used to put the * next to the variable name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6943e9befee204becfae55de1298b3d5fee87934 13-Apr-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning. Up to now this is the only case I found where MSVC doesn't require "typename" at class scope. Really strange!
This fixes 1 error when parsing the MSVC 2008 header files.
Example:

template<class T> class A {
public:
typedef int TYPE;
};
template<class T> class B : public A<T> {
public:
A<T>::TYPE a; // no typename required because A<T> is a base class.
};


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a49218e17bcbb1acde0245773173e2c0c42f4f19 09-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR8369: make __attribute((regparm(0))) work correctly. Original patch by
pageexec@freemail.hu, tweaks by me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d40066b0fb883839a9100e5455e33190b9b8abac 05-Apr-2011 Ted Kremenek <kremenek@apple.com> Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b613cd6862a80126666c46a41de36c1ba7704c2e 29-Mar-2011 Francois Pichet <pichet2000@gmail.com> Accept __declspec(dllimport) for function defined at class scope in Microsoft mode.

This fixes a bunch of errors when compiling MSVC header files with the -DDLL flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a7689efa25bf54452c758c672bd1a5608d5757cc 27-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Diagnose uninitialized uses of a variable within its own initializer.
This is basically the same idea as the warning on uninitialized uses of
fields within an initializer list. As such, it is on by default and
under -Wuninitialized.

Original patch by Richard Trieu, with some massaging from me on the
wording and grouping of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
379246d29b1c7ef2659beadf41b4cb79806c0e63 26-Mar-2011 John McCall <rjmccall@apple.com> Don't warn about the 'extern' in 'extern "C"' on a tag decl. This is
usually useless, but not always.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1d2de76c75fc1ac870c6df84c5368206c00d9a5e 24-Mar-2011 Douglas Gregor <dgregor@apple.com> Minor fix in the injection of labels, since we want to look at the redeclaration context of each declaration in the identifier chain. Should fix Linux self-host

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0b7e678a11ece4288dc01aebb5b17e5eef8f8d2d 24-Mar-2011 John McCall <rjmccall@apple.com> Insomniac refactoring: change how the parser allocates attributes so that
AttributeLists do not accumulate over the lifetime of parsing, but are
instead reused. Also make the arguments array not require a separate
allocation, and make availability attributes store their stuff in
augmented memory, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ac4df2454d5462c3bf5f369d65c3ad651100fa40 23-Mar-2011 John McCall <rjmccall@apple.com> Warn about unused declaration-specifiers on tag declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
850d3b304b69b40c0292d433743aba82f3add4a8 22-Mar-2011 John McCall <rjmccall@apple.com> Apply Jonathan Sauer's proposed solution to PR9519. Thanks!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b0a2fcc1e9f621157361341b2aa3b7c780978040 18-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Defined friend functions are *implicitly* inlined, unless the inline specifier occurs explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
eef7ac5837ef3e0682ac0973121fff8edaa46ca4 16-Mar-2011 Douglas Gregor <dgregor@apple.com> Detect attempts to provide a specialization of a function within a
dependent scope and produce an error (rather than crashing). Fixes PR8979.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
250e7a74d5a23db5bd7202ecb0bb4a8fef6016b4 16-Mar-2011 Douglas Gregor <dgregor@apple.com> When we're inserting a synthesized label declaration for a
forward-looking "goto" statement, make sure to insert it *after* the
last declaration in the identifier resolver's declaration chain that
is either outside of the function/block/method's scope or that is
declared in that function/block/method's specific scope. Previously,
we could end up inserting the label ahead of declarations in inner
scopes, confusing C++ name lookup.

Fixes PR9491/<rdar://problem/9140426> and <rdar://problem/9135994>.

Note that the crash-on-invalid PR9495 is *not* fixed. That's a
separate issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7cbc558ffda5877ec4d2e432534e3d3d4ac10050 14-Mar-2011 Douglas Gregor <dgregor@apple.com> When synthesizing a label declaration based on a goto statement that
cannot yet be resolved, be sure to push the new label declaration into
the right place within the identifier chain. Otherwise, name lookup in
C++ gets confused when searching for names that are lexically closer
than the label. Fixes PR9463.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
975cc644d5d9dafdb4060aa31c9753d0554e1308 10-Mar-2011 Daniel Dunbar <daniel@zuster.org> Revert r127206 "Detect attempts to provide a specialization of a function within
a...", it appears to cause us to reject various valid codes.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
02b0d651ecd6a4d5171dd0208c0c570c3d7103b7 08-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Warn on usage of unavailable objc 'class' in
varienty of cases. // rdar://9092208


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
db93fdee6c5a24e86ee5ed8c1d3b597e17d5893b 08-Mar-2011 Douglas Gregor <dgregor@apple.com> Detect attempts to provide a specialization of a function within a
dependent scope and produce an error (rather than crashing). Fixes PR8979.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d97cec3deb6e34f0f9d4f5f8ec11b28e44812727 07-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> g++ is more permissive regarding flexible arrays.
It will accept flexible array in union and also as the sole element of a struct/class.

Fixes rdar://9065507.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cc20945c787a56abe418947fc6a2c520bcec66c0 07-Mar-2011 Douglas Gregor <dgregor@apple.com> Support explicit template specialization and instantiation for members
of a C++0x inline namespace within enclosing namespaces, as noted in
C++0x [namespace.def]p8.

Fixes <rdar://problem/9006349>, a libc++ failure where Clang was
rejected an explicit specialization of std::swap (since libc++ puts it
into an inline, versioned namespace std::__1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a868c3799b739781db325c1bd2c6afd182bc9bd6 06-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Completed source ranges fixes for all classes inheriting from TypeDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
344577e6b58f42d18dc8118c8903b49a85dc005e 06-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed TypedefDecl and TemplateTypeParameter source range.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
26cd44da98f3c5293243020b4cdfa7f49f68d1be 05-Mar-2011 Douglas Gregor <dgregor@apple.com> When diagnostics are suppressed (e.g., because of code completion), don't trigger the ExprTemplates.empty() check at the end of a function body

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cb710a4df50b79659399f0722ea29e90251ea834 04-Mar-2011 Douglas Gregor <dgregor@apple.com> Diagnose destructor templates. Fixes PR7904.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
21e006e51a7f9889f55f5bc7b3ca8b50d17571ec 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for FileScopeAsmDecl. Others source range fixes will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1e284a703c627d0614032190cf60392af7565289 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Remove cruft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0a9beb52baa6c990d45d638a177d9456e650282a 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Force CaseStmt to store its child statements in source-code order,
which is important for libclang's token-annotation and
where's-my-cursor functionality. Fixes <rdar://problem/9004439>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eca5d22c16eb784e5f35ca816fa22e0c0e060417 02-Mar-2011 John McCall <rjmccall@apple.com> Support a new InheritableAttr subclass, InheritableParamAttr, which is
used for attributes that are okay to inherit when written on a parameter.
Dependent on LLVM r126827.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
c22b5fff39a7520207f165fb16a27a34b944bd9c 25-Feb-2011 Douglas Gregor <dgregor@apple.com> Use NestedNameSpecifierLoc within out-of-line variables, function, and
tag definitions. Also, add support for template instantiation of
NestedNameSpecifierLocs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3ed6fc08a9cd293d012fa49ab2a615e618d7c3fa 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Issue AnalysisBasedWarnings as part of calling Sema::PopBlockOrFunctionScope(). No real functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
406c38e8c1f105acfd438f94dfbc17af817aa4a5 23-Feb-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR9276: We were missing the checks for auto deducing to different types in the same declaration group in the template instantiation case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
5f39f706afeb4d4a6f246db1e8cd2da0fb5b7f37 19-Feb-2011 Douglas Gregor <dgregor@apple.com> Remove the Fix-It for "main must return 'int'", which is not always
correct and is not worth fixing. Fixes PR8396.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
337e550218128e7d922c09bb354fbc71de90c568 18-Feb-2011 Chris Lattner <sabre@nondot.org> Switch labels over to using normal name lookup, instead of their
own weird little DenseMap. Hey look, we now emit unused label
warnings deterministically, amazing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
57ad37823e198f977cac605dbfbaefb4daf325e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e2f82f71385051ce5abfba317d2f592aa332c588 11-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
14b6ba77710d6431794d65c7d58c6f29c3dc956e 09-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> AST, Sema, Serialization: keep track of cudaConfigureCall

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
651f86fb6b0f1a251c65a9be6d3fa83e67d5988d 08-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Sema::CheckShadow, get the DeclContext from the variable that we are checking
instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them.

Fixes http://llvm.org/PR9160 & rdar://problem/8966163.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1de34dd8a6932fbb316e35304bf468ddb4a0841b 05-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> When the out-of-line definition differs from the declaration in the return type,
say "out-of-line definition differ from the declaration in the return type" instead of
the silly "functions that differ only in their return type cannot be overloaded".

Addresses rdar://7980179.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
461bf2eb82981d00a014409126ef9c3538551a94 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Tweak my fix for PR8748, and update the incorrect PR number in the test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d89d86fe4acaa4782b0ed8a684bbc1b32cb48b70 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Tighten up the semantics of default template arguments, per C++0x
[temp.param]p9 and C++ DR226. Fixes PR8747.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
cde5a400dbc9655eddf0f383585d3cf67c11c539 01-Feb-2011 John McCall <rjmccall@apple.com> The code trying to assign a typedef to an anonymous tag declaration was
extremely rambunctious, both on parsing and on template instantiation.
Calm it down, fixing an internal consistency assert on anonymous enum
instantiation manglings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
36eb5e43bcdbe291da4df696755009ffd6a35ac2 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn that variables in C++ static member functions shadow fields. Fixes rdar://8900456.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
49a61727986332f2eba61fb2657800d76c5a4bb9 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the diagnostic when we are shadowing an external variable and there exists a locally scoped extern with the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6684d85e9075e3c1750d911c69a517145a82a410 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Diagnose if extern local variable is followed by non-extern and vice-versa.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6df96e0756f62edc859d649069daf523536c4221 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> 'extern' variables in functions don't shadow externs in global scope. Fixes rdar://8883302.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5505c72695161e2fb55391d1453b82b7adbff923 24-Jan-2011 Douglas Gregor <dgregor@apple.com> Disallow function template partial specializations, from Hans
Wennborg! Fixes PR8295.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
15e14a289583616e582a23b320933e846a742626 23-Jan-2011 Anders Carlsson <andersca@mac.com> Get rid of [[hiding]], [[override]] and [[base_check]].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9577abc63f2c7afe5adf6e4e101ae91d29c3b8a6 23-Jan-2011 Ted Kremenek <kremenek@apple.com> Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
f1602a56f89ac48aa1b5bce42f07ee795e674a6f 22-Jan-2011 Anders Carlsson <andersca@mac.com> A member function template cannot be virtual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c80e8115278ba1537c8b517a083ecbd0a018b579 21-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Sema: process non-inheritable attributes on function declarations early

This allows us to simplify the handling for the overloadable attribute,
removing a number of FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a97d70b7ea9633e8cbf976510d7a9ea66f4ac96c 21-Jan-2011 Peter Collingbourne <peter@pcc.me.uk> Generalise support for non-inheritable attributes

Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time. By contrast, a non-inheritable attribute
will not be inherited by later redeclarations. Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.

Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable. This patch generalises the concept,
while removing a FIXME. Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).

The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive. Non-inheritable attributes
simply derive from Attr.

N.B. I did not review every attribute to determine whether it should
be marked non-inheritable. This can be done later on an incremental
basis, as this change does not affect default functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
706df2fb3f00450cea6809c363eee35bfb3e1025 20-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
failed to find a case where an enum context would make a difference, but
found PR9007 on the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
2b57aefea762f526405937b3c01901f8e1047edb 11-Jan-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added warning about invalid register specification for local variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
603cfb4da2f7ba08a1c3452c2fbf70585b8e7621 06-Jan-2011 Douglas Gregor <dgregor@apple.com> Initial implementation of function parameter packs. This implementation allows:

1) Declaration of function parameter packs
2) Instantiation of function parameter packs within function types.
3) Template argument deduction of function parameter packs when
matching two function types.

We're missing all of the important template-instantiation logic for
function template definitions, along with template argument deduction
from the argument list of a function call, so don't even think of
trying to use these for real yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0fe5397b26695926a835fa99eceb7fc879b307af 03-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> When in code-completion, skip obj-c method bodies for speed up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ef9d09c4699a2a61d6f28b59b7583b2b28c0a531 03-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Fix PR8841 by checking for both semantic and lecical dependent
contexts. This prevents -Wunused-function from firing on friend function
definitions inside of class templates for example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6b9109e9d5446f213b12d2a6b76495bffb06b794 03-Jan-2011 Douglas Gregor <dgregor@apple.com> When we attempt to create a built-in that involves a library type we
don't have access to (e.g., fprintf, which needs the library type
FILE), fail with a warning and forget about the builtin
entirely. Previously, we would actually provide an error, which breaks
autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
baf86955a9a390f2643a1ea9806832eb4a92f716 01-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Produce a better error message for invalid register names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7f040a9d817cd1c72b565e92abff473510bf9e1d 24-Dec-2010 John McCall <rjmccall@apple.com> Refactor how we collect attributes during parsing, and add slots for attributes
on array and function declarators. This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a8bc8c9e9ba5bffebde00340786fe8542469c435 23-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement parsing of function parameter packs and non-type template
parameter packs (C++0x [dcl.fct]p13), including disambiguation between
unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for
cases like

void f(T...)

where T may or may not contain unexpanded parameter packs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c6ed729f669044f5072a49d79041f455d971ece3 23-Dec-2010 Jeffrey Yasskin <jyasskin@google.com> Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations. Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b68e39930d06ed81a2b431dc09e4cb97e5c0d57a 21-Dec-2010 Douglas Gregor <dgregor@apple.com> In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.

C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.

Fixes PR8839.


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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
320e153dbce9c7f57f22a59e4d162795059717e5 17-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Use hasSameType to compare types for equality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bbca85d14c227641cb482ef497e1e567fe6f9c95 17-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Avoid to emit redundant implicit cast for enum constants init expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
0c9e4799fd78d350a037498b2c797f2b2558791c 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in enumeration types and enumerators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e186269a8a41dbff1ebea2c251048892979d1078 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in various kinds of
declarations. This is a work in progress, as I go through the C++
declaration grammar to identify where unexpanded parameter packs can
occur.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
bfdcdc8e26097c9dbb4c40d78296f6ccc3e6684c 15-Dec-2010 John McCall <rjmccall@apple.com> Set the "implicitly inline" bit on a method as soon as we see a definition
within the class. Teach IR gen to look for function definitions in record
lexical contexts when deciding whether to emit a function whose address
was taken. Fixes PR8789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
723df245307a530da5433dfb43accf187dc3e243 14-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added missing IgnoreParens().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
3922ed09db588c27282369622afb613acaee6a22 10-Dec-2010 Douglas Gregor <dgregor@apple.com> Silence a few more uninitialized-value warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9913d6e086b95cdc791b52c10f773dfd1267f5f8 10-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a compiler warning.


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bfe5788a00b44cf77cb2bd33e1fa0c35eb02e3f9 10-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Refactored/cleanedup ActOnFunctionDeclarator
and ActOnVariableDeclarator
No functionality change. // rdar://8751949


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
a88cefd266c428be33cc06f7e8b00ff8fc97c1ff 03-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added struct/class syntactic info for c++0x scoped enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1ceee5c42d5c410217f67d384eecc6ea4a2bba9b 01-Dec-2010 Fariborz Jahanian <fjahanian@apple.com> Sema/AST work for capturing copy init expression
to be used in copy helper synthesis of __block
variables. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d11617f6e0622bbf843d6f8d60c441f844e46e9a 01-Dec-2010 Douglas Gregor <dgregor@apple.com> Improve the diagnostic when the fixed underlying type of a
redeclaration of an enum type differs from that of the original
declaration, from Daniel Wallin


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8e161ed8e63bd9d3783a987d837b72b2b96c4512 23-Nov-2010 Francois Pichet <pichet2000@gmail.com> Microsoft C anonymous struct implementation.
Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
f4bed3f768a1effac21f3089f4c05f9ab9c37fe3 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the getDiagnosticLevel check since it doesn't buy us much.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1380a147d4578b619c215b23aa79ce17036d3c46 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Rename -Wargument-larger-than -> -Wlarge-by-value-copy
-Improve the diagnostic message
-Add some comments

Suggestions by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3532fdd1db8ff6f353f2a5b215cebe3e0e2ff3c2 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).

Implements rdar://8548050.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dfdfc584f2a8d9f1eebd6e6eaa9b1bbff519d8f9 07-Nov-2010 Anders Carlsson <andersca@mac.com> A union cannot contain static data members or data members of reference type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7533a5b65f81a4eed1e0f0afeb859e26bc0c056b 03-Nov-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Provide an error when a non-identifier name (such as an operator) is used as a
parameter name.

Fixes PR8012.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
21e75d00b0e016fa89d54cf5b4e7d48bf5ff6e57 01-Nov-2010 Douglas Gregor <dgregor@apple.com> Eliminate an unused local variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
82aa713bcda99f388836c2a30bb868d9c9974817 01-Nov-2010 Douglas Gregor <dgregor@apple.com> Require that the types of the parameters of a block literal are complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
82b965992fbd27da37b9e13b5ef618d73f33e5c9 27-Oct-2010 John McCall <rjmccall@apple.com> Avoid calculating linkage until the more obvious checks have run when
deciding whether to queue a decl for unused-declaration warnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5b629aa86c987f276d00453b6c9ab8424f7903fe 23-Oct-2010 John McCall <rjmccall@apple.com> Parse attributes on enumerators and instantiate attributes on enum decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0bab54cf82cd679152197c7a2eb938f8aa9f07dd 21-Oct-2010 Douglas Gregor <dgregor@apple.com> Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.

Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
693d467ed44ecb754762aff129accce30c306422 18-Oct-2010 Anders Carlsson <andersca@mac.com> Implement the first half of [dcl.attr.override]p6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
842e7a22c6a0fbf0ccdb4bb9308d92ca9e9621f6 18-Oct-2010 Francois Pichet <pichet2000@gmail.com> Microsoft enum extensions. 2 things will change on -fms-extensions:
1. enum underlying type is int by default.
2. Error "enumerator value is not representable in the underlying type"is a ExtWarning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4d09e84fbb0305372efc778a6770f0c3a5b5b2ae 18-Oct-2010 Anders Carlsson <andersca@mac.com> Implement [dcl.attr.override]p2 and add tests for p1 and p2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
c6eddf50bff68683238f06625fa9fb5016a3694c 16-Oct-2010 Douglas Gregor <dgregor@apple.com> Allow list-initialization of a local variable of class type with a
flexible array member, so long as the flexibility array member is
either not initialized or is initialized with an empty initializer
list. Fixes <rdar://problem/8540437>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
66c42d443982a0891ce58deb7391d641ca87adc5 15-Oct-2010 Douglas Gregor <dgregor@apple.com> Don't complain about a variable within a linkage-specification that is
initialized. Fixes PR7076.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3b8f610ac98f816f3d5c4657fc45dcd130a4bfdb 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't add the injected class name to the redeclarations chain; the chain should contain actual redeclarations, not implicits.
As a bonus, now we don't deserialize it unless we need it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a6c1e3a56afb76876cd06e3646fd7ca57a38d4bb 14-Oct-2010 Douglas Gregor <dgregor@apple.com> Diagnose when a 'static' member function overrides a virtual function
in a base class. Fixes PR8168.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
240a020bed4a58c3e2e894ad4a3dd31ee3147c9f 12-Oct-2010 Duncan Sands <baldrick@free.fr> Pacify gcc-4.4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
16c5dea6c2d3e4cf529de9d9b37f6a40441acb2c 10-Oct-2010 Chris Lattner <sabre@nondot.org> fix PR8217, a silent miscompilation of invalid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1d1e70ec6545c8ca863e00aaca14287269a23c1c 09-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix g++.dg regressions introduced at r115347 (rdar://8529993)

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
9a2b9d794bdf349b517ff799170f4409f45d147c 08-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -fshort-enums (rdar://8490496).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4a1bb8c4d708d5594e62c9ec7e25e273cae8a1ed 05-Oct-2010 Douglas Gregor <dgregor@apple.com> Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c71d8eb6592ae3ef498fc57db3563d1dfae48dff 01-Oct-2010 Francois Pichet <pichet2000@gmail.com> Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.

Example:
class A {
void A::foo(); //warning: extra qualification on member 'foo'
};


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
c5be7b0fc804d8e6f87298ec03c94d8cccd74f29 28-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> vla expressions used in __typeof__ must be evaluated.
Fixes rdar://8476159.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
2b64239a8ef4829be7b2c32eff60d8de204b4e2c 23-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix bogus compiler errors when declaring anonymous union, outside a class, with
members with the same name as a decl outside the scope where the members are actually introduced.
Fixes http://llvm.org/PR6741

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
355a9fe26a6dec89680ddf713dd5bc7a671b298a 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -Wunused-label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
069ea646616e4ece684e1dec652640f644f0d40a 17-Sep-2010 Douglas Gregor <dgregor@apple.com> When dealing with an anonymous enumeration declared in function
prototype scope, temporarily set the context of the enumeration
declaration to the translation unit. We do the same thing for
parameters, until we have an actual function declaration on which to
hang them. Fixes <rdar://problem/8435682>.

There is more work to do in this area, since we have existing bugs
with tags being declared/defined in function parameter lists. This fix
is correct, and we'll end up extending it when we deal with those
existing bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
09246183715f4b0a8728a3827bfe894b6c6016b9 15-Sep-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's flexible array rules relaxation:
- in union
- as the only element of a struct/class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8dc3abcc36df883324461daad0c05364158f3cf0 12-Sep-2010 Francois Pichet <pichet2000@gmail.com> Add basic support for Microsoft enum forward declaration.
Assigning an underlying integral type to an enum forward declaration will come in a next patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4e6356426fcfef84e2484820814a8eaaaf547eda 11-Sep-2010 John McCall <rjmccall@apple.com> Support in-class initialization of static const floating-point data members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
538e0d0292cab16198a4fce5c388ff06adc74d0c 08-Sep-2010 Francois Pichet <pichet2000@gmail.com> Allow type definitions inside anonymous struct/union in Microsoft mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a4a301dc74dd4e7da1c35cbb3c1e03614482728b 08-Sep-2010 Gabor Greif <ggreif@gmail.com> add a fixit when 'main' does ot return 'int'; review welcome

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fbc5b49322577e03ed780dcdf5be514871ec381d 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Provide a specific diagnostic when trying to redefine an "extern
inline" function outside of GNU89 mode. Fixes
<rdar://problem/6880464>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e63438b34b075a65849b9dee022adffc7c222ae5 03-Sep-2010 Anders Carlsson <andersca@mac.com> It's OK for classes to have flexible array elements (but not unions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4938f2385f82e54df019b2fb1128a58ebad98bec 03-Sep-2010 Anders Carlsson <andersca@mac.com> Static local variables don't result in global constructors being emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1baf2f778c26a71d1353ff2cc1701fcd1dbeaf76 31-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Fix a regression that allowed clearly ill formed code. The diagnostic is still
terrible, FIXME left to do a proper job of diagnosing this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
7f6ff02d66bcf397cbe154da89de97fd5f96657c 30-Aug-2010 Douglas Gregor <dgregor@apple.com> Add redeclaration checking for static data members and fix a corner
case with redeclaration checking for fields, from Faisal Vali!
Fixes PR7970.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
757c600d696f016fea6b086d0349bcd7a4d06bd1 28-Aug-2010 Douglas Gregor <dgregor@apple.com> Miscellaneous found by inspection with John and Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
781472fe99a120098c631b0cbe33c89f8cef5e70 25-Aug-2010 John McCall <rjmccall@apple.com> Split FunctionScopeInfo and BlockScopeInfo into their own header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
e0054f61fd84133eb0d19c19ae9afaf117933274 25-Aug-2010 John McCall <rjmccall@apple.com> Remove AnalysisBasedWarnings.h's dependency on Type.h



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fbce0e1d582f10d890111d8d27f6e88055be6422 24-Aug-2010 John McCall <rjmccall@apple.com> It turns out that this template is only instantiated at one type.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
d097be8f81fbf4ed96ac10bae18562dd8202666b 24-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Handling remaining rule for synthesize bitfields in
class extensions (nonfragile-abi2).For every class @interface and class
extension @interface, if the last ivar is a bitfield of any type,
then add an implicit `char :0` ivar to the end of that interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
000835d0b04345c0014c603fe6339b3bc154050e 23-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).


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



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

Fixes <rdar://problem/8212293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4087f27e5416c799bcb6be072f905be752acb61c 18-Aug-2010 Daniel Dunbar <daniel@zuster.org> StringRef'ication of lots stuff, patch by Peter Davies!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2d7d2d99bc450ac1472086a6d57e77a1995297f8 17-Aug-2010 John McCall <rjmccall@apple.com> A field of incomplete type is sufficiently disruptive that we should mark
the record invalid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dd7744d01e513e941f47893b16dfebae2c1c9911 16-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit diagnostic error when the field of an anonymous struct is non trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
06999f8ff61de3c63a52871bd7ac61e7ada9180b 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for the common pattern of disallowing copying:

class S {
S(const S&); // DO NOT IMPLEMENT
void operator=(const S&); // DO NOT IMPLEMENT
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bbc6454bb98d6a6ecbaafa715222c5db834307f2 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Commit improved version of 111026 & 111027.

Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
05eac86d547892847ca95b5350e28d681150fa68 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert 111026 & 111027, build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
30c0dd86f0dc3c1a1fba29581d04e8ed0bdb659d 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> The unused warnings extravaganza continues. Warn for:

-static variables
-variables in anonymous namespace (fixes rdar://7794535)
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f6d1d43d68016e975f22264343631a55b9701495 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Expand the unused warnings for functions. Warn for:

-static function declarations
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
49b96d1a382ae9f31456166f1a734d3f7f30b992 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also keeping track of unused file scoped variables.

This is only preparation, currently only static function definitions are tracked, as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
fcadea2556be268121a6216e367bbe3598c4008e 12-Aug-2010 John McCall <rjmccall@apple.com> Fix a crash on invalid when declaring an implicit member of a class with an
invalid destructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
deacbdca554298ccdf636f19c6094a8825ec6b34 11-Aug-2010 Douglas Gregor <dgregor@apple.com> Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bf87f2c1c6e2d8cb50902a6d79e8b170c19570d2 10-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Fix redefinition of typedefs of fixable variably-modified array types; should
fix an issue compiling <windows.h>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
74c730ad1f6818b676b0bad46d806a9176950328 09-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for forward declarations and the definition.
- Eagerly create ObjCInterfaceTypes for declarations.
- The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another.
- Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d945538a36642cb0f935b268acbc32a67fae85a6 06-Aug-2010 Douglas Gregor <dgregor@apple.com> Make sure that we diagnose attribute((overloadable)) functions without
prototypes. Fixes PR7738.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7c15353ccaed24f2df932571166bf305c1b98b6d 06-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Template keyword should not be ignored building a QualifiedTemplateName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ed328c6129152f66771c3bed338a2e6e13e4e230 06-Aug-2010 Douglas Gregor <dgregor@apple.com> Diagnose the use of "inline" on block-scope function declarations in
C++, from Andrea Nall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9983d2d76c8107672b5907124266f482ba03823f 06-Aug-2010 John McCall <rjmccall@apple.com> Properly pop out of Objective-C method declarations when they are (ill-formedly)
found within contexts other than the translation unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
b4b9b15c597a923a03ad0a33cdc49b67e5cc4450 01-Aug-2010 John McCall <rjmccall@apple.com> Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b567a8b94c1067e2518e50eb58d13421550a2e02 01-Aug-2010 John McCall <rjmccall@apple.com> Fix indentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e46f62cbaaa6294d84be09f3c9b910a2031be913 01-Aug-2010 John McCall <rjmccall@apple.com> Don't consider all local variables in C++ to mandate scope-checking, just
those with initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b60a77e453d32db0ab1914d28e175c2defc0eb65 01-Aug-2010 John McCall <rjmccall@apple.com> Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function. Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.

Turns off the jump-checker in a lot of cases in C++. rdar://problem/7702918


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
447234dd459a00a5ed9b7c3e066162cd7a75bf2d 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Allow a looser form of compatibility checking (which ignores
qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
98c2e6248fa4152cd6a6aea9a8d894f7fe21f394 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Don't set out-of-line template specialization/definition information
for AST nodes that aren't actually out-of-line (i.e., require a
nested-name-specifier). Fixes <rdar://problem/8204126>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3c46e8db99196179b30e7ac5c20c4efd5f3926d7 26-Jul-2010 Dan Gohman <gohman@apple.com> Fix namespace polution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
f178dcab504ac47901dc99ff51b0d0fe07dddbe1 24-Jul-2010 Douglas Gregor <dgregor@apple.com> Be careful; even though we had a proper name at the beginning of
Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating
has a useful name. <rdar://problem/8229910>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
acb7039ca3a39d564b765d31e7e8e35d3c17f261 24-Jul-2010 John McCall <rjmccall@apple.com> We never want to pop the translation unit DC, so assert if this happens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109280 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
a0ebd60bfda56c161a87adb01f1b9a1d0e7ae32f 16-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert Microsoft-specific override of the "typedef requires a name"
diagnostic. Instead, put it and the "declaration does not declare
anything" warning into -Wmissing-declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0c99ec6d229b49085ec3c364d5c6090b33438a93 16-Jul-2010 Douglas Gregor <dgregor@apple.com> Suppress the "typedef requires a name" warning in Microsoft-extensions mode

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c9068d7dd94d439cec66c421115d15303e481025 16-Jul-2010 John McCall <rjmccall@apple.com> Treat template parameters as part of the declaration-specifiers for the
purpose of access control. Fixes PR7644.

I can't actually find anything directly justifying this, but it seems obvious.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b21fc4a4c17fdf7d3de4fd3cd36a1ad4d8af6f55 16-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Butcher a perfectly reasonable diagnostic to pacify old versions of SWIG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bee05c1206dcd525e0a1f066d166ad3e972a500e 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add builtin definition for scanf, including extending the builtin encoding to
represent builtins that have the "scanf" attribution (via the format attribute) just
like we do with printf functions. Follow-up work is needed to add similar support
for fscanf et al.

This is to support format-string checking for scanf functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0167f3c25581c39cd024d7a924553959c4893381 15-Jul-2010 Douglas Gregor <dgregor@apple.com> When there are extra or missing template parameter lists in a template
definition, we're likely going to end up breaking the invariants of
the template system, e.g., that the depths of template parameter lists
match up with the nesting template of the template. So, make sure we
mark such ill-formed declarations as invalid or don't even build them
at all.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
aef01998af5bbfc1cdfac091248ff7d30ec31456 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Diagnose typedef of an operator name. Fixes PR7462

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a131d0fc0af9f79c90e7654231041b2495d355a9 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Complain when an unnamed enumeration has no enumerations (in
C++). Fixes PR7466.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f9ea1f392ab8946f7bfc3f98802a8e5e6fe073f3 13-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Produce an error on encountering a pointer or reference to a qualified function type. Fixes PR7470.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
fba9e8f85b3043da0e045cd653bcba9b6c60e067 25-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Add comment for my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7d99e989c1a20e358f472e35d615313f2fe223db 24-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression when redeclaration of a global satic
is an extern local to a function. Radar 8125274.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f3a7b7cfacf802db5458874842b71a74845f0023 22-Jun-2010 Douglas Gregor <dgregor@apple.com> In C++, allow a declaration of an enum to follow a definition of that
enum as a GNU extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2bf6d7b1f7406ca4dfe841d4f6ef4b91dce195e4 21-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a corner case bug whereby declaring and defining an extern variable in a
particular sequence causes its definition to not be generated in the object file.
(fixes radar 8071804).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d2c6490385555eaabfaf611d1cf6e89544163c4a 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Merge the "regparm" attribute from a previous declaration of a
function to redeclarations of that function. Fixes PR7025.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a15dae8be2b28e02b6639aa92b832465c5be420 17-Jun-2010 Douglas Gregor <dgregor@apple.com> Fix the recently-added warning about 'typename' and 'template'
disambiguation keywords outside of templates in C++98/03. Previously,
the warning would fire when the associated nested-name-specifier was
not dependent, but that was a misreading of the C++98/03 standard:
now, we complain only when we're outside of any template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d27e50cd839760880a73cfaaa93f912c01cb2171 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Don't poke at an undefined class type of a field. Fixes PR7355.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
52a02758fb81723e16c46721152c6ad0528b2fc3 16-Jun-2010 John McCall <rjmccall@apple.com> Fix the build. Using declarations should not be considering when looking
for overridden virtual methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
9d3347a5887d2d25afe8b0bd35783a72ec86cce2 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.

Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
c722ea4fbf886d6460b256b5e819a4ee751d5fff 15-Jun-2010 Douglas Gregor <dgregor@apple.com> Allocate template parameter lists for out-of-line definitions via the
ASTContext rather than via the normal heap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9b9348889d85fc9daf943c64e3ac3fb021a4f028 12-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added template parameters info for out-of-line definitions of class template methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
33500955d731c73717af52088b7fc0e7a85681e7 11-Jun-2010 John McCall <rjmccall@apple.com> Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.

Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
515ddd8f7a36fc2684492c13665642153fc690c0 09-Jun-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix two typos in comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e1aa9f3a5d3e2c0f8a5606e82eef3c65a6f30672 08-Jun-2010 Douglas Gregor <dgregor@apple.com> When referring to a tag that was previously declared only as a friend,
build a new declaration for that tag type that will be visible for
future lookups of that tag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
82dc00948fe7116edd31bfa07a728fda98648be1 04-Jun-2010 John McCall <rjmccall@apple.com> Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef. Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
9f21f89c323ccf32f6b27acd2e739f6535440df0 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, which
exposes less details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104797 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8a2c92cab213bd7e28ff669577e815cd70bafbe3 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2c0a54031c98721460806e78e0e10da093d3fd72 26-May-2010 Fariborz Jahanian <fjahanian@apple.com> Improve on flexible array diagnostics (PR7029).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1fd6d44d7ca97631497551bbf98866263143d706 22-May-2010 Douglas Gregor <dgregor@apple.com> Improve parser recovery when we encounter a dependent template name
that is missing the 'template' keyword, e.g.,

t->getAs<T>()

where getAs is a member of an unknown specialization. C++ requires
that we treat "getAs" as a value, but that would fail to parse since T
is the name of a type. We would then fail at the '>', since a type
cannot be followed by a '>'.

This is a very common error for C++ programmers to make, especially
since GCC occasionally allows it when it shouldn't (as does Visual
C++). So, when we are in this case, we use tentative parsing to see if
the tokens starting at "<" can only be parsed as a template argument
list. If so, we produce a diagnostic with a fix-it that states that
the 'template' keyword is needed:

test/SemaTemplate/dependent-template-recover.cpp:5:8: error: 'template' keyword
is required to treat 'getAs' as a dependent template name
t->getAs<T>();
^
template

This is just a start of this patch; I'd like to apply the same
approach to everywhere that a template-id with dependent template name
can be parsed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
aec0371e62be013a2e6466688ccf6a7460880262 21-May-2010 John McCall <rjmccall@apple.com> Propagate access specifiers to anonymous union members nested within classes.
Fixes <rdar://problem/7987650>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8a2ca744c259882304ebd387fcda30eb68321211 20-May-2010 John McCall <rjmccall@apple.com> Whoops.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dae69ef4c59fd4b75b956796909592debd7e9bc7 20-May-2010 John McCall <rjmccall@apple.com> Don't try to check jump scopes in invalid functions. Fixes
<rdar://problem/7995494>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2390a72a3ebd37737fec5ba1385db9c3bb22fc59 19-May-2010 Fariborz Jahanian <fjahanian@apple.com> Adds support for ObjC++'s GC attribute on declaration of
object variables and functions returning such objects.



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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5077c3876beeaed32280af88244e8050078619a8 15-May-2010 Douglas Gregor <dgregor@apple.com> Implement semantic analysis and an AST representation for the named
return value optimization. Sema marks return statements with their
NRVO candidates (which may or may not end up using the NRVO), then, at
the end of a function body, computes and marks those variables that
can be allocated into the return slot.

I've checked this locally with some debugging statements (not
committed), but there won't be any tests until CodeGen comes along.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4fb20533baff585c27531fe90c9bf7b004e07bb7 14-May-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a crash on incomplete class declaration.
Radar 7923673.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
5764f613e61cb3183f3d7ceeafd23396de96ed16 09-May-2010 Douglas Gregor <dgregor@apple.com> Improve our handling of the -Wunused-variable warning in templates. In
particular, don't complain about unused variables that have dependent
type until instantiation time, so that we can look at the type of the
variable. Moreover, only complain about unused variables that have
neither a user-declared constructor nor a non-trivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1b5a618c59025898806160ed5e7f0ff5bb79e482 06-May-2010 John McCall <rjmccall@apple.com> Remember the number of positive and negative bits used by the enumerators of
an enum in the enum decl itself. Use some spare bits from TagDecl for this
purpose.



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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
fe60f84c4f201c9ca8126066779da8ee004a70fc 03-May-2010 Douglas Gregor <dgregor@apple.com> When a class contains a non-empty anonymous union or struct, mark is
as non-empty. Fixes PR7021.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
63b4385822857374d035128dff3feac131465496 30-Apr-2010 John McCall <rjmccall@apple.com> Rebuild the nested name specifiers in member-pointer declarator chunks when
entering the current instantiation. Set up a little to preserve type location
information for typename types while we're in there.

Fixes a Boost failure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b21b40532551e946c937bfc2f7584d9195f76c0e 28-Apr-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Written storage class for declarations inside linkage specifications without braces is none.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c8fd2dae17a0fc631a07ab7b66c9d3ebe90a0cc6 27-Apr-2010 Douglas Gregor <dgregor@apple.com> When checking the redeclaration context of a typedef that refers to a
tag of the same name, compare the lookup contexts rather than the
actual contexts. Fixes PR6923.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a6a292b4dc47da42b2fc0662af7fe278c9e9fb33 27-Apr-2010 Douglas Gregor <dgregor@apple.com> Don't look into incomplete types when trying to warn about unused
variables. Fixes PR6948.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0b7bc8e937735e2b3608c049752c4aa48a283d2a 27-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose declaration of reference typed ivars.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
48c89f4aa708e28310cb0c94b2d9d044b0ab806c 24-Apr-2010 Douglas Gregor <dgregor@apple.com> Be more careful around dependent nested-name-specifiers, complaining
when they are not complete (since we could not match them up to
anything) and ensuring that enum parsing can cope with dependent
elaborated-type-specifiers. Fixes PR6915 and PR6649.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
76d326448d7e4c10b2896edc2ee855d1e68d1b88 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f0bf4d554f2513cbb4bec952c81ced59279ad91e 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4e6c0d19b7c072758922cf80525a81aeefc6e64b 24-Apr-2010 Douglas Gregor <dgregor@apple.com> Rework Parser-Sema interface for Objective-C @catch exception object
arguments. Rather than having the parser call ActOnParamDeclarator
(which is a bit of a hack), call a new ActOnObjCExceptionDecl
action. We'll be moving more functionality into this handler to
perform earlier checking of @catch.


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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f88b0d6c99e6473e78331271935986535dc4603c 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0d6b1640eb4d1a4a0203235cfdfcdaf3335af36d 23-Apr-2010 John McCall <rjmccall@apple.com> Recommit my change to how C++ does elaborated type lookups, now with
two bugfixes which fix selfhost and (hopefully) the nightly tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
00b40d3f2fb8b2f9043daf3dd4558bff98346b3c 23-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d04efc98d08731e31bd73f430803acc5ffa9040a 23-Apr-2010 John McCall <rjmccall@apple.com> C++ doesn't really use "namespaces" for different kinds of names the same
way that C does. Among other differences, elaborated type specifiers
are defined to skip "non-types", which, as you might imagine, does not
include typedefs. Rework our use of IDNS masks to capture the semantics
of different kinds of declarations better, and remove most current lookup
filters. Removing the last remaining filter is more complicated and will
happen in a separate patch.

Fixes PR 6885 as well some spectrum of unfiled bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
66dd9394994654b5af2c62ed24f311432bacede5 22-Apr-2010 Douglas Gregor <dgregor@apple.com> When checking whether to diagnose an initialized "extern" variable,
look for the const on the base type rather than on the top-level
type. Fixes PR6495 properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d4b2853cec72abdaa6821aabc372d538dfbc2429 22-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "Unify two diagnostics into one.", it breaks with an assertion failure on bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
792898b58a27ea9034dd95710d388ed30cc693af 22-Apr-2010 Anders Carlsson <andersca@mac.com> Unify two diagnostics into one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
10dc0f8c355c6a726f206aefcb249cb2fafbce17 21-Apr-2010 Anders Carlsson <andersca@mac.com> Remove an unused parameter from isImplicitlyDefined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
63c323d7584e3d91549fae23fb30b426d3b19042 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Only suppress the "extern variable has an initializer" warning when the extern entity being initialized is const.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
41b1d6ba40a5c856f3d0bfed1b825154f87b6127 19-Apr-2010 Douglas Gregor <dgregor@apple.com> Disable the "'extern' variable has an initializer" warning in C++,
since it makes sense there to have const extern variables. Fixes
PR6495.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
72468ecb98efa158c5f1e2eb39ad413c8e28ebe0 16-Apr-2010 Anders Carlsson <andersca@mac.com> Start working on handling wide bitfields in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
c75d6ccf16170af42d31508a026b42382ab8f118 15-Apr-2010 Anders Carlsson <andersca@mac.com> Improve the bit-field too wide error message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
af68d4ed6da11634e2915b3ca31da354369e4bc1 15-Apr-2010 Douglas Gregor <dgregor@apple.com> Fix a few cases where enum constant handling was using
ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for
the width of an integral type. The former includes padding for bools
(to the target's size) while the latter does not, so we woud end up
zero-extending bools to the target width when we shouldn't. Fixes a
crash-on-valid in the included test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
f19de1ce44b9c7ffdeb388d6fe2fa8a1d0288f64 14-Apr-2010 John McCall <rjmccall@apple.com> Mark a function declaration invalid if any of its parameter declarations
are invalid. Prevents a crash-on-invalid during template instantiation.
I... really don't understand how this wasn't already present.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
77e8b11524187f81548450e9e2ad9dd0e7200909 13-Apr-2010 John McCall <rjmccall@apple.com> Support befriending members of class template specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
ba9d853bec0d9cc10ac5fdeab807cc4b13d65791 13-Apr-2010 John McCall <rjmccall@apple.com> Parse constructor names in friend declarations. Part of the fix for
PR6207.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9ea6397bf4ff53768ef4bdc0945965103a22e98c 13-Apr-2010 John McCall <rjmccall@apple.com> Don't try to find a scope corresponding to the search DC for an unfound
friend declaration; this used to be important but is now just a waste of time
plus an unreasonable assertion. Fixes PR6174.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
57265e35292897e383d70bbd1d552209fac37b39 12-Apr-2010 Douglas Gregor <dgregor@apple.com> Fix a crash-on-invalid involving name lookup of tag names, where we
ended up finding a function template that we didn't expect. Recover
more gracefully, and fix a similar issue for class templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cb27b0f70d2017295776afafe3616e0bcd74ab51 12-Apr-2010 Douglas Gregor <dgregor@apple.com> Be sure to instantiate the parameters of a function, even when the
function's type is (strictly speaking) non-dependent. This ensures
that, e.g., default function arguments get instantiated properly.

And, since I couldn't resist, collapse the two implementations of
function-parameter instantiation into calls to a single, new function
(Sema::SubstParmVarDecl), since the two had nearly identical code (and
each had bugs the other didn't!). More importantly, factored out the
semantic analysis of a parameter declaration into
Sema::CheckParameter, which is called both by
Sema::ActOnParamDeclarator (when parameters are parsed) and when a
parameter is instantiated. Previously, we were missing some
Objective-C and address-space checks on instantiated function
parameters.

Fixes PR6733.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a4221cbe1912421ed7e29d0bbac39e9792af8a2 09-Apr-2010 Chris Lattner <sabre@nondot.org> Don't warn about unused static functions if they are marked with
attr constructor or destructor. Patch by Jean-Daniel Dupas!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cb821d045f5e445384f34d05a526955036073c4a 08-Apr-2010 Douglas Gregor <dgregor@apple.com> Downgrade the "declaration does not declare anything" error to a
warning. It's not harmful to have such pointless declarations, and GCC
does not diagnose this issue consistently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c173be2aa78cecc6c35445165e59df99d754a1e0 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Explain that a template needs arguments to make it into a type, for
variable declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
edc287751a4b05e3b4d8ff2b38fa30c5b59a548b 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Fix some redundant errors by changing CXXScopeSpec::isSet calls into
isNotEmpty calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0bd04596e4645ff145a046dfb3475f39674060d9 07-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to not build ivar ASTs when they are ilegally
declared in categories.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a19331f1562c3b09865243ffcd2734c34f417470 02-Apr-2010 Daniel Dunbar <daniel@zuster.org> Sema/Obj-C: Simplify -- eliminate dead casts & provable asserts, and narrow type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1eabb7d0c30f6a876b0fd03ad4656c096c26b8d0 01-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when an elaborated-type-specifer containing a
nested-name-specifier (e.g., "class T::foo") fails to find a tag
member in the scope nominated by the
nested-name-specifier. Previously, we gave a bland

error: 'Nested' does not name a tag member in the specified scope

which didn't actually say where we were looking, which was rather
horrible when the nested-name-specifier was instantiated. Now, we give
something a bit better:

error: no class named 'Nested' in 'NoDepBase<T>'




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4a2023f5014e82389d5980d307b89c545dbbac81 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Extend DependentNameType with a keyword enum that specifies whether
this was parsed as a typename-specifier, elaborated-type-specifier
(including the kind), or just a dependent qualified type name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4714c12a1ab759156b78be8f109ea4c12213af57 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
aec586056d8670c99ba7c4833be13e4eb123cddb 31-Mar-2010 John McCall <rjmccall@apple.com> Support __attribute__((unused)) on types. This suddenly started firing
a lot for me on selfhosts, I dunno why.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7727acf243ee61c0757d86c95b69dbee56a3d898 31-Mar-2010 John McCall <rjmccall@apple.com> Fix PR6327: restore invariants when there's a parse error in an initializer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b0cb022daec8671406ab25f4b5d5a6d48d823bc4 27-Mar-2010 John McCall <rjmccall@apple.com> Implement method friends in class templates and fix a few related problems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
90f97892eb8b2ecfcf633c9df01e2504686d4d96 25-Mar-2010 John McCall <rjmccall@apple.com> When finishing a function definition, leave the function definition *after*
doing all the cleanup tasks and checks. This gives us the proper context for
checking access to base and member destructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9c86b513cb42ea6d9e3f98cb2b7eda39a2eb526b 25-Mar-2010 John McCall <rjmccall@apple.com> Handle simple friend-class decls in class templates better by ensuring that
we look for shadow friend decls in the appropriate scope before injecting
a new declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f3c0bd58400b5a84d16376436e40af79e2d7b105 24-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Improve diagnostics when ivar added to class
extension (radar 6812436).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
036ada215d2c53e6a286b42d7cbd2386b0007516 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Silently drop dependent friend function template specializations,
since we have absolutely no way to match them when they are declared
nor do we have a way to represent these parsed-but-not-checked friend
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5fd378bd9bf1340cd1d1b1d63a5d41cbbc5a1a5e 24-Mar-2010 John McCall <rjmccall@apple.com> Correct that last fixit: if the user wrote
template <> friend void foo(int);
we need to change it to
friend void foo<>(int);
or else the user won't get the template specialization they obviously want.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7ad650f88ecbbe659f10f9f6b34a1f29ea9cf8f9 24-Mar-2010 John McCall <rjmccall@apple.com> Support friend function specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9de672f6eb4a1f076163fd826418ca179e1341ec 23-Mar-2010 Douglas Gregor <dgregor@apple.com> When recovering from a qualified typedef name, don't clear out the
DeclContext because we don't want a NULL DeclContext. Instead, use the
current context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d064fdc4b7b64ca55b40b70490c79d6f569df78e 23-Mar-2010 Ted Kremenek <kremenek@apple.com> Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
053f4bddcb10bd3b17cd6a66fe52e265498603ed 22-Mar-2010 John McCall <rjmccall@apple.com> -Wshadow should only warn about parameter declarations when we're
entering a function or block definition, not on every single declaration.
Unfortunately we don't have previous-lookup results around when it's time
to make this decision, so we have to redo the lookup. The alternative is
to use delayed diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
01620704304f819b82ecef769ec114e541a364d7 21-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR6618.

If a struct has an invalid field, mark it as invalid. Also avoid producing
errors about incomplete types that are invalid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dbdbaaf34f798fa5cabec273c4b9397b3fd6a98c 20-Mar-2010 Ted Kremenek <kremenek@apple.com> Refactor CFG-based warnings in Sema to be run by a worked object called AnalysisBasedWarnings.
This object controls when the warnings are executed, allowing the client code
in Sema to selectively disable warnings as needed.

Centralizing the logic for analysis-based warnings allows us to optimize
when and how they are run.

Along the way, remove the redundant logic for the 'check fall-through' warning
for blocks; now the same logic is used for both blocks and functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a369a95f756b6190b5611ff4118b4cabfc704dc0 20-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wshadow for parameter declarations as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
10f2873c0df7f662bfdb9a3e8bc834b68c1ead48 18-Mar-2010 John McCall <rjmccall@apple.com> Redeclaration lookups for parameter names should be flagged as redeclaration lookups
so they don't trigger diagnostics like (say) access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a8cab015e5f2750cb6f15e71016569739c2ad1e3 17-Mar-2010 John McCall <rjmccall@apple.com> ActOnTagDefinitionError is supposed to 'unwind' ActOnTagStartDefinition, not
ActOnStartCXXMemberDeclaration. We haven't started the field collector on this
class yet, so don't stop it. Fixes a crash in the VS buildbot and a memory error
on all the others.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c48c916b8cebba954429715f15bd5b5e8e4d4574 17-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove warning about shadowing a built-in; built-ins aren't actually
considered to be a part of the translation unit unless they're named
in a way that brings them into existence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
db7bb4a4e7d9744cbc994c90932e6f056228e1ff 17-Mar-2010 John McCall <rjmccall@apple.com> Clean up after ourselves when there's an error parsing the base clause.
Fixes the crash-on-invalid in PR6629.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8472af4df9292e02fb25c952d25a81f3ca296252 16-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wshadow. Based on a patch by Mike M.!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98684 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b6217665c6a987f2d6c8665fd70365d7719ac4df 15-Mar-2010 John McCall <rjmccall@apple.com> Remember declaration scope qualifiers in the AST. Imposes no memory overhead
on unqualified declarations.

Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy(). I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4c9f709fc9ea7a7d8c8a85e29730c2365c2cad18 12-Mar-2010 Ted Kremenek <kremenek@apple.com> Use llvm::SmallVector instead of std::vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
516a6bc399f1f4595423e80c9d4bc687f870acd1 08-Mar-2010 Douglas Gregor <dgregor@apple.com> In C++98/03, an uninitialized variable that has POD class type will be
uninitialized. This seems not to be the case in C++0x, where we still
call the (trivial) default constructor for a POD class
(!). Previously, we had implemented only the C++0x rules; now we
implement both. Fixes PR6536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d6a9324e9b0f77917a6f56781aba80f0d39ded55 07-Mar-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6294: we should only delay recording nested dynamic classes if they
are lexically nested. Othewise, we never end up recording semantically nested
classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9b9edd619a7e616d3287435cb5a3f9b1aea648e8 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Diagnose the declaration of enum templates. Also, be a bit more
careful about value-dependent enumerators. Fixes PR5786.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9ea9bdbc14374f7bacdb50d3e52c664ff12150ff 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.

The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.

Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7bf3600f56342dc434dad994d0c71068e5d3b5c7 01-Mar-2010 Chandler Carruth <chandlerc@gmail.com> Fix the lookup of names used in a friend declaration to not attempt to
re-declare them. This fixes PR6317. Also add the beginnings of an interesting
test case for p1 of [class.friend] which also covers PR6317.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6794974b706ddd51e65dcea411a6378a0f16a2e 01-Mar-2010 Chris Lattner <sabre@nondot.org> fix PR5933: don't warn about unused variables if a function has other errors in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6d97e5e4b7abdae710c2548b51f4ed0298e86d80 01-Mar-2010 Chris Lattner <sabre@nondot.org> Implement jump checking for initialized c++ variables, implementing
a fixme and PR6451.

Only perform jump checking if the containing function has no errors,
and add the infrastructure needed to do this.

On the testcase in the PR, we produce:

t.cc:6:3: error: illegal goto into protected scope
goto later;
^
t.cc:7:5: note: jump bypasses variable initialization
X x;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
78bd771b27d696d156899471303622fa51f52438 25-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Fix a really trivial crasher and begin fleshing out one of the namespace test
cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f914b9782a6091a7c7dfd41b0a273ee724351b84 24-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> More Sema check for ivars in class continuation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
83c481ade785a919ba21a33f9a8b1b21c1212fb3 23-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Early support for declaring ivars in class extensions. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d84aac17180075e0ede53d7762b73d3bd079b52f 22-Feb-2010 Chris Lattner <sabre@nondot.org> Add 'previous declaration is here' note for param redefinition
errors, e.g.:

t.c:1:21: error: redefinition of parameter 'x'
int test(int x, int x);
^
t.c:1:14: note: previous declaration is here
int test(int x, int x);
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
8761d680eaa7386e03f51286f4b84a1ffe575e2e 21-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Make Decl::isOutOfLine() virtual, and use that to determine when definitions
are for out of line declarations more easily. This simplifies the logic and
handles the case of out-of-line class definitions correctly. Fixes PR6107.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
12911a85b2e4c60822281675be133081109dcd32 21-Feb-2010 Ted Kremenek <kremenek@apple.com> Don't warn about functions redeclared without the dllimport attribute when
-fms-extensions is enabled. Fixes <rdar://problem/7669559>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
11062e11236b7bc689dad150e8b490fd6b063ec3 19-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f3f8d2a52ebc0acbe6269a0302f90c21668e2404 18-Feb-2010 Charles Davis <cdavis@mines.edu> Allow redefinitions of extern inline functions in GNU89 mode, just as GCC
does. Fixes PR5253.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
19c152581a46dd162c0cfacad05ad88646d527c5 17-Feb-2010 Douglas Gregor <dgregor@apple.com> When diagnosing enumerator values outside of the range of 'int', be
sure that we get the "too large" vs. "too small" part of the
diagnostic correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c777221d22e2687938c061de6698ddcccbe00fdc 17-Feb-2010 Tanya Lattner <tonic@nondot.org> Do not add functions marked with the unused attribute to the list of unused functions to warn about. Update test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9a66c303c7024967a48877106384bf315c84e80e 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Complain if block-literal expression's parameter name is
missing (in c/objc mode). Fixes radar 7528255.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6bbc01d1c4ec5241df36042e0a4a12a6711934b 12-Feb-2010 Tanya Lattner <tonic@nondot.org> Implementing unused function warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3d2c43e9a7ca55f5ddc1f0c77d8f5e5ea7c1b573 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b372f51166bdf7e2951ef4820941ec3523086865 06-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence GCC warning and stay in 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1610b8198e31eb6d77d4d6904d6af88ef5cc6d3b 06-Feb-2010 Anders Carlsson <andersca@mac.com> Implement a warning diagnostic for weak vtables. Fixes PR6116.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95472 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
04a67a6aa3dfdc92d57f7f8d93ba397348c868a4 05-Feb-2010 John McCall <rjmccall@apple.com> Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
f82b4e85b1219295cad4b5851b035575bc293010 04-Feb-2010 John McCall <rjmccall@apple.com> Allow calling convention attributes to apply to types. Patch by Chip Davis!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6c048a916f6bf526c12217f4a2bc3aa1a62bd62e 03-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Don't do an expensive definition check where a cheap 'is this C?' check suffices.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d219a3a462c31fc9aa0c0bcfb749e9e8e56b5e35 03-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Simplify setting of DeclContext for @catch variable
(per Doug's comment).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2f764f11f513c7b51c716fffa5d02e5de816836f 03-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix DeclContext of an objective-c @catch variable
declaration. Fixes radar 7590273.



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

WHAT!?!

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4cae1b343c7c588856df17d6a11af1614ac41308 02-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Check for redefinitions in MergeVarDecl. This finds redefinitions of globals without an initializer in C++ and thus fixes PR5451.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
677e4feebe4b3485504860d991d700cc3b933961 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Improve handling of enumerator values for C and C++, including:

- In C++, prior to the closing '}', set the type of enumerators
based on the type of their initializer. Don't perform unary
conversions on the enumerator values.
- In C++, handle overflow when an enumerator has no initializer and
its value cannot be represented in the type of the previous
enumerator.
- In C, handle overflow more gracefully, by complaining and then
falling back to the C++ rules.
- In C, if the enumerator value is representable in an int, convert the
expression to the type 'int'.

Fixes PR5854 and PR4515.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
e9d12b6c50c1e9b05443db099e21026c5991a93b 31-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1309f9a3b225ea846e5822691c39a77423125505 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0757c8ccb79210ce1f22142851cdcbf6e42a71d6 24-Jan-2010 Anders Carlsson <andersca@mac.com> Implement [dcl.fct.spec]p6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
92f883177b162928a8e632e4e3b93fafd2b26072 23-Jan-2010 John McCall <rjmccall@apple.com> Implement elementary access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
588a4ad562d717ccbbdbbc36f57e967c0b1ca147 22-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch fixes a lookup bug in c++'s anonymous union member
lookup. Fixes radar 7562438.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7a9813ced7455b8a33a807489ca77a4f809c8a73 22-Jan-2010 John McCall <rjmccall@apple.com> Create function, block, and template parameters in the context of the
translation unit. This is temporary for function and block parameters;
template parameters can just stay this way, since Templates aren't
DeclContexts. This gives us the nice property that everything created
in a record DC should have access in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4c45aa1b00b91847acfb082acfaced3ffa294d1d 21-Jan-2010 Mike Stump <mrs@apple.com> Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls. Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.

This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges. All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f8c4921c73d73123e2b79221ad4f1775ce984cfd 21-Jan-2010 Mike Stump <mrs@apple.com> Move some recent checking code into SemaChecking instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d40e94d050670208ba3d9e7ffa59b5d7cb58ef0a 21-Jan-2010 Mike Stump <mrs@apple.com> Avoid instantiating std::sort to save on compiler size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
44fa21054574cf9e5f3a08c0b6a44f82aa5b44e4 21-Jan-2010 Mike Stump <mrs@apple.com> When checking for unreachable code, we can trivially avoid checking
for unreachable loops if all the blocks are already marked live by
this point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6bde1ae4b7e790691b3a8080a7f1a8fd8a943d3f 21-Jan-2010 Mike Stump <mrs@apple.com> When checking for unreachable blocks, we can trivially avoid extra
work, if we know we already marked all blocks as live.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
46460a68f6508775e98c19b4bb8454bb471aac24 20-Jan-2010 John McCall <rjmccall@apple.com> First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them.

Will actually consume this information soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e2ab979cf6b52efac3b6c5f121900ec57a34689c 20-Jan-2010 Mike Stump <mrs@apple.com> Improve CheckFallThrough analysis in the presense of the new C++ EH
support. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e39fe72df7da662c195ef4bcd542d58ec87d5422 19-Jan-2010 Douglas Gregor <dgregor@apple.com> When looking up enumerator names for redeclaration, use the
ForRedeclaration flag so that we don't look into base classes.
Fixes PR6061.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5d52e47ed6a4f920723ebec371594a3fe7878d7c 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Partial fix for PR6022, where we were complaining when a friend
function template declared within a class template did not match a
function in another scope. We really need to rework how
friends-in-templates are semantically checked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
823000cdeeb2deb861dd92463d739c1e71fea5d2 16-Jan-2010 Mike Stump <mrs@apple.com> Generalize handling for unreachable code warnings to all binary operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8eae0907c5094b8af61e26b8b809baf3c1ba75c8 16-Jan-2010 Mike Stump <mrs@apple.com> Refine location reporting for unreachable code warnings for comma expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a609f56ab5cc680ee778174665fe6c66a5160dd6 15-Jan-2010 Mike Stump <mrs@apple.com> Refine unreachable warnings. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7d3f576dc9ea6e866757abcd1736eb7e7433c325 15-Jan-2010 Douglas Gregor <dgregor@apple.com> When performing qualified name lookup into the current instantiation,
do not look into base classes if there are any dependent base
classes. Instead, note in the lookup result that we couldn't look into
any dependent bases. Use that new result kind to detect when this case
occurs, so that we can fall back to treating the type/value/etc. as a
member of an unknown specialization.

Fixes an issue where we were resolving lookup at template definition
time and then missing an ambiguity at template instantiation time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8a3da0fb0a6fddc1cc0cc2f04c69f39c6b96b8de 14-Jan-2010 Chris Lattner <sabre@nondot.org> fix grammaro


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9edad9b6184c730a73dc9241c043ea3bae54189f 14-Jan-2010 Douglas Gregor <dgregor@apple.com> When qualified lookup into the current instantiation fails (because it
finds nothing), and the current instantiation has dependent base
classes, treat the qualified lookup as if it referred to an unknown
specialization. Fixes PR6031.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b64cc58087b0874ed96ac76ebcf8d9006bd63282 14-Jan-2010 Mike Stump <mrs@apple.com> Don't assume a random access iterator, instead just use CFG::iterator.
Thanks Ted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cb4a4fb7810b46fd7d62f1f1e54299d2229cd8dc 14-Jan-2010 Mike Stump <mrs@apple.com> Avoid snowballing errors into additional warnings. To do better, we'd
need an error term for the CFG. I suspect we'll always have to cope
with getCFG returning 0, though, I'd love to see even that possibility
removed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
fa6ef180c0d3609124217387618fbb51bbdd2e48 13-Jan-2010 Mike Stump <mrs@apple.com> Add an unreachable code checker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
05f650001bc66c2dc238e7cee709cb7896bd8a37 11-Jan-2010 Douglas Gregor <dgregor@apple.com> C++0x [dcl.typedef]p4, take 3, where we actually figure out what "that
is not also a typedef-name" actually means. For anyone keeping score,
that's John: 2, Doug: 0.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
39700992bf99573983ff80fc519ec51fce0f0f61 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Use isa<ElaboratedType> rather than getAs<ElaboratedType>, since the
latter may (eventually) perform multiple levels of desugaring (thus
breaking the newly-added tests) and the former is faster. Thanks, John!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
93dda720a6f5b67ea997c8d98414f90ec362b43c 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Allow redefinitions of typedef-names within class scope when the type
they redefine is a class-name but not a typedef-name, per C++0x
[dcl.typedef]p4. The code in the test was valid C++98 and is valid
C++0x, but an unintended consequence of DR56 made it ill-formed in
C++03 (which we were luck enough to implement). Fixes PR5455.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
adda84683944e11820b9a03c6b170edd109289c5 06-Jan-2010 Douglas Gregor <dgregor@apple.com> Make sure that the key-function computation produces the correct
result for a nested class whose first non-pure virtual member function
has an inline body. Previously, we were checking for the key function
before we had seen the (delayed) inline body.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
1cd95e210b1b084ee275e0dfa9dd8a7e65b577d7 05-Jan-2010 Mike Stump <mrs@apple.com> Avoid warnings for functions that return a value using MS-style inline
assembly code. This avoids changing the bahvior when normal asm("")
statements are used.

The type of code affected would be:

void* t4(void) { __asm mov eax, fs:[0x10] }

I hope people like this version, if not, let me know.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f06cdae9c68dfc4191fbf6b9e5ea0fd748488d88 03-Jan-2010 Douglas Gregor <dgregor@apple.com> Implement typo correction for a variety of Objective-C-specific
constructs:

- Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
- Property name lookup ("foo.prop")
- Superclasses
- Various places where a class name is required
- Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
551f7087786d1a5e257f4e2a0999da8c709437fd 30-Dec-2009 Chris Lattner <sabre@nondot.org> when making a decl for __builtin_fabsf() make sure to
attach the appropriate attributes to it. I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
546be3c5c000626c8cdf65e32e8ed9b90c424edd 30-Dec-2009 Douglas Gregor <dgregor@apple.com> Typo correction for type names when they appear in declarations, e.g., given

tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
tring str2;
^~~~~
string


To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5126fd0dd92c4ec211c837ee78d5ce59c68dcbd5 30-Dec-2009 John McCall <rjmccall@apple.com> Typedefs can be redeclared. That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6675586c70945fdd71911d96f83324788b93edd4 24-Dec-2009 John McCall <rjmccall@apple.com> Tweak the text of several main() diagnostics and punch a hole specifically for
Darwin's sekrit fourth argument. This should probably be factored to
let targets make target-specific decisions about what main() should look like.

Fixes rdar://problem/7414990
or if different platforms have radically different ideas of what they want in



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f75b8309e3e40290683e3d34bac3a04e88d9c625 24-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> allow the noreturn attribute to be used in class methods

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
0f0615bba035f5aeaed0960d5a7802dff42f4b60 21-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5840: fix the kind of name lookup used for classes in
Sema::getTypeName.

"LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though;
it doesn't ignore namespaces. Someone more familiar with the lookup code
should fix this properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dd4e485a0db4e651f28281cd3eda93aad6ee04fd 20-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure we instantiate the destructor for variables initialized by
assignment.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
947f633616bf2239cf0d03598a85d90f1e36664b 20-Dec-2009 Douglas Gregor <dgregor@apple.com> Revert accidental commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
04f81b1fa04c02809a303d34ee6b19149d5aa29f 20-Dec-2009 Douglas Gregor <dgregor@apple.com> Fix CMake build on windows, from Cedric Venet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f9368159334ff86ea5fa367225c1a580977f3b03 20-Dec-2009 John McCall <rjmccall@apple.com> Don't inject the class name until that magical lbrace.

Because of the rules of base-class lookup* and the restrictions on typedefs, it
was actually impossible for this to cause any problems more serious than the
spurious acceptance of
template <class T> class A : B<A> { ... };
instead of
template <class T> class A : B<A<T> > { ... };
but I'm sure we can all agree that that is a very important restriction which
is well worth making another Parser->Sema call for.

(*) n.b. clang++ does not implement these rules correctly; we are not ignoring
non-type names



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
0dd7ceb72cc369195d698ccc26c70ac0e56ab945 19-Dec-2009 John McCall <rjmccall@apple.com> Don't use EnterDeclaratorContext when rebuilding a type in the current
instantiation, since we're not using a Scope object for that anyway.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1d7c52803e49d651a66cee782e264f62078c1da5 18-Dec-2009 John McCall <rjmccall@apple.com> Pull Sema::isAcceptableLookupResult into SemaLookup. Extract the criteria into
different functions and pick the function at lookup initialization time.
In theory we could actually divide the criteria functions into N different
functions for the N cases, but it's so not worth it.

Among other things, lets us invoke LookupQualifiedName without recomputing
IDNS info every time.

Do some refactoring in SemaDecl to avoid an awkward special case in LQN
that was only necessary for redeclaration testing for anonymous structs/unions ---
which could be done more efficiently with a scoped lookup anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
29da559b62d229f067a5b1851e438561dcbfd9bd 17-Dec-2009 Mike Stump <mrs@apple.com> Revert r91073.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0a8bab019dbf980911fbefa56d7debd648b7b239 17-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> implement PR3962: diagnose more faulty cases of usage of the restrict qualifier. this also removes a FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b23f20d72021548c812ddc81b91bf7ad78fe708c 17-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> revert part of my last patch, and mark only the c++ global new operator as noalias. the rest will be infered by llvm optz

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2aaad63ec5d012e6de40f72e114c60df9c205a24 16-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure C-specific enum warning doesn't trigger in C++.



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

feel free to chage the name to this lengthy argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
3ee77640c722a70ab7e0181f36dc2af21cab3d23 15-Dec-2009 Mike Stump <mrs@apple.com> This patch should fix PR2461. It allows clang to apply the noreturn
attribute to function pointers. It also fixes Sema to check function
pointers for the noreturn attribute when checking for fallthrough.

Patch by Chip Davis, with a slight fix to pass the testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ed0716b7b79d8cdef34f3bd35776a91aa3c943e5 11-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix the handling of dependent enums per C++ DR 502.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c9875bfa6ffecc8d8316820e2970cf7354f610d2 10-Dec-2009 Mike Stump <mrs@apple.com> Don't complain about falling off the end of a function with an asm
block, if the function is supposed to return a value as we don't know
exactly what the asm code does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
29a7f3342c3c6dd15d914c61ae22246c36d51ce7 10-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Clean up enum constants so that they're finally sane. Fixes PR3173 and a
recently introduced crash.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
153c33ed957b135a366178c61bbe22b6b1362a2a 10-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5515: allow "merging" array bounds both forwards and backwards.



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

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




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
63fb6737e7488e3af85c822d4d030663e2b4feaf 09-Dec-2009 Anders Carlsson <andersca@mac.com> Don't warn about function templates or function template specializations.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9f89dd783d9abb9539bd7e952e5823301415c076 09-Dec-2009 Anders Carlsson <andersca@mac.com> Move the missing prototypes checking out into a new function. Don't warn about inline functions. Add a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6bc20135a2c46f97da15994095616a305be35c6a 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5710: make sure to put function template specializations into the
DeclContext, so they don't completely disappear from the AST.

I don't particularly like this fix, but I don't see any obviously better way
to deal with it, and I think it's pretty clearly an improvement; comments
welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
721e77db41cd9a07d2e1c9fdf08a4bd2eee1bc98 07-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Move RequireCompleteType requirement for fields early into ActOnField so that
subsequent code which depends on a complete type does the right thing.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3527225899adf04e7b966e533da72e4550f9c7e5 06-Dec-2009 Anders Carlsson <andersca@mac.com> Pass the desired vtable linkage to GenerateVtable directly. Only call MaybeMarkVirtualImplicitMembersReferenced for non-inline functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5c478cf2d54157062cd843737324e0d0df03a464 04-Dec-2009 Anders Carlsson <andersca@mac.com> Diagnose declarations of implicit member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3aaf486af649d6be464e6b937c8181529ffef931 04-Dec-2009 Anders Carlsson <andersca@mac.com> Make sure that overridden method decls are always canonical.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5023437f5a897d513c08ddf64b74d688252a23e5 04-Dec-2009 John McCall <rjmccall@apple.com> When recovering from an invalid forward reference to an enum type in C++,
create the enum type in the same scope as you would a record type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e7184df728bb339633d88c774b5097dd9318cc8a 03-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> A new helper function to set various bits in the class when
a new virtual function is declared/instantiated. it is used
in couple of places.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0bd6feb9e9d40fc889fd47e899985125a43dfed8 02-Dec-2009 John McCall <rjmccall@apple.com> Push overloaded function templates through the parser using a totally different
leaked data structure than before. This kills off the last remaining
explicit uses of OverloadedFunctionDecl in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5fcf1f0df06e72581647efd579f970378f77eb55 02-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix another "operator delete missing" crash: make sure we don't check
isVirtual() before we've actually calculated whether the destructor is
virtual.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6342c06356976508525145a6ba433d05f893171 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Funtion templates and function template specializations do not
override virtual functions. Also, eliminate a (now redundant) call to
AddOverriddenMethods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d3a505827fd8775ce479498e5726b484336eedd8 01-Dec-2009 Douglas Gregor <dgregor@apple.com> An inherited virtual (where "virtual" wasn't written explicitly) can
be defined as pure. Fixes PR5656.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7dafdf51176d2f52e3a27f1ef70161ea2133ff52 30-Nov-2009 John McCall <rjmccall@apple.com> Remove all of Sema's explicit uses of OverloadedFunctionDecl except for
those associated with TemplateNames.



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bb377edda2656752016a0bc01fe4f9f8b6f80e19 30-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRef in Attr constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3e518bda00d710754ca077cf9be8dd821e16a854 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f4fdd9b58cdfc4c9d375fbc918418023d72f4267 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Fix 80-cols violations


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1a68972b541025ee3cc5197cda672bf2d6097d6d 27-Nov-2009 Anders Carlsson <andersca@mac.com> Fix thinko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
954968034e801906ec7c0461c36540bbb6d21161 26-Nov-2009 Anders Carlsson <andersca@mac.com> Correctly find overridden destructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
369a3bd9979cf529eed529aa037de713c213e47d 26-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
13dcd00615de5c4279d97bdf63cd5f0a14fd9dcc 21-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:

Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.

Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
f6e6fc801c700c7b8ac202ddbe550d9843a816fc 20-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement C++ [basic.lookup.classref]p3, which states how the type
name 'T' is looked up in the expression

t.~T()

Previously, we weren't looking into the type of "t", and therefore
would fail when T actually referred to an injected-class-name. Fixes
PR5530.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
a165da09c0313309d2d4dda42d0b2d4096a372a1 18-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Track overriding methods when instantiating a template class. Fixes PR5550.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
1f126bd18c85ea129c3897f8729cebb090917d01 15-Nov-2009 Anders Carlsson <andersca@mac.com> Deallocation functions must also be static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
67bf2e7706b82d5debd5c189d9454130df7db0d8 15-Nov-2009 Anders Carlsson <andersca@mac.com> allocation functions are always static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d5b57281cc3c652e9bbdbab45fbc199e29686377 15-Nov-2009 Douglas Gregor <dgregor@apple.com> If any errors have occurred by the time we hit the end of a function body, clear out any remaining temporaries so they aren't seen later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
49e2b8e2e5d096851b5135ea5aed222e8aa95bde 14-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5489: don't skip the complete type requrirement for variable
definitions just because the type happens to be an array type.



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

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


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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9770ef0eea1dbebb9cad93b8a564bff789568e62 08-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> When checking the namespace of a redeclaration or definition, look through linkage specs. Fixes PR5430.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f7613d53619d11f46fb07ddb0ea90c9fb0cad027 07-Nov-2009 Anders Carlsson <andersca@mac.com> Don't treat variables with non-trivial ctors or dtors as unused. Fixes PR5407.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
99a000e3ca7224cd70a2e87cc2751d78595c97f5 07-Nov-2009 Anders Carlsson <andersca@mac.com> Cleanup, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4912c347ce83e908c8a1a585260a32072eaf4ec6 06-Nov-2009 Douglas Gregor <dgregor@apple.com> Make sure that EnumConstantDecls always get a type, even when they have type-dependent initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6e8247556807ecaaac470852222762db998a05b2 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Don't allow definitions of array variables without some size information in C++. Fixed PR5401

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
54abf7d4fa3123b8324c09d2a4dfb789fd818403 04-Nov-2009 John McCall <rjmccall@apple.com> Change our basic strategy for avoiding deprecation warnings when the decl use
appears in a deprecated context. In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C. If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.




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

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



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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
0130f3cc4ccd5f46361c48d5fe94133d74619424 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cf57d615259debd91b649c939468b2d6be299ebc 27-Oct-2009 Mike Stump <mrs@apple.com> Almost missed this one... Doc update for last change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1d7e767dc8700724b7534a8640596c6a13baf3a7 27-Oct-2009 Mike Stump <mrs@apple.com> Refine noreturn handling. Fixes -Wmissing-noreturn so that it doesn't
complain that functions that have a return statement should be
declared noreturn. Fixed PR5286.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
776229180339d9e91246cefa0fa324d7ab0304e4 27-Oct-2009 Ted Kremenek <kremenek@apple.com> Use a pred_iterator instead of a succ_iterator (wrong typedef).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7a128e84006fdabfda4b8bd04f09c2739ed7f824 25-Oct-2009 Chris Lattner <sabre@nondot.org> Fix PR5298 - -Wmissing-noreturn shouldn't warn if the function is already
declared noreturn.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
38fd4d001182b0b125a42c3b7e83e9dbac50e8a5 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make sure we actually have a definition before asking if it is implicit. Fixes PR4674.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d451f836be2d2839f6ac87181c5a52f4f6be397e 25-Oct-2009 Chris Lattner <sabre@nondot.org> When parsing a top level struct declaration, make sure to
process decl attributes instead of dropping them on the floor.
This allows us to diagnose cases like the testcase. Also don't
diagnose deprecated stuff in ActOnTag: not all uses of tags
may be 'uses', and SemaType does this now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a64ef0ab5cb6ac9cfb7d40661a9152c4aa488386 25-Oct-2009 Chris Lattner <sabre@nondot.org> move calls to DiagnoseUseOfDecl (which warns about deprecated/unavailable
types) out of Sema::getTypeName into ConvertDeclSpecToType. getTypeName
is sometimes used as a predicate in the parser, so it could cause redundant
diags to be emitted. This is also needed by two upcoming enhancements.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
10ca337b1e3684547bd21021a23a566f30fa83b4 25-Oct-2009 Chris Lattner <sabre@nondot.org> simplify Sema::getTypeName a bit: if control gets out of the switch,
IIDecl cannot be null. There is no need to check for both C++ mode and
presence of CXXRecordDecl. ObjC interfaces can't have ScopeSpecs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b7c3fd7b493329550c29dec11d31aca4d537e23e 25-Oct-2009 Chris Lattner <sabre@nondot.org> In objc mode, every identifier in a cast expression was using doing a
type looking using getTypeName() and every property access was using
NextToken() to do lookahead to see if the identifier is followed by
a '.'. Rearrange this code to not need lookahead and only do the
type lookup if we have "identifier." in the token stream. Also
improve a diagnostic a bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
ba6a9bd384df475780be636ca45bcef5c5bbd19f 24-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
58e4677a948e80c92deeebbcd3bdd9266adda798 23-Oct-2009 John McCall <rjmccall@apple.com> Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation. This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eb692e07c71be22d06d38c83ad081a3808bd7f2a 23-Oct-2009 John McCall <rjmccall@apple.com> Preserve source information for anonymous struct/union declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cd6cdeb7d15af731d1d06d9aee4190713f59e8d7 21-Oct-2009 Ted Kremenek <kremenek@apple.com> Add FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
73c39abdbb79927605d740c93dd9629e3e4f9bfe 20-Oct-2009 Eli Friedman <eli.friedman@gmail.com> Remove default argument for ImpCastExprToType. Add appropriate argument
to all callers. Switch a few other users of CK_Unknown to proper cast
kinds.

Note that there are still some situations where we end up with
CK_Unknown; they're pretty easy to find with grep. There
are still a few missing conversion kinds, specifically
pointer/int/float->bool and the various combinations of real/complex
float/int->real/complex float/int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
01eb9b9683535d8a65c704ad2c545903409e2d36 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5ffe14ca96bd662de7820f6875d3f04789a640c1 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
- OS.write(II->getName() ...) -> OS << II->getNameStr()
- Avoid std::string concatenation
- Use getNameStr().str() when an std::string is really needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d75191f0d100b596281f99ea8f2f0a0d0560d969 17-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> In some dependent contexts, incomplete array types persist into FinalizeDeclaratorGroup. Don't require them to have a complete type. This allows us to compile Hello World with the Apache stdcxx library. If you don't use endl, it even links and runs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5460d2b51965a53c5db537d432988f5e1d20af6f 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Simplify.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a786fdbf6c1d8ff08c3e61c7eb6bf2872895e2b4 14-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostics when the parser encounters a declarator with an
unknown type name, e.g.,

foo::bar x;

when "bar" does not refer to a type in "foo".

With this change, the parser now calls into the action to perform
diagnostics and can try to recover by substituting in an appropriate
type. For example, this allows us to easily diagnose some missing
"typename" specifiers, which we now do:

test/SemaCXX/unknown-type-name.cpp:29:1: error: missing 'typename'
prior to dependent type name 'A<T>::type'
A<T>::type A<T>::f() { return type(); }
^~~~~~~~~~
typename

Fixes PR3990.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
fd056bc86a8b22a9421b5d921bbca276d0f9d0f7 13-Oct-2009 Douglas Gregor <dgregor@apple.com> When explicitly specializing a member that is a template, mark the
template as a specialization. For example, this occurs with:

template<typename T>
struct X {
template<typename U> struct Inner { /* ... */ };
};

template<> template<typename T>
struct X<int>::Inner {
T member;
};

We need to treat templates that are member specializations as special
in two contexts:

- When looking for a definition of a member template, we look
through the instantiation chain until we hit the primary template
*or a member specialization*. This allows us to distinguish
between the primary "Inner" definition and the X<int>::Inner
definition, above.
- When computing all of the levels of template arguments needed to
instantiate a member template, don't add template arguments
from contexts outside of the instantiation of a member
specialization, since the user has already manually substituted
those arguments.

Fix up the existing test for p18, which was actually wrong (but we
didn't diagnose it because of our poor handling of member
specializations of templates), and add a new test for member
specializations of templates.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
37d68185088947322a97eabdc1c0714b0debd929 13-Oct-2009 Douglas Gregor <dgregor@apple.com> Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b3ae4fcd4314a9c1c46d41b200883599c32025b4 12-Oct-2009 Douglas Gregor <dgregor@apple.com> Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6e24726524c2b51b31bb4b622aa678a46b024f42 10-Oct-2009 John McCall <rjmccall@apple.com> Qualified lookup through using declarations. Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum. Tests
for most of C++ [namespace.qual].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b5352cf949898cd42c8c5bc96a17a831b61ac2e5 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement support for -Wunused-variable, from Oscar Bonilla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9916a047c55ea18845d706bf95e7517b646933d0 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Add more testing for the properties of explicit specialization.

Also, eliminate a redundant diagnostic by marking a variable declared
with incomplete type as an invalid declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
741fab61570f145a52b808a6824841c41e892c28 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Don't complain about out-of-line explicit specializations of member
function and member function templates that are not definitions. Add
more tests to ensure that explicit specializations of member function
templates prevent instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f6b1185f0a8a209c06dfc1efdb6a59cc851e970c 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
251b4ff2578e26959a4c036140ccd61c5e9292f2 08-Oct-2009 Douglas Gregor <dgregor@apple.com> For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1fef4e60e7e884803977a8376c172ea584f8a5d1 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Type checking for specializations of member functions of class
templates. Previously, these weren't handled as specializations at
all. The AST for representing these as specializations is still a work
in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1be8aee8745e8b814ad2f151aa214b0ef07833db 02-Oct-2009 Douglas Gregor <dgregor@apple.com> When the return type of a function is dependent, don't perform any
of the flow-control checks for falling off the end of a function,
since the return type may instantiate to void. Similarly, if a
return statement has an expression and the return type of the function
is void, don't complain if the expression is type-dependent, since
that type could instantiate to void.

Fixes PR5071.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
27a84d01614609c094029a49f7a86f0f7f8fe7f1 30-Sep-2009 Tanya Lattner <tonic@nondot.org> Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9a8c9a2eacd80437f18edb339a37516ab7e773cd 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Provide a custom diagnostic when code tries to use an unknown builtin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d04b1be7d3015a307f93eea0b9ab0ecce612951e 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Make sure that out-of-line function and variable definitions are not
pushed into scope. Fixes PR5056.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2531c2d2f1e8ce35f2ce8e9539738ddf8dccb7cc 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Teach Sema::isDeclInScope to handle overload sets constructed from
functions that occur in multiple declaration contexts, e.g., because
some were found via using declarations. Now, isDeclInScope will build
a new overload set (when needed) containing only those declarations
that are actually in scope. This eliminates a problem found with
libstdc++'s <iostream>, where the presence of using

In the longer term, I'd like to eliminate Sema::isDeclInScope in favor
of better handling of the RedeclarationOnly flag in the name-lookup
routines. That way, name lookup only returns the entities that matter,
rather than taking the current two-pass approach of producing too many
results and then filtering our the wrong results. It's not efficient,
and I'm sure that we aren't filtering everywhere we should be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
0b60d9e0097e2d6a1a5e62396967e207c4a772f2 26-Sep-2009 Douglas Gregor <dgregor@apple.com> Use explicitly-specified template argument lists to help naming
explicit template specializations, when available.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
db422dffb720ff41d0b60e228f45c685600ffa9e 25-Sep-2009 Douglas Gregor <dgregor@apple.com> Declarators can now properly represent template-ids, e.g., for

template void f<int>(int);
~~~~~~
Previously, we silently dropped the template arguments. With this
change, we now use the template arguments (when available) as the
explicitly-specified template arguments used to aid template argument
deduction for explicit template instantiations.



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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
2c59d3c19715cb318a0a5939c735b8345d14d281 13-Sep-2009 Anders Carlsson <andersca@mac.com> Perform the C++ specific semantic checks of a function declaration after it's been merged with the previous declaration. This ensures that getPreviousDecl() will have the right value when ActOnConversionDeclarator is called.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1fc09a92d0bffda20e06fa882388c01e192e2069 13-Sep-2009 Douglas Gregor <dgregor@apple.com> Rework the way we determine whether an externally visible symbol is
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7814e6d6645d587891293d59ecf6576defcfac92 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
48a83b5e7ae4051c7c11680ac00c1fa02d610a62 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Remove unnecessary ASTContext parameters from isMain and isExternC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c4e7019d5c9034a2d84ee4695f8e98dc025ac131 11-Sep-2009 John McCall <rjmccall@apple.com> Support elaborated dependent types and diagnose tag mismatches.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f8d8d1a99b802b8e9f2e7da441b64096b89f133d 10-Sep-2009 Douglas Gregor <dgregor@apple.com> Don't bother to perform any initialization for a variable declaration
of class type whose default constructor is trivial. Should un-break
testing on x86_64-pc-linux-gnu.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81405 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
8dfb7ec475ae0f3bdb631b426d981b328b38e470 09-Sep-2009 Douglas Gregor <dgregor@apple.com> Fix a thinko

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3dab34a7cb5e2ad9c2311fc44b3d3b7ebb540992 09-Sep-2009 Douglas Gregor <dgregor@apple.com> Allow a declaration of an array to complete a prior, incomplete
declaration of that array in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
63d65f873fdfcb04b216ea9c648d1df5992aed1c 08-Sep-2009 Chris Lattner <sabre@nondot.org> Fix PR4922, where Sema would complete tentative definitions in nondeterminstic
order because it was doing so while iterating over a densemap.

There are still similar problems in other places, for example
WeakUndeclaredIdentifiers is still written to the PCH file in a nondeterminstic
order, and we emit warnings about #pragma weak in nondeterminstic order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2191b20bfb31fc0e22a158f6b4204cd0b7dbd0fd 05-Sep-2009 John McCall <rjmccall@apple.com> Start emitting ElaboratedTypes in C++ mode. Support the effort in various
ways: remove elab types during desugaring, enhance pretty-printing to allow
tags to be suppressed without suppressing scopes, look through elab types
when associating a typedef name with an anonymous record type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f1bbbb49f06a7462476cd88166fccda5feb15cab 04-Sep-2009 John McCall <rjmccall@apple.com> Correctly handle elaborated template ids. Still not handled properly for friends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
82b9fb8e7a05066e690670d2eb386a624b04f684 02-Sep-2009 John McCall <rjmccall@apple.com> Borrow a friend class's previous declaration's access specifier regardless of
whether the current context is dependent.

Thanks to Anders for pointing this out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
53489322f6574413d906f6a4c66033223e6b1e3f 02-Sep-2009 John McCall <rjmccall@apple.com> When adding a friend class declaration to the lookup tables, use the access specifier
of any previous declaration in case we replace it in a class's declaration table.
Fixes bug 4858. This sort of thing makes me reconsider putting friend declarations in
declaration lists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d7eff68dbbbc6b3f8dfd44f6a833c2b320a96e9a 02-Sep-2009 John McCall <rjmccall@apple.com> Ensure that the tag decls of friend decls aren't added to the friending class's
decl list, and remove some workarounds that were due to this. Thanks to Eli for
pointing this out and providing the test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
203cb71998a39a9d01a29db135454a9e7f402235 29-Aug-2009 Anders Carlsson <andersca@mac.com> Add another check for UnresolvedUsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fdc39199c91e6246ac3f4da10eee96a369ce3e1a 29-Aug-2009 Douglas Gregor <dgregor@apple.com> Make sure we actually found a redeclaration before complaining about attributes added to a redeclaration in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
36ef0787532ef3ecfc8ecd5e9661f5b2f87a280f 28-Aug-2009 Anders Carlsson <andersca@mac.com> Check for UnresolvedUsingDecl when determining if a declaration is a redeclaration or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
56bea43ac127367e34a4732b20f4c8a4c6a5fe05 27-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Back out bad piece of r80272. Will look at fixing this a different way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c5c54f2c7bbc000dbcaee5e0acec2dbb0c0f0cf8 27-Aug-2009 Eli Friedman <eli.friedman@gmail.com> PR4794: Make instantiating friend class decls not crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d60e105e6d1624da647ef7dd35a9cf6fad1b763e 27-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement instantiation of the declarations of member function
templates within class templates, producing a member function template
of a class template specialization. If you can parse that, I'm
sorry. Example:

template<typename T>
struct X {
template<typename U> void f(T, U);
};

When we instantiate X<int>, we now instantiate the declaration
X<int>::f, which looks like this:

template<typename U> void X<int>::f(int, U);

The path this takes through
TemplateDeclInstantiator::VisitCXXMethodDecl is convoluted and
ugly, but I don't know how to improve it yet. I'm resting my hopes on
the multi-level substitution required to instantiate definitions of
nested templates, which may simplify this code as well.

More testing to come...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
42c39f39184c5ce9d7f489e5dcb7eec770728a9a 26-Aug-2009 Douglas Gregor <dgregor@apple.com> When we know that we are parsing a class-name, implicitly construct a
TypenameType if getTypeName is looking at a member of an unknown
specialization. This allows us to properly parse class templates that
derived from type that could only otherwise be described by a typename type,
e.g.,

template<class T> struct X {};
template<typename T> struct Y : public X<T>::X { };

Fixes PR4381.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dacd434c49658286c380c7b4c357d76d53cb4aa1 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostics and recovery when the nested-name-specifier of a
qualified name does not actually refer into a class/class
template/class template partial specialization.

Improve printing of nested-name-specifiers to eliminate redudant
qualifiers. Also, make it possible to output a nested-name-specifier
through a DiagnosticBuilder, although there are relatively few places
that will use this leeway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
495c35d291da48c4f5655bbb54d15128ddde0d4d 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Improve support for out-of-line definitions of nested templates and
their members, including member class template, member function
templates, and member classes and functions of member templates.

To actually parse the nested-name-specifiers that qualify the name of
an out-of-line definition of a member template, e.g.,

template<typename X> template<typename Y>
X Outer<X>::Inner1<Y>::foo(Y) {
return X();
}

we need to look for the template names (e.g., "Inner1") as a member of
the current instantiation (Outer<X>), even before we have entered the
scope of the current instantiation. Since we can't do this in general
(i.e., we should not be looking into all dependent
nested-name-specifiers as if they were the current instantiation), we
rely on the parser to tell us when it is parsing a declaration
specifier sequence, and, therefore, when we should consider the
current scope specifier to be a current instantiation.

Printing of complicated, dependent nested-name-specifiers may be
somewhat broken by this commit; I'll add tests for this issue and fix
the problem (if it still exists) in a subsequent commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
91cf4199cca311ea9c3b3a4e2b3984d508c9e5e3 25-Aug-2009 John McCall <rjmccall@apple.com> Modify an assert to capture the restriction on friend declarations more
accurately. Prevents the assert from triggering incorrectly when friending
functions first declared in extern "C" contexts. Fixes bug 4757.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
05396e20d68535612f58c84e0dfc7647c75a7da1 25-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement out-of-line definitions of nested class templates. Most of
the logic is there for out-of-line definitions with multiple levels of
nested templates, but this is still a work-in-progress: we're having
trouble determining when we should look into a dependent
nested-name-specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d83d04041f64a2c89123d227fa8003b482391279 22-Aug-2009 Douglas Gregor <dgregor@apple.com> Implement delayed parsing for member function templates. Fixes PR4608.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f6d6a228b0faafdfd1cdffe865f47616b6cab7a8 21-Aug-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> Reversing part of 79544.
Need to find a new way to do target specific semanitc checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
da3e03ec5d7161135bd90c0786421e8994bcc2f8 20-Aug-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> Issue an error if the user specifies parameters in a function marked as ISR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
82bf01061b97404fed8c422fc0eda0a380689cc9 20-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Keep track of the right paren ')' source location in a function declarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
0f436560640a1cff5b6d96f80f540770f139453f 17-Aug-2009 David Chisnall <csdavec@swan.ac.uk> Initial patch to support definitions of id and Class from headers in Objective-C code.

This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable. The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
07a5c22bb6fb0674c95205ae189365bf8e1b695e 15-Aug-2009 John McCall <rjmccall@apple.com> Disable all recognition of main() in -ffreestanding. Addresses bug #4720.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
3b2e16b3d25f6b311dba2871e2a566c96238c3d2 08-Aug-2009 Anders Carlsson <andersca@mac.com> Refactor some code and implement support for global destructors for static variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a860e755f1f9f071b6a6a2f96128a6a258f5c331 08-Aug-2009 Anders Carlsson <andersca@mac.com> Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).

This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fee13819693c8492f0c364bc704645e844ef737a 08-Aug-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Patch should implement packed enums - PR4098. Credit to Anders Johnsen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4a959d8788179d654df6b213b08d2b064989211d 06-Aug-2009 Douglas Gregor <dgregor@apple.com> When we encounter a dependent type that was parsed before we know that
we were going to enter into the scope of a class template or class
template partial specialization, rebuild that type so that it can
refer to members of the current instantiation, as in code like

template<typename T>
struct X {
typedef T* pointer;
pointer data();
};

template<typename T>
typename X<T>::pointer X<T>::data() { ... }

Without rebuilding the return type of this out-of-line definition, the
canonical return type of the out-of-line definition (a TypenameType)
will not match the canonical return type of the declaration (the
canonical type of T*).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
11b3a95d1698c033691fce6cd444201668ba3e0a 05-Aug-2009 Mike Stump <mrs@apple.com> Remove an unused header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
fec54013fcd0eb72642741584ca04c1bc292bef8 03-Aug-2009 John McCall <rjmccall@apple.com> Refactor methods on DeclSpec to take a diagnostic& parameter, and reflect this
elsewhere. Very slightly decouples DeclSpec users from knowing the exact
diagnostics to report, and makes it easier to provide different diagnostics in
some places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
7b1fdbda2757cc4a7f25664475be44119d7f8e59 31-Jul-2009 Ryan Flynn <pizza@parseerror.com> PR3679 - enable #pragma weak aliasing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0f434ecbead44c1f4d5f9dda088f9827fa0dc40f 31-Jul-2009 John McCall <rjmccall@apple.com> Rename Action::TagKind to Action::TagUseKind, which removes both a misnomer
and a name collision.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e25ff83fb7eee9eeda89b6f2371bc33a37bf1028 30-Jul-2009 Ryan Flynn <pizza@parseerror.com> PR3679 - handle #pragma weak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
f711c41dd9412a8182793259d355c4f6979ed5ed 29-Jul-2009 Mike Stump <mrs@apple.com> Some minor cleanups, thanks Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4d9d51ae3b868268082f94d84d0dff4c0b1ad435 29-Jul-2009 Mike Stump <mrs@apple.com> Add support for -Wmissing-noreturn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5692586ae59be8d49edd7b45dd52c1ffa920ba5e 29-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn support for blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
782fa308a765aeac2acb39c4e697c937ec21185b 28-Jul-2009 Mike Stump <mrs@apple.com> Make longjmp a real builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0cfeb63f532973777f6fe75d3468c3acad4adfe3 28-Jul-2009 John McCall <rjmccall@apple.com> Allow functions to be marked "implicit return zero" and so mark main().
Codegen by initializing the return value with its LLVM type's null value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
523a8fddefee7836d6317f6dc265acb4ee84a0d4 28-Jul-2009 Mike Stump <mrs@apple.com> Make sure to move the comment with the code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
773db1d4b5974a1849d0214900f5006f98adea5b 27-Jul-2009 Mike Stump <mrs@apple.com> Add knowledge about _longjmp being noreturn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fd350b5b4ae557d6b74899b945e77508f33149a9 27-Jul-2009 Mike Stump <mrs@apple.com> Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0feecbb3165b06ff34663a8c233316aaf7f84ce1 27-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn for exit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
478fbc68b1873678edfb2a3c420749635db100e6 26-Jul-2009 Ryan Flynn <pizza@parseerror.com> PR3575 - warn on declared variable or function attributes after a definition, which are currently ignored.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2455636163fdd18581d7fdae816433f886d88213 25-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn as a type attribute, handle printing for them and handle
calls to noreturn function pointers when CFG building.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
13591ed054d1b2d6d392151ba05cbc883e640648 25-Jul-2009 John McCall <rjmccall@apple.com> Semantic checking for main().

Fix some invalid main() methods in the test suite that were nicely
exposed by the new checks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8c4859ad8a60388f09d641b88f9444ccc6c2f31b 24-Jul-2009 John McCall <rjmccall@apple.com> Test commit: make a little stub routine for semantic checking of main().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5f28a1edf6decac64ca12e51ca4a929d26fc21f2 24-Jul-2009 Mike Stump <mrs@apple.com> Implement new warning for functions declared 'noreturn' when they fall off the end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766 24-Jul-2009 Douglas Gregor <dgregor@apple.com> This patch fixes the implementations of the __has_trivial_destructor
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
79a1411a4cc4d4efdbb90da6b4eb034371bcc2e8 24-Jul-2009 Mike Stump <mrs@apple.com> Some cleanups suggested by Daniel.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bd1099efde211cbb63fce3feee4ebcc6bac58781 23-Jul-2009 Douglas Gregor <dgregor@apple.com> Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.

Removed the ActOnClassTemplate action, which is no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1f15e768983a614e45c3ca01df1ddb3339e746dd 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Use llvm::BitVector instead of managing memory by hand.
- As it happens, this also fixes a use-of-uninitialized memory that was causing
non-deterministic test failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
10e975c9a31461b7b5c32725d749a7c6d9b88efa 23-Jul-2009 Mike Stump <mrs@apple.com> Fix case, apparently some people still build on case sensitive
filesystems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b1682c50d26e0f12130d35b7b9b77d40542c4540 23-Jul-2009 Mike Stump <mrs@apple.com> Add warning for falling off the end of a function that should return a
value. This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall). I believe there should be very few false positives, though
the most interesting case would be:

int() { bar(); }

when bar does:

bar() { while (1) ; }

Here, we assume functions return, unless they are marked with the
noreturn attribute. I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.

If anyone spots other false positives, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7cdbc5832084f45721693dfb1d93284c3e08efee 23-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement support for out-of-line definitions of the class members of class
templates, e.g.,

template<typename T>
struct Outer {
struct Inner;
};

template<typename T>
struct Outer<T>::Inner {
// ...
};

Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.

There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
27eeb5ef469a83b8b374ee29cd530ee8ab911fc1 23-Jul-2009 Douglas Gregor <dgregor@apple.com> Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the order of evaluation of their arguments to be correct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
dfe3f2d8ba49f03d01f42570e640d9a6755e6c08 22-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement parsing and semantic analysis for out-of-line definitions of static
data members of class templates. We don't instantiate the definitions yet,
however.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f59a56e180bf54528d7d1d5afa68fcc13300965a 22-Jul-2009 Douglas Gregor <dgregor@apple.com> Basic parsing and semantic analysis for out-of-line definitions of the
member functions of class templates, e.g.,

template<typename T>
struct X {
void f(T);
};

template<typename T> X<T>::f(T) { /* ... */ }



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
c19f959d7fa5303f2fff5fa7a4968361cb7ef068 21-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose when a destructor uses a unrelated class type as its name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
741dd9a7e1d63e4e385b657e4ce11c5d96d44f72 21-Jul-2009 Douglas Gregor <dgregor@apple.com> Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ec820c6bc49aef01767b5810e765bba853909ef8 20-Jul-2009 Douglas Gregor <dgregor@apple.com> When a field is variable-sized or is an array with a negative size,
don't replace the type of the field with 'int', from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ec8b59ffc30c65051070e6d6cbb8e4b419210d18 20-Jul-2009 Douglas Gregor <dgregor@apple.com> Improve GCC compatibility by allowing static tentative definitions of
incomplete type (with a warning), from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
be6d259a375bbec49659d54a302c4758058f2eef 19-Jul-2009 Chris Lattner <sabre@nondot.org> enhance the goto checker to reject jumps across __block variable definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a2e85ada1dfef36201a31f6646bc4ea3bd76a89a 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ea218b8e8f9ba82d1c76bcb7e86d121a5f65ebed 14-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9bedef6ae106f94b2edd3ec19bd5927d390d4fa4 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fixes for a couple of things:

- Declaration context of ParmVarDecls (that we got from the Declarator) was not their containing function.
- C++ out-of-line method definitions didn't get an access specifier.

Both were exposed by a crash when emitting a C++ method to a PCH file (assert at Decl::CheckAccessDeclContext()).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
07a5b282fbe719986df9ed05543081ea0ed94aa5 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pass the right brace SourceLocation from the Parser to the TagDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
430ee5a4fd20c02e59d6a0d720401a5f21e4e5c1 13-Jul-2009 Steve Naroff <snaroff@apple.com> Fix 5 issues from Chris's feedback on http://llvm.org/viewvc/llvm-project?view=rev&revision=75314.

Still more to come...just wanted to get the no-brainers out of the way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6a75cd9c1d54625fca7b5477ab9545bcdbd85ea4 11-Jul-2009 Anders Carlsson <andersca@mac.com> Implement more of C++0x 'auto'. A variable with an auto type specifier must have an initializer. Also, move some tests around to match the C++0x draft better.

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

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
082b02e8403d3ee9d2ded969fbe0e5d472f04cd8 08-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6bec78d58b2fa73939c9cc16543c14433f004d5a 07-Jul-2009 Douglas Gregor <dgregor@apple.com> Tighten up the conditions under which we build an implicit function
declaration for a builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c29f77b769bcc5b6dc85e72c8e3cc2e348e5cf25 07-Jul-2009 Douglas Gregor <dgregor@apple.com> Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.



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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
16f19306f9dd24cdc397ceae89a73a55086e5127 25-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Set the end range location of a FunctionDecl to the right paren.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
52591bf224b2c43e2b00e265bb8599a620081925 24-Jun-2009 Douglas Gregor <dgregor@apple.com> Make sure that the template parameter lists get from the parser down to ActOnFunctionDeclarator for function template definitions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e98da2e7af16056a53db327b520d4b53b4be5e7a 24-Jun-2009 Anders Carlsson <andersca@mac.com> Support for [class.local]p4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c5c903acd805581dc7ef881f7cb8df38afca4468 24-Jun-2009 Douglas Gregor <dgregor@apple.com> When declaring a function template, create a FunctionTemplateDecl node
and associate it with the FunctionDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e542c862bdf9a9bcb4f468be8fa6561372430611 24-Jun-2009 Douglas Gregor <dgregor@apple.com> Start propagating template parameter lists to the right places to
handle function templates. There's no actual code for function
templates yet, but at least we complain about typedef templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2e01cdacc5ecab5a14329405dc481a18ac3ccfdc 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Eliminate DeclPtrTy() arguments to ActOnDeclarator that are just a very, very weird way to pass "false". No functionality change

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c19ee3eb08ce1d77504d5fc27f7c44b94543221b 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Diagnose class members that shadow a template parameter. Fixes
<rdar://problem/6952203>.

To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
179fe1a47dce4fe7fee39c55c1e9421464da8cdf 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix some erroneous comments due to trigger-happy copy&paste.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
f5cecfbdcd20be224861f9e67c5973a9a2b61512 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
86df27bbdbb98c39ec2184695c0561209f91bedd 14-Jun-2009 Chris Lattner <sabre@nondot.org> move GetBuiltinType from Builtin::Context to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d7dad72aa5d98194dc19601a435765c94444ba3b 10-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4350: Make sure we don't create invalid printf attributes. This isn't
visible anywhere normally because the printf format checks for
this case, and we don't print out attribute values anywhere. Original
patch by Roberto Bagnara.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
496b5a894c5ec5425de53909f5aac3fb4771a2ec 05-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use of DeclContext for objc's ivars. No functionality
change. More to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dec7c76981a4624b6f40f2bf2375b174d1e90039 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Address review comments for #pragma weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c49f19b6d39c5de71755a4be7c41f835c3e132f8 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Start of a Sema implementation for #pragma weak. This isn't really the
right approach, but I'm still not sure what the best way to go about this is.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
340a4e500f7a3952e7e72265c977711e504c69c7 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix up this compatibility hack to be more compatible with gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bc4e29f307f86ddbc2f31d9530da79ad9b0c6b7b 01-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4287: allow a variadic prototype to make a subsequent K&R style
definition variadic. I'm not completely sure it's legal, but the
standard can be interpreted as making it legal, and gcc seems to think
it's legal, so I didn't add an extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3cc9726a493d90bd8faf094986a59352fd3461cb 31-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Disallow exception specs on typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f5dcd3885865c931fdbd16f36237af70743d53c6 30-May-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl needs to take a full expression.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d12ef8d142868889867f9dd968b5f3ea02d463c1 30-May-2009 Anders Carlsson <andersca@mac.com> Add a member lookup criteria constructor for searching for overridden virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4fe0c8e9c76b96e7aff21696a40dacc09d0237bc 30-May-2009 Douglas Gregor <dgregor@apple.com> Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ef65f06e8e440aec541442cfd73a8a836e9bc842 29-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reject incomplete types in exception specs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8e92bf33baa91a8d97cbd4859648af149d5b5e74 29-May-2009 Douglas Gregor <dgregor@apple.com> Now that we have declared/defined tag types within DeclGroups,
instantiation of tags local to member functions of class templates
(and, eventually, function templates) works when the tag is defined as
part of the decl-specifier-seq, e.g.,

struct S { T x, y; } s1;

Also, make sure that we don't try to default-initialize a dependent
type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c1dc653b08226c1d8e1732f9d8b03b82869900bc 29-May-2009 Eli Friedman <eli.friedman@gmail.com> If a declarator group declares a type, make sure to add that declaration
to the DeclGroup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
402abb55fc2e0cdda5fb1ac90009b1f5f6774906 29-May-2009 Douglas Gregor <dgregor@apple.com> When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:

1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.

2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,

struct Point { int x, y, z; } p;

This will help improve AST printing and template instantiation,
among other things.

3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,

int bar(struct T2 { int x; } y) {
struct T2 z;
}

We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:

(struct S { int x, y; } *)0





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d0c873799614d32c9c11280878ac1a856f92f707 27-May-2009 Douglas Gregor <dgregor@apple.com> Add some more tests for instantiation of declaration references. Also,
improve some error recovery with explicit template instantiation.



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
52b2fe2d70d83f73ee59e9ad3d0ba8ac154acfda 18-May-2009 Douglas Gregor <dgregor@apple.com> Simplify struct/class tag mismatch warning, per Sebastian's suggestion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
758a422bc1af68f64f7f86ef4aad958148a89e97 17-May-2009 Anders Carlsson <andersca@mac.com> Add OldMD to the list of methods NewMD overrides

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
425bfdee21d7ce13799bb7f9d74805a2d5775762 17-May-2009 Anders Carlsson <andersca@mac.com> Fix another case where the extern-ness of extern "C" wasn't being captured.

This makes me think that we should make hasExternalStorage perform this check...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
88d936b245978038a14b9c7acc062d12bc46096a 16-May-2009 Eli Friedman <eli.friedman@gmail.com> Avoid calling mergeTypes in C++. I think these are the correct C++
alternatives, but please correct me if I'm wrong.

I eventually plan to assert in mergeTypes that we aren't in C++ mode
because composite types are fundamentally not a part of C++. The
remaining callers for code in the regression tests are
Sema::WarnConflictingTypedMethods and CodeGenFunction::EmitFunctionProlog;
I'm not quite sure what the correct approach is for those callers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
88f7b576dde22ca95b4c73c4fd463e2e799873a7 16-May-2009 Eli Friedman <eli.friedman@gmail.com> PR2044: reject declarations of functions returning variably modified
types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c6e35aae23bc3cea7daf5ee075fa695c01c0f66f 16-May-2009 Mike Stump <mrs@apple.com> Implement a FIXME, we now pass in the locations of the braces for enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e2c31ff0bc622e6fd7d47d7e08b53840f3be6c89 15-May-2009 Douglas Gregor <dgregor@apple.com> Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
instantiating the definition of a function from a template.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
77b7f1d4fb782c9152f91b76f9f8b1d1af21bd35 15-May-2009 Anders Carlsson <andersca@mac.com> Check that the function being overridden is virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a75e8534f2b7c2480c48f31f301bd00b241c5499 14-May-2009 Anders Carlsson <andersca@mac.com> Improvements to the FunctionDecl getters/setters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
501c5ce63c2ff54c103fbab8c1c45234d5a82a57 14-May-2009 Douglas Gregor <dgregor@apple.com> In C++, warn when something previously declared as a "struct" is later
declared as a "class", or vice-versa. This warning is under the
control of -Wmismatched-tags, which is off by default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
3f5b61c394f4f205bcb4d316eb2a7a0a68b8af86 14-May-2009 Douglas Gregor <dgregor@apple.com> Implement explicit instantiations of member classes of class templates, e.g.,

template<typename T>
struct X {
struct Inner;
};

template struct X<int>::Inner;

This change is larger than it looks because it also fixes some
a problem with nested-name-specifiers and tags. We weren't requiring
the DeclContext associated with the scope specifier of a tag to be
complete. Therefore, when looking for something like "struct
X<int>::Inner", we weren't instantiating X<int>.

This, naturally, uncovered a problem with member pointers, where we
were requiring the left-hand side of a member pointer access
expression (e.g., x->*) to be a complete type. However, this is wrong:
the semantics of this expression does not require a complete type (EDG
agrees).

Stuart vouched for me. Blame him.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
01ad39e42de07f9a81fba986e6a045a3904ef7a9 13-May-2009 Chris Lattner <sabre@nondot.org> eli correctly points out that this code is dead, just rip it out for
now until someone does it right


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4d9a16f36d3b768672d50e6d02000f982ae448d7 13-May-2009 Douglas Gregor <dgregor@apple.com> Implement parsing for explicit instantiations of class templates, e.g.,

template class X<int>;

This also cleans up the propagation of template information through
declaration parsing, which is used to improve some diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d4b19d52416c3a04a1740ab5e766d9537c8ea00e 12-May-2009 Chris Lattner <sabre@nondot.org> improve the diagnostic for uses of the GCC "global variable in a register" extension.
This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0afeaa3ff83d88c52bf785825d6bab8848f44772 12-May-2009 Chris Lattner <sabre@nondot.org> Method who have definitions in structs/classes are semantically inline.
Per the FIXME, it might be interesting to track whether the inline keyword
was also used on the method, but for now we don't do this. Testcase pending.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
7da97d0f31e1ec16998d3de2cfd2e88fe3736673 11-May-2009 Douglas Gregor <dgregor@apple.com> Implement the semantics of the injected-class-name within a class
template. The injected-class-name is either a type or a template,
depending on whether a '<' follows it. As a type, the
injected-class-name's template argument list contains its template
parameters in declaration order.

As part of this, add logic for canonicalizing declarations, and be
sure to canonicalize declarations used in template names and template
arguments.

A TagType is dependent if the declaration it references is dependent.

I'm not happy about the rather complicated protocol needed to use
ASTContext::getTemplateSpecializationType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
ed4ec8f6d183c247a4528ff846669b02f2326185 03-May-2009 Douglas Gregor <dgregor@apple.com> One can use "class" and "struct" interchangeably to refer to a class
in C++. Fixes <rdar://problem/6815995>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ad04e6737e3267a502970acac8abb54b0c899db6 03-May-2009 Daniel Dunbar <daniel@zuster.org> Fix invalid error about duplicate declaration of padding bit field in
an interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c975bb04da88323fded43e71ff1839e8640fe878 02-May-2009 Mike Stump <mrs@apple.com> Add Sema checking for __block on vm declarations. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
180bb63b482381c5ffcdb2c4eca5c28c0b1f22af 01-May-2009 Douglas Gregor <dgregor@apple.com> Finish a thought in CheckVariableDeclaration's comment. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
ea000bf621552252e41fc870346e7048646709dc 30-Apr-2009 Mike Stump <mrs@apple.com> Sema checking for incorrect placement of __block. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7dc813462dd9fd3f6f4296f896a12de14264fef8 29-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Have the parser communicate the exception specification to the action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
65e6a093b1aeeab919025ff979a9f874cdffa628 29-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR4092 by improving error recovery in two ways:
1. In a struct field redefinition, don't mark the struct erroneous. The
field is erroneous, but the struct is otherwise well formed.
2. Don't emit diagnostics about functions that are known to be broken already.

Either fix is sufficient to silence the second diagnostic in the example,
but the combination is better :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9f9bf258f8ebae30bfb70feb9d797d6eb67b0460 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Improve compatibility with GCC regarding inline semantics in GNU89
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.

As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f01fdff97b245caac98100d232c760b4d0531411 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Get rid of some useless uses of NoExtensions. The philosophy here is
that if we're going to print an extension warning anyway,
there's no point to changing behavior based on NoExtensions: it will
only make error recovery worse.

Note that this doesn't cause any behavior change because NoExtensions
isn't used by the current front-end. I'm still considering what to do about
the remaining use of NoExtensions in IdentifierTable.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d0359af5113c1936ff3f699c7d700adff59351f2 27-Apr-2009 Chris Lattner <sabre@nondot.org> Change our silencing of C typedef redefinition handling to what we had
before r69391: typedef redefinition is an error by default, but if
*either* the old or new definition are from a system header, we silence
it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d3a413d3b8eb39bcee5944bc545d9997c1abe492 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
740782a78386ad3c64c670ba9b1619545bbb4901 25-Apr-2009 Chris Lattner <sabre@nondot.org> improve a diagnostic to make more sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
84bb944dee0cc102635b162c669f99c529c60c02 25-Apr-2009 Chris Lattner <sabre@nondot.org> with the fixes for better invalid decl/type propagation, this code
is no longer needed: a function type and a function declarator are
always known to line up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5153ee66d6d4fb37b02f85df38e48dc8b46660df 25-Apr-2009 Chris Lattner <sabre@nondot.org> Change SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to
always return a non-null QualType + error bit. This fixes a bunch of
cases that didn't check for null result (and could thus crash) and eliminates
some crappy code scattered throughout sema.

This also improves the diagnostics in the recursive struct case to eliminate
a bogus second error. It also cleans up the case added to function.c by forming
a proper function type even though the declarator is erroneous, allowing the
parameter to be added to the function. Before:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^
t.c:4:3: error: use of undeclared identifier 'P'
P+1;
^

After:
t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
2dbd285f5033ca6dea25babfd1c43d9fec35e7e5 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4049, a crash on invalid, by making sema install the right number of
parameters in a functiondecl, even if the decl is invalid and has a confusing
Declarator. On the testcase, we now emit one beautiful diagnostic:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*)
^

GCC 4.0 produces:

t.c:2: error: syntax error before ‘f’
t.c: In function ‘f’:
t.c:2: error: parameter name omitted

and GCC 4.2:

t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1ad9b28e3217c2349a04f3d3bf14f9c73a99afa7 25-Apr-2009 Chris Lattner <sabre@nondot.org> rename getNumParmVarDeclsFromType back to getNumParams(),
remove a special case that was apparently for typeof() and
generalize the code in SemaDecl that handles typedefs to
handle any sugar type (including typedef, typeof, etc).
Improve comment to make it more clear what is going on.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7cbeef278d6206941630ea14585ea80f44d68d69 25-Apr-2009 Chris Lattner <sabre@nondot.org> in:
typedef void foo(void);

We get a typedef for a functiontypeproto with no arguments, not
one with one argument and type void. This means the code being
removed in SemaDecl is dead.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
584be45eb9f20231e7cdc372c607d46d07b101a9 25-Apr-2009 Chris Lattner <sabre@nondot.org> set NewFD->setInvalidDecl() in one place, sharing code and ensuring that
functions with prototypes get the bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5cb10d3b1ad546b232e72275eaaf56d72823901d 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix the sizeof error recovery issue (sizeof-interface.m:attributeRuns)
by correctly propagating the fact that the type was invalid up to the
attributeRuns decl, then returning an ExprError when attributeRuns is
formed (like we do for normal declrefexprs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
516ff43cc4e20b637335d3dfa5b197ca8faa09cb 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but also
updates name lookup so that we see through @compatibility_alias
declarations to their underlying interfaces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
319ac896a0fef7365d5589b8021db7e41207fe42 24-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b3efa98e320590e8be9d62818e89e599303e65b4 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8f36aba016c2d236a90f9ecf0a66904209202202 23-Apr-2009 Douglas Gregor <dgregor@apple.com> The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
21e072b7faed62268074664e2b56e37d069200a7 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::KnownFunctionIDs, so that Sema doesn't end up pulling
in a bunch of declarations from the PCH file. We're down to loading
very few declarations in Carbon-prefixed "Hello, World!":

*** PCH Statistics:
6/20693 types read (0.028995%)
7/59230 declarations read (0.011818%)
50/44914 identifiers read (0.111324%)
0/32954 statements read (0.000000%)
5/6187 macros read (0.080815%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b6c8c8bd8d362c8a6cdb767415b0d21e62b77eb2 21-Apr-2009 Douglas Gregor <dgregor@apple.com> Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit.

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
df9bcd568c79779d92b2f8d04a24ca822c56523d 20-Apr-2009 Chris Lattner <sabre@nondot.org> clean up anonymous bitfield diagnostics, PR4017


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4fb71b0cc3c199cc0c736b4ec4fabdd01f56f4e8 19-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Print an error for uses of __thread on targets which don't support it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
63054b39a27ff333487e88247d495a444838b44a 19-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add more thorough/correct checking for invalid __thread specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
38c5ebd7b1b65304c7b5c7b9bf3f9162df22e77d 19-Apr-2009 Chris Lattner <sabre@nondot.org> add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid
calling into the jump checker when a function or method is known to contain
no VLAs or @try blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5af280ce21af061f96b5b5b752746871e364ba99 19-Apr-2009 Chris Lattner <sabre@nondot.org> move jump scope checking and related code out into its own file, SemaDecl.cpp is
already too large.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e52a693787df6de250456a71c361d9c91fc40fd7 19-Apr-2009 Chris Lattner <sabre@nondot.org> rewrite an O(N^2) algorithm to be O(n).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b5cf1ea6f410f72290b9c7767a63717a944c7a8f 19-Apr-2009 Chris Lattner <sabre@nondot.org> second half of indirect jump checking: make sure that any
address taken labels are in function scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
04ea2b633a1f8ee662b8a99d2903a11c1b68e1ed 19-Apr-2009 Chris Lattner <sabre@nondot.org> First half of jump scope checking for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2b7b2ca64ad8d293d10909a7ac119fa3fc10c95c 19-Apr-2009 Chris Lattner <sabre@nondot.org> reimplement DeclStmt handling so that we correctly handle intermixed
VLA's and statement expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5223af8f05eff78bfba57cb154e28fb9def97b45 19-Apr-2009 Chris Lattner <sabre@nondot.org> the scope checker does work with objc methods, add testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dabbad04ee3173f76b324d3825ede0287a304022 19-Apr-2009 Chris Lattner <sabre@nondot.org> I didn't understand how @catches were chained. Now that I get it, fix
the scope checker to not think @catches are nested in each other, eliminating
some bogus notes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cd99d9eac20ed2c9d671312996b3a3ce45505b86 18-Apr-2009 Chris Lattner <sabre@nondot.org> forgot to commit this before.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
07e775d5a1d5262a9cfe1ff333af713535b8cbab 18-Apr-2009 Chris Lattner <sabre@nondot.org> reject invalid jumps among pieces of @try blocks. This seems to work
reasonably well except for the problem that @catches are nested within
each other in the AST, giving the ugly diagnostics in L8.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b56593725243becfe2685f39eec47406299801ae 18-Apr-2009 Chris Lattner <sabre@nondot.org> unconditionally check for goto correctness. This is because switch
statements don't end up in the LabelMap so we don't have a quick way
to filter them. We could add state to Sema (a "has vla" and "has
jump" bit) to try to filter this out, but that would be sort of gross
and I'm not convinced it is the best way. Thoughts welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4f2aac33fe0e181c1c96bc9b502343935a794b5e 18-Apr-2009 Chris Lattner <sabre@nondot.org> fix two error paths out of ParseBlockLiteralExpression to
call ActOnBlockError so that CurBlock gets popped. This
fixes a crash on test/block-syntax-error.c when this new
assertion is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ea29a3a0d6948c4a51a261d19ec1a585d2a9c779 18-Apr-2009 Chris Lattner <sabre@nondot.org> refactor some code, adding a new getLabelMap() accessor method
so that clients can't poke the function-local one when they really
want the current block label. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a9768b72bb5ea061c9f10d6aa51b3be3241f3ec2 18-Apr-2009 Chris Lattner <sabre@nondot.org> Improve switch diagnostic to emit the "jump" message on the
specific bad case instead of on the switch. Putting it on the
switch means you don't know what case is the problem. For
example:

scope-check.c:54:3: error: illegal switch case into protected scope
case 2:
^
scope-check.c:53:9: note: jump bypasses initialization of variable length array
int a[x];
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
366920a45e3e278d35cbc3bc74d9d0676ae87dfe 18-Apr-2009 Chris Lattner <sabre@nondot.org> first step to getting switches giving "jump into vla scope" errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e32f74c7af4064a08aaf21fc181de72138450197 18-Apr-2009 Chris Lattner <sabre@nondot.org> fix error recovery in the case of a jump to a label with no definition
to create a well formed AST instead of a dangling pointer. This resolves
several fixme's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a5251fcf79ae9707680d656377a6e43dcbff6c25 18-Apr-2009 Chris Lattner <sabre@nondot.org> rewrite the goto scope checking code to be more efficient, simpler,
produce better diagnostics, and be more correct in ObjC cases (fixing
rdar://6803963).

An example is that we now diagnose:

int test1(int x) {
goto L;
int a[x];
int b[x];
L:
return sizeof a;
}

with:

scope-check.c:15:3: error: illegal goto into protected scope
goto L;
^
scope-check.c:17:7: note: scope created by variable length array
int b[x];
^
scope-check.c:16:7: note: scope created by variable length array
int a[x];
^

instead of just saying "invalid jump". An ObjC example is:

void test1() {
goto L;
@try {
L: ;
} @finally {
}
}

t.m:6:3: error: illegal goto into protected scope
goto L;
^
t.m:7:3: note: scope created by @try block
@try {
^

There are a whole ton of fixme's for stuff to do, but I believe that this
is a monotonic improvement over what we had.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9b0ed03691e309857b2742d039b217a0c9da3ef0 18-Apr-2009 Chris Lattner <sabre@nondot.org> don't evaluate ->child_end() every time through the loop, or *i frequently within it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e80f767a1deee63608df9864f80e237740a1039f 18-Apr-2009 Chris Lattner <sabre@nondot.org> split code out into a new CheckFunctionJumpScopes routine,
add some comments, change type from void* -> Stmt*, use
smallvector instead of vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ab09436eb9dafc96ff84d75b87709ac230d140ca 18-Apr-2009 Chris Lattner <sabre@nondot.org> make scope checking be static functions instead of sema methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7297134f128423fce2e88f92421ed135bded7d4e 18-Apr-2009 Douglas Gregor <dgregor@apple.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
32b06752d05630996b43c543c80796e1e16dadde 18-Apr-2009 Chris Lattner <sabre@nondot.org> tweak redefinition of a typedef a bit to fix a couple of problems:
1. We had logic in sema to decide whether or not to emit the error
based on manually checking whether in a system header file.
2. we were allowing redefinitions of typedefs in class scope in C++
if in header file.
3. there was no way to force typedef redefinitions to be accepted
by the C compiler, which annoys me when stripping linemarkers out
of .i files.

The fix is to split the C++ class typedef redefinition path from the
C path, and change the C path to be a warning that normally maps to
error. This causes it to properly be ignored in system headers,
etc. and gives us a way to control it. Passing
-Wtypedef-redefinition now turns the error into a warning.

One behavior change is that we now diagnose cases where you redefine
a typedef in your .c file that was defined in a header file. This
seems like reasonable behavior, and the diagnostic now indicates that
it can be controlled with -Wtypedef-redefinition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
23a48cc69e7ed4f219996a8864cb7d3f24f1157f 17-Apr-2009 Chris Lattner <sabre@nondot.org> fix a crash on invalid by making ActOnDeclarator create decl with
a dummy *function* type when it is recovering and knows it needs
a function. rdar://6802350 - clang crash on invalid input


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
6a7334d8101f323acec7d34ed083553c206a902f 16-Apr-2009 Chris Lattner <sabre@nondot.org> use getDiagnosticLevel instead of getDiagnosticMapping, which
is about to become private.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
3bf449796233175e0a696f17fad97fb6d72be48f 15-Apr-2009 Steve Naroff <snaroff@apple.com> Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from Eli).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1b6823d48da16b64cfb13d818860a21472183ca0 15-Apr-2009 Steve Naroff <snaroff@apple.com> Revert previous patch (will commit a fix soon).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ee3899e1cabcbf70d9a316b33f9b79bf3189bd01 15-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b25ddfb1559d5c340239c33d98c987386543a947 15-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6791490> [clang10 regression] [sema] invalid illegal jump diagnostic.

caused by: <rdar://problem/6252084> [sema] jumps into Obj-C exception blocks should be disallowed.

Sema::RecursiveCalcLabelScopes() and Sema::RecursiveCalcJumpScopes() need to pop the ScopeStack within the statement iteration loop (was outside the loop).

Eli, please review (thanks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1fc5194039fc01e84af46342bf6e0790f0ebb58c 14-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252084> [sema] jumps into Obj-C exception blocks should be disallowed.

This builds on Eli's work from http://llvm.org/viewvc/llvm-project?view=rev&revision=65678.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f0c9083c04d9c7d7aa099813f06d339bdbb5eab9 14-Apr-2009 Mike Stump <mrs@apple.com> Use hasAttr instead of getAttr for conditionals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5466c7b0ca8ce662e2c0bc295cecba2b78d6957d 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Audit __private_extern__ handling.
- Exposed quite a few Sema issues and a CodeGen crash.

- See FIXMEs in test case, and in SemaDecl.cpp (PR3983).

I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f33651c2d79d47d8d05908185613fe33a3e18d89 14-Apr-2009 Mike Stump <mrs@apple.com> Fixup CodeGen for __weak __block variables. Radar 6756266


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a31fecaf63dc589af70bc1604f6d2aabeb7769f7 13-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR3461: reject initializer for incomplete type. Based on patch by Tim
Northover.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
841b53c5021152fa930e517d66e02e97ae47c34b 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Make the selection of type declarations in Sema::getTypeName
deterministic when faced with an ambiguity. This eliminates the
annoying test/SemaCXX/using-directive.cpp failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6491f47670661c7c9e546cbc3ca7bae2f9850f21 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix another case that assumed that GetTypeForDeclarator would never return null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
798d5696ef5b4e3f47a6bed3c4f68f34c4810745 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix code that incorrectly assumed that GetTypeForDeclarator cannot
return null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4c97d762d8c5a84f6554e5bfb31d28c90df64158 12-Apr-2009 Chris Lattner <sabre@nondot.org> Diagnose invalid uses of tagged types with a missing tag. For example, in:

struct xyz { int y; };
enum abc { ZZZ };

static xyz b;
abc c;

we used to produce:

t2.c:4:8: error: unknown type name 'xyz'
static xyz b;
^
t2.c:5:1: error: unknown type name 'abc'
abc c;
^

we now produce:

t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
static xyz b;
^
struct
t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
abc c;
^
enum

GCC produces the normal:
t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’

rdar://6783347


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5186872629d6c9a48433bafe62dc06975bbbf7af 12-Apr-2009 Chris Lattner <sabre@nondot.org> fix a valgrind problem I noticed while developing another patch,
if a decl is invalid, it isn't added to the Decls array, so we
need to pass in Decls.size() to avoid reading uninit memory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bfc861e703895cc6d1ec2403dfebf68b90ae0992 12-Apr-2009 Chris Lattner <sabre@nondot.org> a few cleanups to StatementCreatesScope: unnest the whole thing,
exit at the first decl found that creates a scope, don't evaluate
decl_end() every iteration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f97e8fa2966e3e49eac433336450f24ccbdf8b4a 11-Apr-2009 Chris Lattner <sabre@nondot.org> simplify code to use adjustParameterType, apply objc arg attributes
to their arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bb74982f30e295d91c2282a16862d674f88d636a 11-Apr-2009 Chris Lattner <sabre@nondot.org> diagnose attempts to return objc interfaces by-value from C functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2dd979fbd59938babbed76e2376116511b403c93 11-Apr-2009 Chris Lattner <sabre@nondot.org> Improve the 'cannot pass objc interface by value' diagnostic:
1) improve localizability by not passing english strings in.
2) improve location for arguments.
3) print the objc type being passed.

Before:
method-bad-param.m:15:1: error: Objective-C type cannot be passed by value
-(void) my_method:(foo) my_param
^

after:
method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value
-(void) my_method:(foo) my_param
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e1d918e9fe55e3b34401fd5d420c47ea0f9572c9 11-Apr-2009 Douglas Gregor <dgregor@apple.com> Compare the predefines buffer in the PCH file with the predefines
buffer generated for the current translation unit. If they are
different, complain and then ignore the PCH file. This effectively
checks for all compilation options that somehow would affect
preprocessor state (-D, -U, -include, the dreaded -imacros, etc.).

When we do accept the PCH file, throw away the contents of the
predefines buffer rather than parsing them, since all of the results
of that parsing are already stored in the PCH file. This eliminates
the ugliness with the redefinition of __builtin_va_list, among other
things.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8038d5182b72dcdef292f6fb8539ad77f338855a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2cf2634ffdb4f7c8d46cef3f8e60a55993f1c57a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
d296836d0d5570fe634cfe65580dc57fdd2bc8f1 09-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add some FIXMEs for missing checks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2c2d9dc382a561553a05bf0e96ab67e403beff09 08-Apr-2009 Douglas Gregor <dgregor@apple.com> -Wmissing-prototypes shouldn't complain about main() missing a prototype.

Fixes <rdar://problem/6759522>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
85a5319ea4b5c916d7dd665e84af61e4a8a0b9c2 07-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Diagnose uses of function specifiers on declarations which don't declare
functions. Fixes PR3941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
261034861d2c8cfbd6036e56f22f57d7a3736861 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Clean up -fixit output slightly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
31a19b6989bbf326d2de5ae12e712e2a65ca9c34 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where
"foo" isn't a type, or "std::vector<void>" that doens't instantiate
properly.

Similarly, be a bit smarter in our handling of ambiguities that occur
in Sema::getTypeName, to eliminate duplicate error messages about
ambiguous name lookup.

This eliminates two XFAILs in test/SemaCXX, one of which was crying
out to us, trying to tell us that we were producing repeated error
messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8499f3f5ff8d5f95ece8047780030a3daad1b6fa 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement -Wmissing-prototypes. Fixes PR3911.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
50713450f61b85805e1ca97e547a4082b7798bd3 26-Mar-2009 Anders Carlsson <andersca@mac.com> Check that the access specifier of a member redeclaration is the same as the original declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
befc20e1dc869edb0e7b560e69f32d5c71f867ab 26-Mar-2009 Douglas Gregor <dgregor@apple.com> The injected-class-name of class templates and class template
specializations can be treated as a template. Finally, we can parse
and process the first implementation of Fibonacci I wrote!

Note that this code does not handle all of the cases where
injected-class-names can be treated as templates. In particular,
there's an ambiguity case that we should be able to handle (but
can't), e.g.,

template <class T> struct Base { };
template <class T> struct Derived : Base<int>, Base<char> {
typename Derived::Base b; // error: ambiguous
typename Derived::Base<double> d; // OK
};




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1329c274628cc8c4e8ad472b41d1a78c8123f611 26-Mar-2009 Anders Carlsson <andersca@mac.com> Tighten the setAccess assert. We now allow AS_none if the decl contex is not a C++ record decl.

Also, fix fallout from the change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3d7a12a50558c31d4351e923c15ab57688f4fdf2 26-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for static data members of class
templates, including in-class initializers. For example:

template<typename T, T Divisor>
class X {
public:
static const T value = 10 / Divisor;
};

instantiated with, e.g.,

X<int, 5>::value

to get the value '2'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
06c0fecd197fef21e265a41bca8dc5022de1f864 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Pass access specifiers through to member classes and member enums.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d475b8d9e6f5ff0e6ab8d15667ce8a64c7cb9a4d 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Instantiation for member classes of class templates. Note that only
the declarations of member classes are instantiated when the owning
class template is instantiated. The definitions of such member classes
are instantiated when a complete type is required.

This change also introduces the injected-class-name into a class
template specialization.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c9b5b4074bd73d4af76e69cccf8ecd365fdd1008 25-Mar-2009 Douglas Gregor <dgregor@apple.com> Predicate to detect when a RecordDecl is really the injected-class-name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e7450f5dbd5bed63b8ef9db86350a8fc3db011e8 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Make sure to use RequireCompleteType rather than testing for
incomplete types. RequireCompleteType is needed when the type may be
completed by instantiating a template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2dc0e64e57b2a1786fa53a7dbd1d5c8e255eadb0 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for the declarations of member functions within
a class template. At present, we can only instantiation normal
methods, but not constructors, destructors, or conversion operators.

As ever, this contains a bit of refactoring in Sema's type-checking. In
particular:

- Split ActOnFunctionDeclarator into ActOnFunctionDeclarator
(handling the declarator itself) and CheckFunctionDeclaration
(checking for the the function declaration), the latter of which
is also used by template instantiation.
- We were performing the adjustment of function parameter types in
three places; collect those into a single new routine.
- When the type of a parameter is adjusted, allocate an
OriginalParmVarDecl to keep track of the type as it was written.
- Eliminate a redundant check for out-of-line declarations of member
functions; hide more C++-specific checks on function declarations
behind if(getLangOptions().CPlusPlus).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
374e156647e4250274eb66102839abf0ee9d7fe8 23-Mar-2009 Douglas Gregor <dgregor@apple.com> Fix PR3855. When we encounter an incompatible redeclaration of a
library function, accept this declaration and pretend that we do not
know that this is a library function. autoconf depends on this
(broken) behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d1659a6bd96132ffab70613b23f5716424fa364f 23-Mar-2009 Douglas Gregor <dgregor@apple.com> Tighten up the determination of whether a function declaration has a
prototype. Thanks Eli!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
38179b29df101e3f55dbdff4d15d4d55cd82e2bd 23-Mar-2009 Douglas Gregor <dgregor@apple.com> Thanks to Eli for pointing out my misreading of 6.2.2p5

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
5ef122e9449a86e4a6466ea07ed7f5ba5f6a48bc 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Variables marked as "extern" can actually have internal linkage if
there is a previous declaration marked "static". This fixes PR3645.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d874def0f9003cb8582e97452345b2a3a4a18b6d 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Add a clarifying comment about HasPrototype's computation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
13d7a32774c51af4c314c9d1fa6229d0e1d099da 19-Mar-2009 Douglas Gregor <dgregor@apple.com> If a function is declared as, e.g.,

F f;

where F is a typedef of a function type, then the function "f" has a
prototype. This is a slight tweak to Chris's suggested fix in
PR3817. Fixes PR3817 and PR3840.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67313 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5953d8b37f92f0cf548941f617c9b0a7703df33b 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a new expression type, UnresolvedDeclRefExpr, that describes
dependent qualified-ids such as

Fibonacci<N - 1>::value

where N is a template parameter. These references are "unresolved"
because the name is dependent and, therefore, cannot be resolved to a
declaration node (as we would do for a DeclRefExpr or
QualifiedDeclRefExpr). UnresolvedDeclRefExprs instantiate to
DeclRefExprs, QualifiedDeclRefExprs, etc.

Also, be a bit more careful about keeping only a single set of
specializations for a class template, and instantiating from the
definition of that template rather than a previous declaration. In
general, we need a better solution for this for all TagDecls, because
it's too easy to accidentally look at a declaration that isn't the
definition.

We can now process a simple Fibonacci computation described as a
template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6258936178b4c52b43b3b9dbec13552961cd645 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Extend the use of QualifiedNameType to the creation of class template
specialization names. This way, we keep track of sugared types like

std::vector<Real>

I believe we are now using QualifiedNameTypes everywhere we can. Next
step: QualifiedDeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
0d48bf9eb5eee5b75b413098c84b5170ca84a62e 18-Mar-2009 Chris Lattner <sabre@nondot.org> pull a nested conditional + comment out into its own variable,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
879fd49f99742e61965f7fefecf1f3b4ba90e197 17-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement instantiation of enums within class templates. This isn't
quite as great as it sounds, because, while we can refer to the
enumerator values outside the template, e.g.,

adder<long, 3, 4>::value

we can't yet refer to them with dependent names, so no Fibonacci
(yet).

InstantiateClassTemplateSpecialization is getting messy; next commit
will put it into a less-ugly state.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f257b619059e05906c4d93f3dc134857f818f44c 16-Mar-2009 Anders Carlsson <andersca@mac.com> Check signedness of bitfield sizes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
caaacecb2b64e6d2e402533baffda4cb540f4145 13-Mar-2009 Steve Naroff <snaroff@apple.com> Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).

Will replace with something better today...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
df0325110bb07ab62b808c8db8be2f6eee9b3476 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement template instantiation for builtin binary operators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eaab20669b6a9910a5deb0110fdd8f7581d86a36 12-Mar-2009 Ted Kremenek <kremenek@apple.com> API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed to
be CompoundStmts. I think this is a valid assumption, and felt that the API
should reflect it. Others please validate this assumption to make sure I didn't
break anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
656de633acefb7ced01a4b573dbd4f70b4300097 12-Mar-2009 Douglas Gregor <dgregor@apple.com> Fix various problems with matching out-of-line definitions of static
class members to the corresponding in-class declaration.

Diagnose the erroneous use of 'static' on out-of-line definitions of
class members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
4fdf1faedbca40787fd277a6fbd5061fd69b2708 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Add basic, hackish support for instantiation of typedefs in a class
template. More importantly, start to sort out the issues regarding
complete types and nested-name-specifiers, especially the question of:
when do we instantiate a class template specialization that occurs to
the left of a '::' in a nested-name-specifier?




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
275a369f003f25bd22c00c1c0fc0251c7208caf4 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Add type checking for tentative definitions at the end of the
translation unit.

Thread the various declarations of variables via
VarDecl::getPreviousDeclaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a03aca82de5259846d4ef38db11b8116398d2222 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Partial fix for PR3310, concerning type-checking for tentative
definitions. We were rejecting tentative definitions of incomplete
(which is bad), and now we don't.

This fix is partial because we don't do the end-of-translation-unit
initialization for tentative definitions that don't ever have any
initializers specified.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4843e584b54460973b8445d38907bab0401ebb0c 10-Mar-2009 Anders Carlsson <andersca@mac.com> Address Doug's comments wrt the mangler and fix Eli's test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
e4f3e069e5e43d466954989dd7509ed371914bd0 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Downgrade complaints about the use of variable-sized types within a
struct to an extension warning to match the behavior of GNU C, which
addresses the Sema part of PR3671.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66308 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a71c129fb8052a143cbf548963a8db2150b0078e 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Use the 'declaration does not declare anything' error when we see an anonymous struct/union declaration outside of a struct or union in C

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c837656ca6d2a5b434923d7e2fd11d3a3c3bfa74 06-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement GNU C semantics for K&R function definitions that follow a
prototype of the same function, where the promoted parameter types in
the K&R definition are not compatible with the types in the
prototype. Fixes PR2821.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9fa14a547881e7abbe1edcdb92e6d3084be8d8bc 06-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve recovery from ill-formed scope specifiers. Fixes PR3670.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
80711a22fa06b734a68d719ac85d4e443a51cb09 06-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement the GNU semantics for forward declarations of enum types in
C and C++. Fixes PR3688.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
21ff9c99d3df1e4a13e6820fc2aa7a8cc6673198 05-Mar-2009 Chris Lattner <sabre@nondot.org> When parsing a function body, add it to the crash stack, giving us something
like:

Stack dump:
0. t.c:5:10: in compound statement ('{}')
1. t.c:3:12: in compound statement ('{}')
2. t.c:3:12: parsing function body 'foo'
3. clang t.c
Abort



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7f0f5dce3adcfce88d5c9a0ad0146a33c01a1e8f 04-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Check that the return type for function definitions is complete.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0b2b6e1cb1573bb295c0a65813dc4df8d57f305b 04-Mar-2009 Chris Lattner <sabre@nondot.org> Switch attributes to be allocated from the declcontext bump pointer just like
decls. This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cc5814732edc0c382d0136ab57ec6149566043e2 04-Mar-2009 Chris Lattner <sabre@nondot.org> add an a Attr::Destroy method and force clients to go through it. As part of
this, make DeclBase::Destroy destroy attributes instead of the DeclBase dtor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6393519272ce727f4d26e71bbefb5de712274d0e 02-Mar-2009 Douglas Gregor <dgregor@apple.com> Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0db28c59266808b9bf4fb72c2db80ce9f2948b74 01-Mar-2009 Anders Carlsson <andersca@mac.com> Whoops, actually remove the VLA/VM check in FinalizeDeclaratorGroup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a7acfa0de7364b24599be4329d7ee2944540428 28-Feb-2009 Anders Carlsson <andersca@mac.com> Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like

int a[(int)(1.0 / 1.0) = { 1 } will work.

Eli, please review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f306f86d2b85e820f5d1f397e4441d52373823d6 28-Feb-2009 Chris Lattner <sabre@nondot.org> Fix a crash in test/Parser/control-scope.c that testrunner didn't
notice because it was a negative test with a fix suggested by
Jean-Daniel Dupas. Convert the test from a negative to a positive
test to catch stuff like this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f3cf89737965352ee02026992e2dc735824e185e 28-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6451399> problems with labels and blocks.

- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
709fa15defbc0208b33707b3da3a628df5a9b7b9 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Check a few more kinds of declarations that make a scope.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8f17b66c8d383d458e04cada4c9e2452139b0b39 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Start of checking for gotos which jump to an illegal destination.
As far as I know, this catches all cases of jumping into the scope of a
variable with a variably modified type (excluding statement
expressions) in C. This is missing some stuff we probably want to check
(other kinds of variably modified declarations, statement expressions,
indirect gotos/addresses of labels in a scope, ObjC @try/@finally, cleanup
attribute), the diagnostics aren't very good, and it's not particularly
efficient, but it's a decent start.

This patch is a slightly modified version of the patch I attached to
PR3259, and it fixes that bug. I was sort of planning on improving
it, but I think it's okay as-is, especially since it looks like CodeGen
doesn't have any use for this sort of data structure. The only
significant change I can think of from the version I attached to PR3259
is that this version skips running the checking code when a function
doesn't contain any labels.

This patch doesn't cover case statements, which also need similar
checking; I'm not sure how we should deal with that. Extending the goto
checking to also check case statements wouldn't be too hard; it's just a
matter of keeping track of the scope of the closest switch and checking that
the scope of every case is the same as the scope of the switch. That said,
it would likely be a performance hit to run this check on every
function (it's an extra pass over the entire function), so we probably want
some other solution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3b8a36aea7c4d93c5f7cd772c5c9cde28647b3f0 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix minor memory leak. Add comment describing what we need to do for
strict constant initializer checking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
21298280988072f3bcfca2fb65335b58b88f88b7 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Zap the Sema constant initializer checking code that we aren't using
anymore. If we want to reuse bits and pieces to add strict checking for
constant initializers, we can dig them out of SVN history; the existing
code won't be useful as-is.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bc592e6e56f16f5d06fc70c3931f7d9d33f7b3cd 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3663/3669: use TryToFixInvalidVariablyModifiedType for
variable declarations where applicable. Also, a few fixes to
TryToFixInvalidVariablyModifiedType for issues that this exposed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2224f84658fb9b3725a31f2680edb64ae73bf705 25-Feb-2009 Douglas Gregor <dgregor@apple.com> C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eaf2bb89eb2aad3b80673de30febe52df43c10ec 24-Feb-2009 Chris Lattner <sabre@nondot.org> first wave of fixes for @encode sema support. This is part of PR3648.

The big difference here is that (like string literal) @encode has
array type, not pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
111c2ee5fe984219d1950b389ea4d2dcabaf83da 24-Feb-2009 Chris Lattner <sabre@nondot.org> some minor cleanups, handle ObjCEncodeExpr in a couple places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d6f7e9dccd0fa8a5a15d7478324c0ae229fc5e1e 24-Feb-2009 Douglas Gregor <dgregor@apple.com> When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8f30105fda579f8e6db339cb88cdec2bef6350bd 24-Feb-2009 Douglas Gregor <dgregor@apple.com> Extend the implicit declaration and checking against out-of-scope
external declarations to also support external variable
declarations. Unified the code for these two cases into two new
subroutines.

Note that we fail to diagnose cases like the one Neil pointed
out, where a visible non-external declaration hides an external
declaration by the same name. That will require some reshuffling of
name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
25d944af5d8d665611e09956954f10896c1071f6 24-Feb-2009 Douglas Gregor <dgregor@apple.com> In C, when we see a function declaration within a local scope, export
that declaration to global scope so that it can be found from other
scopes. This allows us to diagnose redeclaration errors for external
declarations across scopes. We also warn when name lookup finds such
an out-of-scope declaration. This is part of <rdar://problem/6127293>;
we'll also need to do the same thing for variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
04495c859f81e440748a9b86baa2913461652bb0 24-Feb-2009 Douglas Gregor <dgregor@apple.com> Improve merging of function declarations. Specifically:

- When we are declaring a function in local scope, we can merge with
a visible declaration from an outer scope if that declaration
refers to an entity with linkage. This behavior now works in C++
and properly ignores entities without linkage.
- Diagnose the use of "static" on a function declaration in local
scope.
- Diagnose the declaration of a static function after a non-static
declaration of the same function.
- Propagate the storage specifier to a function declaration from a
prior declaration (PR3425)
- Don't name-mangle "main"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1829a6db2ec19e08061f0bb2f4c52a8e5e4efaf0 23-Feb-2009 Chris Lattner <sabre@nondot.org> fix rdar://6611778, a redefinition of an interface was causing an
assertion when the ivars and method list was reset into the existing
interface. To fix this, mark decls as invalid when they are redefined,
and don't insert ivars/methods into invalid decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
578a97249c10eb83f25b408de1edfb70f5a4233c 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Throw the switch to exclusively use Evaluate (along with the small
helper isConstantInitializer) to check whether an initializer is
constant. This passes tests, but it's possible that it'll cause
regressions with real-world code.

Future work:
1. The diagnostics obtained this way are lower quality at the moment;
some work both here and in Evaluate is needed for accurate diagnostics.
2. We probably need some extra code when we're in -pedantic mode so we
can strictly enforce the rules in C99 6.6p7.
3. Dead code cleanup (this should wait until after 2, because we might
want to re-use some of the code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7b5b3170d9be39f462194d456051a7ca81babe28 21-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Warn on use of __weak attribute on local
variable (objc2 gc specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
61125c81cc73f7011bab091611dd08b2f38819ae 21-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Slight tweak to last commit: make sure to copy CVR qualifiers for fixed
pointer types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1ca4813ddae54deead43252fe2f2d79fa5b7ad48 21-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Re-fix r65140 correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ccef371a67756233aa97770e4fccdfa868b3e2d0 20-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6500554> missing objc error message.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
38af2deb27cdfa1a95bde96e30dab15dce53fcef 20-Feb-2009 Chris Lattner <sabre@nondot.org> add plumbing to get ASTContext& down to allocation/deallocation points in ObjCList,
but don't start using it yet. Renamed some methods to be more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7a21bd046fe57629ab074980cf8193f5e0c15735 20-Feb-2009 Chris Lattner <sabre@nondot.org> move the @implementation ivar list to being an ObjCList, which prevents
it from being leaked, among other things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
540b146d013b3b6d5ab7c485b9e692a866173e15 20-Feb-2009 Anders Carlsson <andersca@mac.com> Always try to fold array sizes, and warn if we could fold something that isn't an ICE. This makes us compatible with GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
63359c80b0ff4bd3e898f38efe88be3c01581320 20-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6586239> bitfield constraints not enforced (for ObjC)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
da153239bb6e69722fdd82914e729bb39f5821c5 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Suppress constant initializer checking when the declaration isn't valid.
This prevents emitting diagnostics which are almost certainly useless.

(Note that the test is checking that we emit only one diagnostic.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
83aa61f600456228d4087d7cf160708453b9c9b0 20-Feb-2009 Chris Lattner <sabre@nondot.org> GetTypeForDeclarator can return null on error now, handle this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1c17689a6703331c656ae79bb756bf606d63f71a 19-Feb-2009 Anders Carlsson <andersca@mac.com> Emit the correct diagnostics when we constant fold an array size to a negative value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f6123ca578eb8aabb76ecce7df6857482017f502 19-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Couple of helpers for objc's gc attributes.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c2b6a8239326456753cd7d636656e420feaecb40 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Return true on errors, return true on errors, return true on errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
ed7e9ef19915fc9ee775cd00d45ce673defc378f 18-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Make warn-weak-field.m test pass again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
965acbb321e94e36aa5365126eee46b97745fdbb 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Allow "overloadable" functions in C to be declared as variadic without
any named parameters, e.g., this is accepted in C:

void f(...) __attribute__((overloadable));

although this would be rejected:

void f(...);

To do this, moved the checking of the "ellipsis without any named
arguments" condition from the parser into Sema (where it belongs anyway).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c6666f8e9bbb7f31bf2e52f97137e738c4ca01d0 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Don't allow calls to functions marked "unavailable". There's more work
to do in this area, since there are other places that reference
FunctionDecls.

Don't allow "overloadable" functions (in C) to be declared without a
prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
afcc7b425bcdc8ef8092f5f510486d2f246c2d86 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove one more redundant dyn_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d311f376c364e5a6c88b63b1d5c53f560ea5e650 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove some redundant Decl -> Decl castings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0c00aac5d618f39afc406c5b2e07642930af1d56 17-Feb-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> All Decls have a DeclContext now, hooray! Fans of consistency rejoice.

Pass the DeclContext to ObjCIvarDecls as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
655753a757b3eae4306cf59e84a63b78ebb2b9a7 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Remove the error about redefining library functions. It's causing too
much pain when compiling the Linux kernel (PR3592).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9add31798f621f843233dbff8bba103fca64447b 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Static variables and functions won't collide with standard library
functions, so if we're declaring a static we should implicitly declare
a library function by the same name (e.g., malloc, strdup). Fixes PR3592.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
574aa40703ffb2fddad5b076cec1c2fc27f0b2d3 17-Feb-2009 Chris Lattner <sabre@nondot.org> Make PragmaPackStack be a private class in SemaAttr and make its
instance in Sema be a pimpl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5a0c35150102f95ab270f741cdab5907c9bd9017 17-Feb-2009 Chris Lattner <sabre@nondot.org> move attribute(packed) sema support out of SemaDecl into a new SemaAttr.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ef2abfee3ea16ec74942dc09e9e425f46aeb2582 16-Feb-2009 Daniel Dunbar <daniel@zuster.org> Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.

- Define pow[lf]?, sqrt[lf]? as builtins.

- Add -fmath-errno option which binds to LangOptions.MathErrno

- Add new builtin flag Builtin::Context::isConstWithoutErrno for
functions which can be marked as const if errno isn't respected for
math functions. Sema automatically marks these functions as const
when they are defined, if MathErrno=0.

- IRgen uses const attribute on sqrt and pow library functions to
decide if it can use the llvm intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
22bd905673a73ccb9b5e45a7038ec060c9650ffe 16-Feb-2009 Chris Lattner <sabre@nondot.org> diagnose uses of deprecated typenames and tags.
We now pass all the deprecation tests in the objc.dg suite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b1152d842c6599e41581302a85a0f53928253add 16-Feb-2009 Douglas Gregor <dgregor@apple.com> Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
450da9832b31d9b2e90af7708d197e5b9e1af8c8 16-Feb-2009 Douglas Gregor <dgregor@apple.com> When merging from a function with a prototype to a function without a
prototype, synthesize ParmVarDecls for prototype-less FunctionDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a5afdd0ef9ff4a7a3f26145b6536a84dd340c897 16-Feb-2009 Fariborz Jahanian <fjahanian@apple.com> Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionally
the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ffed163be5e1e6304f738da90c6047c393e38565 16-Feb-2009 Chris Lattner <sabre@nondot.org> add assertion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6871981fbccba9e8a63997d58245ec0add114f49 16-Feb-2009 Douglas Gregor <dgregor@apple.com> When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the
declaration). Fixes PR3588.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
8e9dcb720bbc373ac6a152322f99a5ec46629c2e 15-Feb-2009 Chris Lattner <sabre@nondot.org> lots of trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
76a642ff4fce7a0648c79a1f01324a8c3880e251 15-Feb-2009 Chris Lattner <sabre@nondot.org> Refactor the deprecated and unavailable checks into a new
DiagnoseUseOfDeprecatedDecl method. This ensures that they
are treated consistently. This gets us 'unavailable' support
on a few new types of decls, and makes sure we consistently
silence deprecated when the caller is also deprecated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3c385e5f8d9008fff18597ca302be19fa86e51f6 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
370ab3f1373841d70582feac9e35c3c6b3489f63 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a316e7b735b12ce6b34961a9dcfaae34f4b08d29 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

- fprintf and vfprintf: the builtins mechanism cannot (yet)
express FILE* arguments, so these can't be encoded.
- NSLog: the builtins mechanism cannot (yet) express NSString*
arguments, so this (and NSLogv) can't be encoded.
- asprintf and vasprintf: these aren't part of the C99 standard
library, so we really shouldn't be defining them as builtins in
the general case (and we don't seem to have the machinery to make
them builtins only on certain targets and depending on whether
extensions are enabled).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3e41d60eb627dc227c770f1c1c87d06909cf05fd 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ae17094c001972a5949944a0a77ef6adf2a92c8f 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Tighten checking of the "overloadable" attribute. If any function by a
given name in a given scope is marked as "overloadable", every
function declaration and definition with that same name and in that
same scope needs to have the "overloadable" attribute. Essentially,
the "overloadable" attribute is not part of attribute merging, so it
must be specified even for redeclarations. This keeps users from
trying to be too sneaky for their own good:

double sin(double) __attribute__((overloadable)); // too sneaky
#include <math.h>

Previously, this would have made "sin" overloadable, and therefore
given it a mangled name. Now, we get an error inside math.h when we
see a (re)declaration of "sin" that doesn't have the "overloadable"
attribute.



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

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

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

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

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ab197baec16bacade82325fb274cf6b992ac5d8a 09-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Declarator::getSourceRange().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
00d50747e8442a4d0daf2dfc226aec354fd3441e 08-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix redundant errors with missing default arguments in member declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
89ef6e03665635d965ba6c92035a85b125e6c78c 08-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix redundant errors for redefinitions with multiple existing definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4b99bae3bf2395f732eaadb9edc07690ae177f54 06-Feb-2009 Douglas Gregor <dgregor@apple.com> Clean up an already-fixed FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ddc29e116db3c3f4144355e67a0137b38b6bb6d1 06-Feb-2009 Douglas Gregor <dgregor@apple.com> Semantic checking for class template declarations and
redeclarations. For example, checks that a class template
redeclaration has the same template parameters as previous
declarations.

Detangled class-template checking from ActOnTag, whose logic was
getting rather convoluted because it tried to handle C, C++, and C++
template semantics in one shot.

Made some inroads toward eliminating extraneous "declaration does not
declare anything" errors by adding an "error" type specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4ce205f94c984ddc4776ba0c3de7e398d251653a 06-Feb-2009 Douglas Gregor <dgregor@apple.com> Diagnose attempts to define a namespace member out-of-line when no
matching member exists. Thanks to Piotr Rak for reporting the problem!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d6efafa5144a3e9942d1b09a246b118b1ba77a48 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Improve documentation for Sema::getTypeName. Also, it's return type is
DeclTy*, not TypeTy*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
e2c565d488bc74a506d49fe37df4268fa35637b3 03-Feb-2009 Douglas Gregor <dgregor@apple.com> When looking for a tag name via unqualified name lookup, only look in
scopes where the name would be considered a redeclaration if we know
that we're declaring or defining that tag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
1931b44da8da86979a8d7ceb48685686503f197b 03-Feb-2009 Douglas Gregor <dgregor@apple.com> Simplify the way in which we inject the names of tag definitions and
elaborated-type-specifier declarations into outer scopes while
retaining their proper lexical scope. This way is simpler and more
consistent with the way DeclContexts work, and also fixes

http://llvm.org/bugs/show_bug.cgi?id=3430


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ff77645058c5d56b4f3273e27f7492c78288825e 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> emit diagnostic when casting a ptr to a small int when doing static initialization (addresses Eli's comments I believe)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1dfa6e15cba39f27a438d63837435596e58af1c1 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> fix TryToFixInvalidVariablyModifiedType to reject negative array sizes

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
839508150a7a595b6172217eeddc4d024fc201c5 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> allow cast from array to int to be considered as constant

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f23199847b686ca2d674274ee7271f75640c1e0e 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR3459: improve compatibility with gcc when checking for constant exprs

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

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


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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
a51890346e0d81519d0656f44bce15c40bf63d3f 29-Jan-2009 Steve Naroff <snaroff@apple.com> Hack Sema::LookupDeclInScope() to avoid calling Sema::LookupName() when parsing C/ObjC.

This results in a 1.7% improvement for "Cocoa.h". If we can figure out how to return a "Decl *", rather than a Sema::LookupResult(), we will likely bump the speedup from 1.7%->2.5%. I verified this, however couldn't get it to work without breaking a fair number of C++ test cases. Will discuss with Doug offline.


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

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



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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4c67834407ca6ab344dcf44fc599ad4938cfa96d 28-Jan-2009 Douglas Gregor <dgregor@apple.com> Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
66973121788ca645fe3d4a66179b9cfb6f2bce08 28-Jan-2009 Douglas Gregor <dgregor@apple.com> Complete semantic checking for typedef redeclarations in C++. The
rules are slightly different than in C, and now we handle both
dialects properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
133147d2d31bdcd6943635f80e77d78d2504148f 28-Jan-2009 Steve Naroff <snaroff@apple.com> Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
13ca96a238089fb8e622791bc0dc441eb2dd29b4 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR2100: merge types for variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
91b9f2072a20906dd34ac6cb83813debf3595328 24-Jan-2009 Anders Carlsson <andersca@mac.com> Ignore parens when determining if an expr is a string literal. Fixes PR3382.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
be109b3e768b70f9efb106d25d6b5a2c72c5a9b8 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Handle any undeclared parameters in a K&R-style function with a
special action, inside function prototype scope. This avoids confusion
when we try to inject these parameters into the scope of the function
body before the function itself has been added to the surrounding
scope. Fixes <rdar://problem/6097326>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
21282df53bd86f737f84c4ae6d2dea7ef32f0895 22-Jan-2009 Douglas Gregor <dgregor@apple.com> EXTWARNify the warning about unnamed typedefs of enums

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

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

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cf79b011e849a4455cb7b0de6dc4fb3b83308f39 21-Jan-2009 Chris Lattner <sabre@nondot.org> Don't look up decls with no name (such as parameters and unnamed tagged types),
this removes 4266 calls to LookupDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5af2f35c6ad1cb78b2aed3705d221954d1689b8a 20-Jan-2009 Chris Lattner <sabre@nondot.org> Optimize Declarator to avoid malloc/free traffic for the argument list of a
function DeclaratorChunk in common cases. This uses a fixed array in
Declarator when it is small enough for the first function declarator chunk
in a declarator.

This eliminates all malloc/free traffic from DeclaratorChunk::getFunction
when running on Cocoa.h except for five functions: signal/bsd_signal/sigset,
which have multiple Function DeclChunk's, and
CFUUIDCreateWithBytes/CFUUIDGetConstantUUIDWithBytes, which take more than
16 arguments.

This patch was pair programmed with Steve.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
40f4e69002af9623a1f959bd57b99afda186a6a7 20-Jan-2009 Douglas Gregor <dgregor@apple.com> Rename DeclContext::insert to DeclContext::makeDeclVisibleInContext and document both it and DeclContext::addDecl properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
59b5da6d853b4368b984700315adf7b37de05764 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Support evaluation of vector constant expressions, and codegen of same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8158f692571ba5eaae19e086b76d19319ac503c5 17-Jan-2009 Douglas Gregor <dgregor@apple.com> Warn about typedefs of enums without any declarator name. Fixes rdar://problem/6503878

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0b7a158d120ac8d78c114a823e17eedfec6b6658 17-Jan-2009 Douglas Gregor <dgregor@apple.com> Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that
qualified name lookup of a class name within its definition works (see
the new bits in test/SemaCXX/qualified-id-lookup.cpp).

As part of this, move the nested redefinition checking code into
ActOnTag. This gives us diagnostics earlier (when we try to perform
the nested redefinition, rather than when we try to complete the 2nd
definition) and removes some code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c55a24095c3488fa6e99b537be64e57a2905477b 16-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Don't ICE on user redeclaration of objc's built-in types.
Issue diagnostics instead if types do not match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
95d58f3ad73881c39cd63780b6af01a1045bd4b3 16-Jan-2009 Chris Lattner <sabre@nondot.org> silence release-assert warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d5ed8c3d7de82ee1f028806ccac9b921832fb528 16-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> Extract code dealing with typedef declarators into a separate function.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cb8f4f15dd56d0da6503e7fc188fb7cac5d1285d 16-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> Extract code dealing with variable declarator into a separate function.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
416fcaf92006f8a3cc290cdd2aa62bbf3998541f 16-Jan-2009 Zhongxing Xu <xuzhongxing@gmail.com> Extract code dealing with declarators of function type into a separate function
Sema::ActOnFunctionDeclarator().
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
13fd416b3d2b0c69247f2691f0ff344100e0faff 15-Jan-2009 Chris Lattner <sabre@nondot.org> PR3330: given an enum like this:

enum E {
A = 1U,
B
};

Don't make an implicit cast expr of null for B.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6ed2ef8281e44fdd8f002d1cbe11668068d3e530 15-Jan-2009 Nuno Lopes <nunoplopes@sapo.pt> add support for initializing static vars with a cast to union (gcc extension)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7176fff961e04c4dff61efb967b1d344d41335a7 15-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of member name lookup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
ee159c14c1ac99d7944645e2b111b04dca089855 14-Jan-2009 Douglas Gregor <dgregor@apple.com> Permitting typedefs without a name is a Microsoft/GNU extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4920f1ffb62b13b88e579476803c093f97f3e17f 12-Jan-2009 Douglas Gregor <dgregor@apple.com> Implement support for anonymous structs and unions in C. Both C and
C++ handle anonymous structs/unions in the same way. Addresses several
bugs:

<rdar://problem/6259534>
<rdar://problem/6481130>
<rdar://problem/6483159>

The test case in PR clang/1750 now passes with -fsyntax-only, but
CodeGen for inline assembler still fails.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a0d31a3d7f14ddc6370ba912c778aece6c12cf0 12-Jan-2009 Douglas Gregor <dgregor@apple.com> Properly set the scope of non-fields declared within a struct, union,
or enum to be outside that struct, union, or enum. Fixes several
regressions:

<rdar://problem/6487662>
<rdar://problem/6487669>
<rdar://problem/6487684>
<rdar://problem/6487702>
PR clang/3305
PR clang/3312

There is still some work to do in Objective-C++, but this requires
that each of the Objective-C entities (interfaces, implementations,
etc.) to be introduced into the context stack with
PushDeclContext/PopDeclContext. This will be a separate fix, later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2726f9ad0a2a97c444a2b8b356c261cba120605a 11-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix operator precedence.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
dcde115dc2e9c21a295200c3129619e4bea15924 10-Jan-2009 Douglas Gregor <dgregor@apple.com> Don't bother setting NextDeclarator for EnumConstantDecls. It isn't used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3218c4bb3b5d7250f12420de6db7ef3e3f805a75 09-Jan-2009 Douglas Gregor <dgregor@apple.com> When we see a reference to a struct, class, or union like "struct X"
that is neither a definition nor a forward declaration and where X has
not yet been declared as a tag, introduce a declaration
into the appropriate scope (which is likely *not* to be the current
scope). The rules for the placement of the declaration differ slightly
in C and C++, so we implement both and test the various corner
cases. This implementation isn't 100% correct due to some lingering
issues with the function prototype scope (for a function parameter
list) not being the same scope as the scope of the function
definition. Testcase is FIXME'd; this probably isn't an important issue.

Addresses <rdar://problem/6484805>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6037fcba3431b47de1a994c9b286feac17894eff 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Replace DeclContext's vector of ScopedDecl pointers with a linked list
of ScopedDecls (using the new ScopedDecl::NextDeclInScope
pointer). Performance-wise:

- It's a net win in memory utilization, since DeclContext is now one
pointer smaller than it used to be (std::vectors are typically 3
pointers; we now use 2 pointers) and
- Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang)
is about 1.9% faster than before, most likely because we no longer
have the memory allocations and copying associated with the
std::vector.

I'll re-enable serialization of DeclContexts once I've sorted out the
NextDeclarator/NextDeclInScope question.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a8cc8ce044e5d2589128f0c1a84e586cce743b27 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure that ScopedDecls passed to DeclContext::addDecl are added into their lexical context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
25553512a50e8c79fb1daae4b0398086be338554 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Remove double-insertion of EnumConstantDecls. Thanks to Zhongxing Xu for pointing this out

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
bc468ba19c0bad9bf4a40ff39d8fad7e471bfbf5 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Fix PR clang/3291

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
e21b99468ad408694caf4b4efbbb57ef9d89f99f 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Use DeclContext::getLookupContext wherever necessary to ensure that we look through transparent contexts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bcbffc46f1ad3796c4582fa1e3a9113b5aa26061 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of anonymous unions (and, as a GNU extension,
structures and classes) in C++. Covers name lookup and the synthesis
and member access for the unnamed objects/fields associated with
anonymous unions.

Some C++ semantic checks are still missing (anonymous unions can't
have function members, static data members, etc.), and there is no
support for anonymous structs or unions in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ce35607c282c845b3285d0f6e106489d8bbeba13 07-Jan-2009 Douglas Gregor <dgregor@apple.com> Allow Objective-C entities to be declared within a transparent context
nested in the translation unit. This fixes <rdar://problem/6476070>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7bea766fc90752eb5415c40dd70fc7176383bdbc 06-Jan-2009 Chris Lattner <sabre@nondot.org> simplify some code using 'continue' and the new 'isInIdentifierNamespace' predicate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4f3b8f8ac2f8c89028a2f8793df0a7887df809d4 06-Jan-2009 Douglas Gregor <dgregor@apple.com> Minor tweaks to the transparent declcontext patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1a49af9681c350fef58e677f85ccb9a77e8e9d0a 06-Jan-2009 Douglas Gregor <dgregor@apple.com> Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
1) The use of a qualified-id instead of an unqualified-id suppresses
argument-dependent lookup
2) If the name refers to a virtual function, the qualified-id
version will call the function determined statically while the
unqualified-id version will call the function determined dynamically
(by looking up the appropriate function in the vtable).

Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
a4ed0d8d75212dc01b4438829a4b0c846d99458d 28-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2f402708e62f89fb875442802e3d3f20fc909d33 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c4b4e7b8f6ca9b036824e048af49cd2a52b57cdf 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6ed40e351a7c1fb3084434f1db19216b79623cf0 23-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't push OverloadedFunctionDecls onto the chain of declarations
attached to an identifier. Instead, all overloaded functions will be
pushed into scope, and we'll synthesize an OverloadedFunctionDecl on
the fly when we need it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
fcdbb93749ed69aa9022437052c390522355ec3d 20-Dec-2008 Anders Carlsson <andersca@mac.com> Handle typedefs to VLAs (Emit the size expr when we encounter the typedef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1c0cfd4599e816cfd7a8f348286bf0ad79652ffc 19-Dec-2008 Anders Carlsson <andersca@mac.com> Get rid of the old Expr::Evaluate variant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
264c8ed7edf26031c6854b6b92ab0d7774c13579 18-Dec-2008 Douglas Gregor <dgregor@apple.com> Don't check initializers when there are dependent types or type-dependent expressions involved

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
375d37c1298def125934bbbebca535c3867a89db 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to re-implement duplicate ivar checking
(which will pass duplicate-ivar-check.m test again).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a769c004a2874504c17ea8afccbc4ad35fc33c9f 17-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> This patch will build the Records lazily per Steve's comments.
Note that one test duplicate-ivar-check.m will fail because I
need to re-implement duplicate ivar checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
777f07b6cd595bb0922e05768e5703fbc92b5695 17-Dec-2008 Chris Lattner <sabre@nondot.org> diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name. This implements PR3208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
45579f5e2904590ff9a4f48c7fbf2e60dccb0426 17-Dec-2008 Douglas Gregor <dgregor@apple.com> Make sure that enumerators show up within the enumeration declaration. Fixes. PR clang/3220

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f44515a49b549171dc3ee9faa6281b72609da563 16-Dec-2008 Douglas Gregor <dgregor@apple.com> Make linkage-specifications hold on to all of their declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
3281eff4c1fbf7e2e59cc5381d5270deaf06839e 16-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Diagnose that ivars in current and super class may not
be duplicates and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0a59acb9ae36077ce46fb2807956c5e84f0f6837 16-Dec-2008 Douglas Gregor <dgregor@apple.com> Make name lookup when we're inside a declarator's scope, such as ClassName::func, work with the new unqualified name lookup code. Test it with default arguments in out-of-line member definitions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
584049d49d956add7bce5669e9823491f7d8de78 16-Dec-2008 Douglas Gregor <dgregor@apple.com> Diagnose erroneous uses of out-of-line member definitions and scope
specifiers. Specifically:
* Determine when an out-of-line function definition does not match
any declaration within the class or namespace (including coping
with overloaded functions).
* Complain about typedefs and parameters that have scope specifiers.
* Complain about out-of-line declarations that aren't also
definitions.
* Complain about non-static data members being declared out-of-line.
* Allow cv-qualifiers on out-of-line member function definitions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9ee92e84ecf085ccbe6f877d1c6e1500961bbbce 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Name of addLayoutToClass is confusing as no layout calculation
is done. Layout is calculated lazily at code gen type.
This patch changes the name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
9fbb609b90c1b41e147cf3e6afac40ff4b4137da 15-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Removed setRecordForDecl. Added a FIXME.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7df7b6bb800e1987951285ea192e4f347e1b603a 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Create new EnumDecl nodes for redeclarations of enums, linking them
together in the same way that we link RecordDecl/CXXRecordDecl nodes.

Unify ActOnTag and ActOnTagStruct.

Fixes PR clang/2753.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
60f8c868ffb346b78451a3eccaecd0461d2ae498 13-Dec-2008 Fariborz Jahanian <fjahanian@apple.com> Add storage layout to ObjC classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
cd08707a960842223e4af9ab82c729ba179290c0 12-Dec-2008 Chris Lattner <sabre@nondot.org> Implement rdar://6138816 - [sema] named bitfields cannot have 0 width


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c9467cf4cff1bb09f38667b871268c47ed823f97 12-Dec-2008 Douglas Gregor <dgregor@apple.com> In C++, set the type of each of the enumerators in an enumeration to
the type of the enumeration once the enumeration has been defined.

Fix the overloading test-case to properly create enums that promote
the way we want them to.

Implement C++0x promotions from enumeration types to long
long/unsigned long long. We're using these promotions in Carbon.h
(since long long is a common extension).

Fixes PR clang/2954: http://llvm.org/bugs/show_bug.cgi?id=2954


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
f57172b24f08a68d179675989813d5479dc87829 08-Dec-2008 Douglas Gregor <dgregor@apple.com> Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it belongs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e50897af8bcdeee5e4bd65a5d122df9bee82705a 08-Dec-2008 Zhongxing Xu <xuzhongxing@gmail.com> fix 80-col violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7fd1df2a87729059a1589c47606f7a43f531c39f 07-Dec-2008 Anders Carlsson <andersca@mac.com> Pass the VLA size expr range to the VLA diags

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
96e05bc09070aaa7c18d3dd3ff13125a43532f69 07-Dec-2008 Anders Carlsson <andersca@mac.com> Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9f1e5727e36481d830e566ff5a016fda726838e4 06-Dec-2008 Anders Carlsson <andersca@mac.com> Add diagnostics for bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
898574e7496ba8fd76290079d3a9d06954992734 06-Dec-2008 Douglas Gregor <dgregor@apple.com> Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
72c3f314d92d65c050ee1c07b7753623c044d6c7 05-Dec-2008 Douglas Gregor <dgregor@apple.com> Representation of template type parameters and non-type template
parameters, with some semantic analysis:
- Template parameters are introduced into template parameter scope
- Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
49184b2916f2f6535ac22f8517dc1e996225d2f1 05-Dec-2008 Anders Carlsson <andersca@mac.com> Use VerifyIntegerConstantExpression instead of isIntegerConstantExpr. Fixes PR2963

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9e09f5d361c50373435b9e142da8538034d84601 05-Dec-2008 Anders Carlsson <andersca@mac.com> Make Sema::CheckForConstantInitializer use Expr::Evaluate. This fixes PR3130.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e89b02823a3ab1a5a282922ac9b014e226dca2ab 01-Dec-2008 Douglas Gregor <dgregor@apple.com> Initialize storage class even if we got an erroneous mutable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d14094db3375b64fbe3cbf43587bcb0f1f728220 24-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Remove some bad characters from comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
011bb4edf731d529da1cbf71c7c2696aaf5a054f 23-Nov-2008 Chris Lattner <sabre@nondot.org> add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString(). This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
51fe996231b1d7199f76e4005ff4c943d5deeecd 22-Nov-2008 Anders Carlsson <andersca@mac.com> Use Expr::Evaluate for case statements. Fixes PR2525

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bbe2743b0259e6c8b053b601bfd768dd49c8143a 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Allow redeclaration of typedefs in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
8edea83d4d45d912191eac97b861309af6c74acd 20-Nov-2008 Chris Lattner <sabre@nondot.org> compared to the rest of the code in Sema::GetStdNamespace(),
looking up the "std" identifier is trivial. Just do it, particularly
since this is only done if the namespace hasn't already been looked up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2bac0f6b3724734d7bb7bf8231bd8511cb49570f 20-Nov-2008 Chris Lattner <sabre@nondot.org> remove some other identifiers that are looked up really early and only
used in one cold place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
77407b802130b1c44b1f63b855722a5376f57bca 19-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Take care another assert:

struct A {
struct B;
};

struct A::B {
void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."
};

Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g:

namespace A {
struct S;
}
struct A::S {}; // getParent() == namespace 'A'
// getLexicalParent() == translation unit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
06550395dd70d0c65a1d8dbb8a9639262f158414 19-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix silly code, use IdentifierInfo* instead of std::string in
PragmaPackStack. Thanks Chris!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
e94ca9e4371c022329270436b3dd77adc4ddfa8f 18-Nov-2008 Douglas Gregor <dgregor@apple.com> Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names.
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator.

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
2def48394f6d48bde0dec2b514193c2b533265b5 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6ee7aa154e8bbb21a21254293410b944f78b0bfe 16-Nov-2008 Chris Lattner <sabre@nondot.org> rename Expr::tryEvaluate to Expr::Evaluate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
b4609806e9232593ece09ce08b630836e825865c 14-Nov-2008 Douglas Gregor <dgregor@apple.com> Add a new expression node, CXXOperatorCallExpr, which expresses a
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)

I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
23cd0d994f39300c9eed013afaec99b8cde2a65c 13-Nov-2008 Chris Lattner <sabre@nondot.org> don't highlight field name, just put a caret on it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
67027a7bc35671bc3f6d5c109720060f06303391 12-Nov-2008 Chris Lattner <sabre@nondot.org> Fix a FIXME by improving a diagnostic, add a testcase for PR3048



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1d353bae14855bfcfefa1df230d2e271d00ee919 12-Nov-2008 Chris Lattner <sabre@nondot.org> make TryFixInvalidVariablyModifiedType a static function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
57d5788b45b677463f3132410d6f530ae5a2cf87 12-Nov-2008 Chris Lattner <sabre@nondot.org> Restructure code to encourage fallthrough, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3ab5543acfbaca11409c87efdc5154d7af21d47f 12-Nov-2008 Chris Lattner <sabre@nondot.org> fix PR3048. I'm going to do some more work before closing it off and
adding a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
0518999d3adcc289997bd974dce90cc97f5c1c44 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c42e1183846228a7fa5143ad76507d6d60f5c6f3 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ 'typeid' parsing and sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1f6f54be86a514d531ec231fd837858a43cfe72e 11-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3031 by silencing follow-on errors in invalid declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5239304ff761b8b03eefb772bd5d830a9b9f1aea 10-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names.
e.g.:
namespace A {
void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A'
}
void A::f(); // SemanticDC == namespace 'A'
// LexicalDC == global namespace


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0f84a23cc542a76f97aee735cdf3ff948b149879 09-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> When a tag has nested-name ('struct foo::bar'), use not 'CurContext' but the context of the nested-name ('foo::').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
630c81b78a6a469707e2940a421da874f3b12643 09-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify handling of nested-names in tags ('struct foo::bar').
-Use more of the non nested-name code path.
-Also use the ActOnTagStruct code path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
c7ed9c60b8ee04b119e23441cae2cfec74536ba9 07-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Changes in preparation for nested-name-specifiers.

-When parsing declarators, don't depend on "CurScope->isCXXClassScope() == true" for constructors/destructors
-For C++ member declarations, don't depend on "Declarator.getContext() == Declarator::MemberContext"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
48c2e909741a7b67ead01143edabd7b3fe42ee50 07-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix crash caused by this:

void f() {
int +; // crash here
}


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58846 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
6fc17ff5bf73c4d190517ebc5773f2ae557598ab 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Simplify and correct the check for function redefinitions. This does two things:

- Allows definitions of overloaded functions :)
- Eliminates extraneous error messages when we have a definition of a
function that isn't an overload but doesn't have exactly the same type
as the original.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
818ce488beec3935623a25bfa0026d67e182d6d6 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Temporary disable the const-object-declaration-without-initializer check, because it depends on linkage-specifier semantics we don't yet have

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
6eec8e883de118b431e3ead5b1e604a6ac68ff6b 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Rename ExplicitCCastExpr to CStyleCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9d293dfc0ad7c44ae0b5eb9517f1ed8c8d8b7ff7 28-Oct-2008 Douglas Gregor <dgregor@apple.com> Improve our handling of (C++) references within Clang. Specifically:
- Do not allow expressions to ever have reference type
- Extend Expr::isLvalue to handle more cases where having written a
reference into the source implies that the expression is an lvalue
(e.g., function calls, C++ casts).
- Make GRExprEngine::VisitCall treat the call arguments as lvalues when
they are being bound to a reference parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
49badde06e066d058d6c7fcf4e628a72999b65a9 27-Oct-2008 Douglas Gregor <dgregor@apple.com> Refactor the expression class hierarchy for casts. Most importantly:
- CastExpr is the root of all casts
- ImplicitCastExpr is (still) used for all explicit casts
- ExplicitCastExpr is now the root of all *explicit* casts
- ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
- CXXFunctionalCastExpr inherits from ExplicitCastExpr
- CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
- Added classes CXXStaticCastExpr, CXXDynamicCastExpr,
CXXReinterpretCastExpr, and CXXConstCastExpr to

Also, fixed returned-stack-addr.cpp, which broke once when we fixed
reinterpret_cast to diagnose double->int* conversions and again when
we eliminated implicit conversions to reference types. The fix is in
both testcase and SemaChecking.cpp.

Most of this patch is simply support for the renaming. There's very
little actual change in semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6594a701dc5da3a84573ed0a02b8d13593b8cf92 27-Oct-2008 Steve Naroff <snaroff@apple.com> Replace common diagnostic with a convenience function.
This simplifies debug of this particular diagnostic (and removes some code clutter).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
971c4fae6092976338b755af1d47dac07c8f16e3 24-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6cbd3df095ab92e0637265e88fe9c093135cdb03 24-Oct-2008 Douglas Gregor <dgregor@apple.com> PR2942: FunctionDecls by typedef crash the C++ front-end

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f1af6a70c3060f7eda67da0bfe10f57966fd8073 23-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Restrict creation of OverloadedFunctionDecl only to C++ (it was getting used for invalid redeclarations on C).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
3b0db908ebd07eaa26bc90deba5e826de00fe515 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Implement #pragma pack use in structure packing. The general approach
is to encode the state of the #pragma pack stack as an attribute when
the structure is declared.

- Extend PackedAttr to take an alignment (in bits), and reuse for
both __attribute__((packed)) (which takes no argument, instead
packing tightly (to "minimize the memory required") and for #pragma
pack (which allows specification of the maximum alignment in
bytes). __attribute__((packed)) is just encoded as Alignment=1.

This conflates two related but different mechanisms, but it didn't
seem worth another attribute.

- I have attempted to follow the MSVC semantics as opposed to the gcc
ones, since if I understand correctly #pragma pack originated with
MSVC. The semantics are generally equivalent except when the stack
is altered during the definition of a structure; its not clear if
anyone does this in practice. See testcase if curious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4cde927072a70f3156d72c6431e7a5d95bf62366 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Sema implementation of #pragma pack stack.
- Follows the MSVC (original) implementation, including support of
pack(show) (useful for testing).
- Implements support for named pack records which gcc seems to
ignore (or implements incorrectly).
- Not currently wired to anything, only functionality change is the
type checking of the pragma.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
33d34a6f7a65be1821ab31c7d08b8e9f36d8759c 12-Oct-2008 Chris Lattner <sabre@nondot.org> silence some release-assert warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
506ff88f44562df267b6a06608ab841b76df2a2b 06-Oct-2008 Chris Lattner <sabre@nondot.org> Make sema and codegen allow __builtin___CFStringMakeConstantString as a valid
constant lvalue. Implement this in codegen by moving the code out of CGBuiltin
into EmitConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
45b6b9d080ac56917337d73d8f1cd6374b27b05d 06-Oct-2008 Chris Lattner <sabre@nondot.org> Add a Expr::isEvaluatable method, eliminate isBuiltinConstantExpr
which is checking for something that can be inconsistent with
what we can constant fold.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
46cfefa8a4e486ee6a9b8960f232237bf7a4b1f9 06-Oct-2008 Chris Lattner <sabre@nondot.org> "Enhance" CheckArithmeticConstantExpression to accept ?: with a constant
condition as a constant even if the unevaluated side is a not a constant.
We don't do this when extensions are off, and we emit a warning when this
happens:

t.c:22:11: warning: expression is not a constant, but is accepted as one by GNU extensions
short t = __builtin_constant_p(5353) ? 42 : somefunc();
^ ~~~~~~~~~~

suggestions for improvement are welcome. This is obviously horrible, but
is required for real-world code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7d076643e77a941cd1e53ed4a328df64c88140a5 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Merge postfix attributes on record decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
0eb07bfde0deedcb35cf3d118b3488f5d8db32ec 03-Oct-2008 Steve Naroff <snaroff@apple.com> Add getTypeSpecStartLoc() to VarDecls and FunctionDecls.

This is a temporary solution to help with the block rewriter (though it certainly has general utility).
Once DeclGroup's are implemented, this SourceLocation should be stored with it (since it applies to all the decls).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ae3f4919e4805f59c554d39cb9cd3a601809b2cb 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Builtins.def attribute for "can be a constant expression".
- Enabled for builtins which are always constant expressions
(__builtin_huge_val*, __builtin_inf*, __builtin_constant_p,
__builtin_classify_type, __builtin___CFStringMakeConstantString).

Added Builtin::Context::isConstantExpr.
- Currently overly simply interface which only works for builtins
whose constantexprness does not depend on their arguments.

CallExpr::isBuiltinConstantExpr now takes an ASTContext argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8af6a451ea075de1c9ec7cea0cd59f13cfc53adf 02-Oct-2008 Steve Naroff <snaroff@apple.com> Changed Sema::CheckForConstantInitializer to allow global block literals.
This commit also includes some name changes in the blocks rewriter (no functionality change).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1ac6fddf6fb10441f7563fc4333c433f0d9730d0 29-Sep-2008 Steve Naroff <snaroff@apple.com> Add a random C99 comment/reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bd7eb1c3b2af5cd0a7540c79da85e2ce15a893f4 28-Sep-2008 Chris Lattner <sabre@nondot.org> Replace a comparison with a static list of builtins that was wrong (it
wasn't covering checking builtins like __builtin___vsnprintf_chk) with
a check that won't get out of date.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
094cefbcc48c6b29062fef343fa8ff78ad368713 17-Sep-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=2760.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56280 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2fe0997427d92388e66e7573f4b043e7ba285ef0 12-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add --suppress-system-warnings (on by default, use =0 to disable)
- For investigating warnings in system headers / builtins.
- Currently also enables the behavior that allows silent redefinition
of types in system headers. Conceptually these are separate but I
didn't feel it was worth two options (or changing LangOptions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
15a12d082486074662857299d837dfc29c207b1b 09-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add Sema::isDeclInScope which wraps IdentifierResolver::isDeclInScope.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2b255c4dabe6a04314e3659a0f8b61e1382ec287 09-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak implementation for allowing ObjC builtin type redefinitions.

- Replace string comparisons with pre-defined idents.
- Avoid calling isBuiltinObjCType() to avoid two checks.
- Remove isBuiltinObjCType(), since it was only used in Sema::MergeTypeDefDecl().
- Have Sema::MergeTypeDefDecl() set the new type.

This is a moidified version of an patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6f0200e9ebf7f65df74b3cf55b4319b075b244a2 08-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add ThreadSpecified bit to Decl.
- Patch from Kevin Tew.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2b345eb7832dd4ffcc91e795d8f95bdd62e9e95a 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Add comment back that Argiris pointed out that I mistakenly removed (the comments below it were stale, so I accidently removed the whole thing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4b7c98378ae0c1a3635f0b7756848b4a9923f8bc 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.

This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).

The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.

- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
addition of DeclGroups.

Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
referenced by the AST. For example:

typedef struct { ... } x;

The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
refer to it. This will be solved with DeclGroups.

- This patch also (temporarily) breaks CodeGen. More below.

High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it. When
a struct/union/class is first referenced, a RecordType and RecordDecl are
created for it, and the RecordType refers to that RecordDecl. Later, if
a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
updated to point to the RecordDecl that defines the struct/union/class.

- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
enum/struct/class/union. This is useful from going from a RecordDecl* that
defines a forward declaration to the RecordDecl* that provides the actual
definition. Note that this also works for EnumDecls, except that in this case
there is no distinction between forward declarations and definitions (yet).

- Clients should no longer assume that 'isDefinition()' returns true from a
RecordDecl if the corresponding struct/union/class has been defined.
isDefinition() only returns true if a particular RecordDecl is the defining
Decl. Use 'getDefinition()' instead to determine if a struct has been defined.

- The main changes to Sema happen in ActOnTag. To make the changes more
incremental, I split off the processing of enums and structs et al into two
code paths. Enums use the original code path (which is in ActOnTag) and
structs use the ActOnTagStruct. Eventually the two code paths will be merged,
but the idea was to preserve the original logic both for comparison and not to
change the logic for both enums and structs all at once.

- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
that correspond to the same type simply have a pointer to that type. If we
need to figure out what are all the RecordDecls for a given type we can build
a backmap.

- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
changes to RecordDecl. For some reason 'svn' marks the entire file as changed.

Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
RecordType*. This was true before because we only created one RecordDecl* for
a given RecordType*, but it is no longer true. I believe this shouldn't be too
hard to change, but the patch was big enough as it is.

I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
aa8d001787dcb67ec53bb326c8342096c2fc7fa5 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Remove stale comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
df042e6c2bf06b2d9ed53c52469599ac1bd93a3f 05-Sep-2008 Ted Kremenek <kremenek@apple.com> Remove "NextDecl" from RecordDecl. This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.

The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
33ad0120264da35db85ff8cccee5f08da6a7fbeb 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Set register storage class correctly for function parameters.
- PR2730


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a89d197c919e01ccb54d7822cc8886c373bcba00 03-Sep-2008 Ted Kremenek <kremenek@apple.com> Fix 80 col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7e8cc57bad2b670b0a3b48fa3d84dce79b5c7288 02-Sep-2008 Ted Kremenek <kremenek@apple.com> When creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the new [CXX]RecordDecl with the RecordDecl chain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b529d830b3b1667157da92ab0b5c32e1acfafbab 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2747: allow pointer->int casts with a null base; these are
offset-of-like expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6d4abe1eee550411524ca002025fdf0490eefd26 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> Backing out r55607 due to logic errors and test regression.

I'll try to come up with a correct fix for the testcase sometime soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
73419bf6cbf8e5f7a0f9b8855d6531db264ae899 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> fix one more this-is-not-a-constant error. test included

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f7e37ce8400d5ba3b0613116034aaa30e6a70b3e 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> make CheckArithmeticConstantExpression() aware of &foo and pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
491be73282d5483c2f799289ed90cc0011fde4bd 29-Aug-2008 Nico Weber <nicolasweber@gmx.de> minor cleanup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
451318c08a6342c10b8986060386fd9274418437 26-Aug-2008 Daniel Dunbar <daniel@zuster.org> Move implicit Obj-C param creation into ObjCMethodDecl.
- Add ObjCMethodDecl::createImplicitParams.
- Remove ObjCMethodDecl::set{Self,Cmd}Decl
- Remove Sema::CreateImplicitParameter

No (intended) functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
eb4b7051a596560ef4a1846e3714707f44e9dc30 25-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Do typechecking and codegen for K&R-style function declarations
correctly. Not a regression, but made more obvious by my recent fix
which made function type compatibility checking a bit more strict.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c3f07644a7846ac6fa8d952afcec7649a48213c4 25-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2720; be a little bit more permissive in initializers for
casting pointers to integers.

Eventually, we should check whether we can evaluate an expression
using Expr::tryEvaluate, and this codepath should be tightened to only
handle standard-compliant cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55331 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c5eb7311445bb14b6a26eb2ad667fe7a1ca20887 22-Aug-2008 Anders Carlsson <andersca@mac.com> Initial sema support for C++ static initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3d815e7eb56c25d7ed812eced32e41df43039f9a 22-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Rewrite type compatibility testing to do type merging rather than just
testing compatibility. This is necessary for some constructs, like merging
redeclarations.

Also, there are some ObjC changes to make sure that
typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any
ObjC code beyond the testsuite, so please tell me if there are any cases
where this doesn't behave as expected.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
01e6779faca1e3a3164c697d6e2dfee0881a6981 20-Aug-2008 Ted Kremenek <kremenek@apple.com> Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.
This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0835a3cdeefe714b4959d31127ea155e56393125 19-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):

Expr
-> CastExpr
-> ExplicitCastExpr
-> ImplicitCastExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9aa77f137b9b368f5bf46e2ab7bc7bd1d5755a5b 17-Aug-2008 Chris Lattner <sabre@nondot.org> various updates to match r54873 on mainline.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
c4a1dea2dc56bd1357ec91b829a0b9e68229a13e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
- Moved Sema::getCurMethodDecl() out of line (dependent on
ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e4858a65a93fb36c099d8dd2ea0a98e33e77687e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
implementation .cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d4d46cd61673202d6c32c51a8bc0abc937bff808 10-Aug-2008 Steve Naroff <snaroff@apple.com> Cleanup from yesterday...make isTentativeDefinition() a static helper function (no need for it to be part of the Sema API).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f855e6fbebb718a1cca75ec2efba12f3583fe614 10-Aug-2008 Steve Naroff <snaroff@apple.com> Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d9f6910f4ef37c0e8eeee2a01287d9572c3176ef 10-Aug-2008 Chris Lattner <sabre@nondot.org> rename PreDefinedExpr -> PredefinedExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
907747b3a67a41420ead8ef1fc5e6bd9dc9e0ad9 09-Aug-2008 Steve Naroff <snaroff@apple.com> Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate.

Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
ff9eb1fe0a16a34c355db0d1bc4a9d0f7a276c73 08-Aug-2008 Steve Naroff <snaroff@apple.com> Fix issues with C "tentative" definitions.

- Move checking from MergeVarDecl->FinializeDeclaratorGroup. Since MergeVarDecl is called before the initializer is attacted, it can't be done there (this removes a long standing FIXME).
- Add Sema::isTentativeDefinition() and Sema::CheckForFileScopedRedefinitions().
- Remove FIXME's and touch-up test case.

Still some more work to do (forthcoming)...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
02408c67c404267a23ee1e1ab23344fc4b1bff17 07-Aug-2008 Steve Naroff <snaroff@apple.com> Sema::ActOnEnumBody(): handle nested enum redefinitions.
Fixes <rdar://problem/6093889> Nested enum redefinition crashes sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
a735ad8be5536a1cd3e9817ec27dfeb2a0c1d5ca 06-Aug-2008 Daniel Dunbar <daniel@zuster.org> Implement GNU asm-label extension support in CodeGen. This fixes
scimark2 on Darwin.

- Added Sema support for asm-label on variables, which I forgot before.

- Update CodeGen to use GlobalDeclMap to determine if static Decls
require emission (instead of LLVM module name lookup). Important
since the Decl name and the LLVM module name can differ.

- <rdar://problem/6116729>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
c63a1f276f7b324fd9a4be82098b1c8f7bf30733 04-Aug-2008 Chris Lattner <sabre@nondot.org> Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.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/SemaDecl.cpp
99cb9976efe84f44b3b1957c4fe042dae366b989 25-Jul-2008 Chris Lattner <sabre@nondot.org> Reject typedef redefinitions when the underlying types are not identical,
even if in a system header etc. rdar://6079937



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
394f3f483fa4e7b472630cfcd03f7840520958c5 25-Jul-2008 Steve Naroff <snaroff@apple.com> Move fix in r54013 from the parser to sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b8db21d4df5fbb6ce1ace6411b82d3d623d789de 23-Jul-2008 Ted Kremenek <kremenek@apple.com> When constructing an ObjCIvarDecl object in Sema, provide its visibility up front instead of setting it afterwards.
This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7caeabd868d46cf4e68478c6e9136dae4e735d21 22-Jul-2008 Chris Lattner <sabre@nondot.org> minor cleanup to the actions interface to pass around SmallVectorImpl instead
of a specific smallvector size.

Fix protocol lists to pass down proper location info, so we get diagnostics
like this:

t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^

instead of this:

t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^


Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
90eb539bc3121bdc0e867ab1cd6bdca3b36d961e 17-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Unify ctx_iterator/ctx_begin()/ctx_end() and iterator/begin()/end() so that a single iterator type is used for both traversing decls of the same declaration context *and* of the parent declaration contexts, depending on the value of the bool parameter 'LookInParentCtx' that is passed to IdentifierResolver::begin().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0ff12f078c70acad7ef18cb4906d17a203d2267a 16-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> When in C++, make EnumConstant names hide tag names in the same scope, instead of colliding with them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8f3b2654a9ff6912862f366102f5c46f7757260a 16-Jul-2008 Steve Naroff <snaroff@apple.com> Two fixes:
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b02ef242c76f718a33ec3d9e42f9dbabaf5856b9 16-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> When checking for name collision between a tag and a previously defined namespace, the collision occured even when the tag was in a different nested scope.
Fix it by taking into account the scope when checking for namespace-tag name collisions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
cf0f51d10f01065bd7bc3ffe77e18c30dcbdbea3 11-Jul-2008 Chris Lattner <sabre@nondot.org> rename "SInt" methods to "Int" in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f8396b6b58b423e7078dcda9092a065f9a4ba53a 09-Jul-2008 Chris Lattner <sabre@nondot.org> Add parser support for __builtin_stdarg_start, PR2531


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9a979c327c442597c6a9cee961336530460fed04 07-Jul-2008 Nuno Lopes <nunoplopes@sapo.pt> fix CheckForConstantInitializer() for Compound Literals
also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c44eec6dd29ee9415cbd38a35deff4c8b67abb6a 03-Jul-2008 Anders Carlsson <andersca@mac.com> Shuffle things around in preparation for integrating Eli's constant evaluator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
14943b90d99d6f695a4aee70c5d26086639261c5 03-Jul-2008 Chris Lattner <sabre@nondot.org> Fix PR2020 by recovering by defining an anonymous enum, instead of recovering
by filling in the body of a union with enum constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
3ff30c8e6eaf995c0f969890b48cab15bae4d519 29-Jun-2008 Chris Lattner <sabre@nondot.org> move some code from all callers of ProcessDeclAttributes into
the implementation of ProcessDeclAttributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f2e4bd51aa7dc095cefcbcfec573d6bb29f04c5a 29-Jun-2008 Chris Lattner <sabre@nondot.org> more attribute refactoring/renaming, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
53d0ea5f5bfa647ec23418bf3a3b7c183b51e4bd 28-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6b6b5372f4b60b1c5ee101709e71a04642c835f4 26-Jun-2008 Chris Lattner <sabre@nondot.org> move decl attribute processing to a new SemaDeclAttr.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
985abd958d83e4f109a15451440f1d008ae45f59 26-Jun-2008 Chris Lattner <sabre@nondot.org> Make Declarator::getDeclSpec() return a const reference to avoid
cases where mutation can introduce bugs. Propagate around 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d546fc5f2072d93bb475fdd76cd7b629a08ad93b 26-Jun-2008 Chris Lattner <sabre@nondot.org> add a comment about something that was surprising, at least to me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fca0ddd42965e0b7ae821213486d4e0dd71fb439 26-Jun-2008 Chris Lattner <sabre@nondot.org> fix a bug handling type attributes in the declspec. declspec processing
used to mutate the attribute list for declspecs when the type was
converted, breaking the case where one declspec was shared by multiple
declarators.

This fixes rdar://6032532.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
18ae3cfe2a3ba43519ccd2f665892014c64e8d4a 21-Jun-2008 Chris Lattner <sabre@nondot.org> Don't add isa with @defs only to work around it in the code generator, patch
by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
5a6ddbf295d2ea1c28cfb67d82db22f3893ede6f 21-Jun-2008 Chris Lattner <sabre@nondot.org> add parser and sema support for the funny ObjC '@defs' thing.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4111024be81e7c0525e42dadcc126d27e5bf2425 17-Jun-2008 Chris Lattner <sabre@nondot.org> Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
54ecfce94bc96947ec2059d35920a9eea3ca8569 11-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Don't crash if we can't find FileEntry info for a typedef, since one
isn't guaranteed to exist. This fixes a crash with conflicting typedefs
coming from stdin.

This also fixes the crash in PR2406, but doesn't completely fix the
issue; it appears there's something strange about the physical location
for the definition of int64_t in stdlib.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7643536c36b0449256d5ee2efc03a7e4a784a0b3 10-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Add DeclChain member to DeclContext.
-ScopedDecls get chained to their DeclContext.
-DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
4caf055b9f08416d956590358796a1ed464b73f7 09-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Add code to make test/CodeGen/struct-init.c work correctly without the
pointer cast hack currently in isIntegerConstantExpr
(in lib/AST/Expr.cpp). Also removes an odd test that even gcc doesn't accept.

The reason the pointer cast hack is relevant here is that it makes Sema
end up misinterpreting the relevant expression as a null pointer constant.

The reason for this patch is that I plan to remove the pointer cast hack
sometime soon because it causes strange issues, especially in its
current form; see my recent email to cfe-dev
"[PATCH] add constant expression evaluation to the AST and fix PR2413".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
d4cbda6292b321c2e7dce7f039d92918fee99b3a 08-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> implement the alias attirbute (in both Sema and Codegen)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6f058fa6df30e7d68d1fbabcc363d21da41cd5f 06-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Clean up dead code from SemaInit landing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1b76ada683bcec33799fd0eb114aaad3e1d04ca9 03-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Re-fix r51907 in a way which doesn't affect valid code. This essentially
moves the check for the invalid construct to a point where it doesn't
affect other uses of isIntegerConstantExpr, and we can warn properly
when the extension is used. This makes it a bit more complicated, but
it's a lot cleaner.

Steve, please tell me if this check is sufficient to handle the
relevant system header. I know it's enough to handle the testcase, but
I don't know what exactly the original looks like.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9141bee299a05349924a34a7153d7064c9e0a107 02-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> fix decl attributes cleaning
this plugs the leak of attributes and also fixes a crash in the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c1cc6dccd42b91a2ebb397415940da91dbf36103 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Allow a pointer implicitly cast to a bool as a constant expression, as
required by the standard (the standard doesn't know anything about
implicit casts).

Disallow pointers cast to non-integral arithmetic types as constant
expressions. This was previously allowed by accident.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2742496d75ecb733c07c65c9a35cbfaa88ca81e4 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Don't swap function decls, and add them to the scope as they are
encountered. Mixing up the decls is unintuitive, and confuses the AST
destruction code. Fixes PR2360.

Note that there is a need to look up the characteristics and
declarations of a function associated with a particular name or decl,
but the original swapping code doesn't solve it properly.
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one
suggestion for how to fix that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3c0eb160ca1361a82b9f15b3b40a2425adc14d0f 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Implementation of gcc mode attribute; this is significant because
it fixes PR2204. Not too much to say about the implementation; it works
in a similar way to the vector size attribute.

At some point, we need to modify the targets to provide information
about the appropriate types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
2d05c088407596c0ddefd023c89ba872220724e2 23-May-2008 Ted Kremenek <kremenek@apple.com> Revert r51498: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=51498&r1=51497&r2=51498&view=diff

Turns out that there are multiple places where a redefinition diagnostic can be emitted. A cleaner solution (without touching Sema) is to have
the Driver turn off these diagnostics. (will submit this patch soon)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9547f5938b88934e0242e4cc7194433d187cb967 23-May-2008 Steve Naroff <snaroff@apple.com> Remove a diagnostic (temporary hack that will be removed next week).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
6d1e4b5e7e80228a1f892824c405ba6a1c3c89b6 22-May-2008 Eli Friedman <eli.friedman@gmail.com> Patch for PR2350; the issue was tnat we were allowing (with an error)
void f(const void) in one place and rejecting it in another.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
4f8d123e3e2c260de3377208106ddba87cee28b4 22-May-2008 Dan Gohman <gohman@apple.com> Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
97c0a391138d20e1066174a9cfa92860fb06e5a1 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix a couple of bugs found by Neil Booth in the const-ness checking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1e60e3b526ca71a04209bff6217b6d6eb9be0de6 20-May-2008 Nuno Lopes <nunoplopes@sapo.pt> initialize variable and fix a bunch of test failures

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c594b323555820a7088fb6d0af1803beccc86c44 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Perform stricter/more accurate checking for C99 constant expressions
in Sema, per discussion on mailing list. This doesn't cause any changes
in the test results. I'll probably add some more tests at some point,
but it's an open question what we need to accept to be compatible with
real code.

This doesn't touch the existing isConstantExpr method on Expr; that
should be addressed somehow eventually (either removed or refined to
whatever is appropriate).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c56c977f44d0bd8422a6f0fe87f361cbb728c06b 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Switch on SemaInit; this makes some code in SemaDecl dead, but I'll give
it a few days to make sure there aren't any significant regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
235549c7bda856c26cff68190860f69760fa576d 13-May-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.

Teach Sema::MergeVarDecl() about __private_extern__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
72786e009bd0519882ceac874e618134d2200d95 09-May-2008 Ted Kremenek <kremenek@apple.com> Add attribute "format" support for typedefs of function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fc5845234158807d30075131ef603ebacbc790be 09-May-2008 Nate Begeman <natebegeman@mac.com> Handle all attributes on a parameter


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
abb575866059c9bb74fe4aa32372f002143fa87c 09-May-2008 Chris Lattner <sabre@nondot.org> Fix rdar://5921025 a crash on the included testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c5f551f06c3ac27826e3e5a7a29851fc5182f912 08-May-2008 Ted Kremenek <kremenek@apple.com> Added initial support for supporting __NSString__ in attribute "format".
Still need to iron out some of the semantics (fixmes are present).
This addresses <rdar://problem/5916348>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
95e2c71181c7ec1ffea0066bbae49e8742bd0687 06-May-2008 Chris Lattner <sabre@nondot.org> Fix rdar://5905347 a crash on invalid builtin, due to the
params not getting installed for builtins when synthesized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
37d1084efc3d0855c86400b20c00e22c308365c5 05-May-2008 Chris Lattner <sabre@nondot.org> Add support for -Wimplicit-function-declaration, rdar://5907433


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

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
93213bb42c7ff7a2cef40c8c037f225844513443 01-May-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implicitly defined functions were getting the DeclContext of the function where they appeared, causing the bug: http://llvm.org/bugs/show_bug.cgi?id=2266.
Fix it by making implicitly defined functions get the DeclContext of translation unit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
226249424893f9375ab4e5dabb4d2d9677263835 30-Apr-2008 Chris Lattner <sabre@nondot.org> fix 'var unused' warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
27ae6c6531ac13e4b316e7e0e7b7c846b61a8d15 25-Apr-2008 Nuno Lopes <nunoplopes@sapo.pt> initial support for recognizing __transparent_union__ attributes
comments on the ML will follow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
9fdf9c6d3530bb85f3166e6460d841e2ff8e1a2c 22-Apr-2008 Chris Lattner <sabre@nondot.org> "This patch renames

DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC

It makes the code more consistent."

Patch by Zhongxing Xu!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f009795057dc8ca254f5618c80a0a90f07cd44b4 21-Apr-2008 Douglas Gregor <dgregor@apple.com> Clean up handling of function redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
213541a68a3e137d11d2cefb612c6cdb410d7e8e 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
59b6d5ae1c42515340a48040f6ff576a6f48a9c3 19-Apr-2008 Nuno Lopes <nunoplopes@sapo.pt> fix __attribute__(format) for struct function pointer fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ff898cd0b0c9fcbad1033e0278b54a4cc7108d05 17-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use TranslationUnitDecl as DeclContext of builtin functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
ef177820100ab583b08fd3056e2a5a52ee4b1629 17-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Addition of TranslationUnitDecl to the AST:

-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
2ce52f3fb95bf544db6bd3d91a72bce7d9cceb6c 13-Apr-2008 Douglas Gregor <dgregor@apple.com> Introduce support for finding class and enum names via ordinary name lookup in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
99dc91422144483c20d1c7381bc9ac634b646b04 13-Apr-2008 Chris Lattner <sabre@nondot.org> This patch is just the easy part of the class names patch, which
allows the parsing of "class" in addition to "struct" and "union" to
declare a record. So this patch allows:

class C { };
class C c1;

But it does not contain the lookup bits, so this won't work yet:

C c2;

Patch by Doug Gregor!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
87f3ff0c27be71cfd0eaf4628eb64538e84ee6ce 12-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Added PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and the Scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
45bc03f9202d5649fd41f35b98d34bb34823d0f3 11-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Minor changes per Chris L's review.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
7f925cc1071117ebe3191db33bbdfd706af297e9 11-Apr-2008 Chris Lattner <sabre@nondot.org> Switch sema to maintaining its own scope chain information for variable
shadowing, instead of threading it through the AST. This patch contributed
by Argiris Kirtzidis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
1d78cc443084134428c4c333fab25148900c3ca4 11-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Patch for:
1) objc ivar processing is split out of ActOnField into its own ActOnIvar method.
2) the new objc ivar action takes visibility info directly, eliminating
AllVisibilities in ParseObjCClassInstanceVariables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
def026a193b8218a58d112414515cb87fdf89c15 10-Apr-2008 Chris Lattner <sabre@nondot.org> typedef void T;
void f(T);

is only invalid in C++ mode, not C89 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.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/SemaDecl.cpp
04421087832a031c90bd58f128c7c0e741db8dd2 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8bcfc5bef434d7052e28d0ce45182855659ebd3d 07-Apr-2008 Chris Lattner <sabre@nondot.org> remove the Decl::getCanonicalType() method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f52ab250ff92bc51a9ac9a8e19bd43b63a5f844f 07-Apr-2008 Chris Lattner <sabre@nondot.org> Start switching clients over from CT.getCanonicalType() to Context.getCanonicalType(CT) for PR2189.

While I'm at it, clean up a bit of maxIntegerType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b048c9835969c4f7fe06264748be18ed4b442116 06-Apr-2008 Chris Lattner <sabre@nondot.org> This patch contains these changes:

-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl

Patch by Argiris Kirtzidis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e2ef815de1da36c1ad1494cb58ce37adac1efa26 04-Apr-2008 Steve Naroff <snaroff@apple.com> Add explicit support for diagnosing implicit function decls.
Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0ed844b04ea4387caa4e1cf3dc375d269657536b 04-Apr-2008 Chris Lattner <sabre@nondot.org> Introduce ContextDecl, patch by Argiris Kirtzidis!

-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
3110251f13981689f384eb3c0aba2afffea18d9d 02-Apr-2008 Steve Naroff <snaroff@apple.com> Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.

I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
b327ce02959d4e6224732e1c362e7f8e0688581f 02-Apr-2008 Steve Naroff <snaroff@apple.com> Two changes to Sema::LookupDecl() interface.
(1) Remove IdLoc (it's never used).
(2) Add a bool to enable/disable lazy builtin creaation (defaults to true).

This enables us to use LookupDecl() in Sema::isTypeName(), which is also part of this commit.

To make this work, I changed isTypeName() to be a non-const member function. I'm not happy with this, however I fiddled with making LookupDecl() and friends const and it got ugly pretty quickly. We can certainly add it back if/when someone has time to fiddle with it. For now, I thought this simplification was more important than retaining the const-ness.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e6327747b72bb687c948270f702ff53c30f411a6 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix several bugs in array -> pointer decomposition.

First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.

Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.

Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").

This adds an ASTContext::getArrayDecayedType member that handles the
non-trivial logic for this seemingly simple operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
fd89bc825026e44c68a68db72d4012fd6752e70f 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix PR2017 and silence some bogus errors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c822ff47d29eb3888796145dbc58d17f747a1e61 02-Apr-2008 Steve Naroff <snaroff@apple.com> Fix a comment typo and add a couple suggestions from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
e8043c39176e7f253fbd92982b077eca6bf2fd59 02-Apr-2008 Steve Naroff <snaroff@apple.com> Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).

- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.

Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
c5e2f34df1c545f792e750d564ee58368197ae62 26-Mar-2008 Steve Naroff <snaroff@apple.com> Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8c1a9a80ba2e200f9180867e133563b15223dca2 26-Mar-2008 Nuno Lopes <nunoplopes@sapo.pt> allow the format attribute to be specified in function pointer prototypes
# this is my first commit here, so please be gentle :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8e7dafec4b70303dfaff95151cd06bfc5532720c 25-Mar-2008 Nate Begeman <natebegeman@mac.com> Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
657aefe011bea7bda36771c07bd5cd8f82a82112 20-Mar-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=2161.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
f962808120bd4cf1c684a0936fa1791ce2be73be 16-Mar-2008 Chris Lattner <sabre@nondot.org> hoist a bunch of casting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
0e77ba0bf769e2e5a4a93c079f241b02aeb3ef93 16-Mar-2008 Chris Lattner <sabre@nondot.org> Add create methods for ObjCIvarDecl and ObjCInterfaceDecl


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
8e25d8681822d8094bfeb97b2239363552548171 16-Mar-2008 Chris Lattner <sabre@nondot.org> switch the rest of the C decl classes to do their
allocation through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaDecl.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


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