Граф коммитов

5549 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 4654241866 When we're calling a function that we know based on its K&R-style
function definition, we should still use a prototype to type-check and
convert the function arguments, if such a prototype exists. Fixes
PR8314.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 20:39:23 +00:00
David Chisnall e8a2d4c32c Only warn for mismatched types in Objective-C methods when they are incompatible, not when they are simply different. Now we test whether the difference in types breaks the principle of substitutability, rather than whether they are different.
A common idiom in Objective-C is to provide a definition of a method in a subclass that returns a more-specified version of an object than the superclass.  This does not violate the principle of substitutability, because you can always use the object returned by the subclass anywhere that you could use the type returned by the superclass.  It was, however, generating warnings with clang, leading people to believe that semantically correct code was incorrect and requiring less accurate type specification and explicit down-casts (neither of which is a good thing to encourage).

This change ensures that any method definition has parameter and return types that make it accept anything that something conforming to the declaration may pass and return something that the caller will expect, but allows stricter definitions.  



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 17:23:52 +00:00
Chandler Carruth 428edafa9e Improve the tracking of source locations for parentheses in constructor calls.
This adds them where missing, and traces them through PCH. We fix at least one
bug in the extents found by the Index library, and make a lot of refactoring
tools which care about the exact formulation of a constructor call easier to
write. Also some minor cleanups to more consistently follow the friend pattern
instead of the setter pattern when rebuilding a serialized AST.

Patch originally by Samuel Benzaquen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 08:47:36 +00:00
Douglas Gregor 77a1a8868e C++ [basic.scope.hiding] allows an ordinary name to hide a non-tag
name *in the same scope*, but not across scopes. Implement the
highlighted condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23 16:06:17 +00:00
Anders Carlsson 2127eccbe1 Warn if a variable marked with the "unused" attribute is used. Patch by Darin Adler!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 23:37:08 +00:00
John McCall 5b629aa86c 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
2010-10-22 23:36:17 +00:00
Douglas Gregor f17b58c98b In the presence of using declarations, we can find the same class
members in class subobjects of different types. So long as the
underlying declaration sets are the same, and the declaration sets
involve non-instance members, this is not an ambiguity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 22:08:47 +00:00
Douglas Gregor fe7574b3ad When performing name lookup for a namespace definition, only look into
the current context's redeclaration context, ignoring using
directives. Fixes PR8430.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 15:24:46 +00:00
Ted Kremenek 788f489a37 Tweak diagnostics for redeclaration of a @property in a class extension where the redelcaration and original
declaration have the 'readwrite' attribute.  This is a common case, and we can issue a more lucid diagnostic.

Fixes <rdar://problem/7629420>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 18:49:42 +00:00
Ted Kremenek ee1c08c886 Tidy up comment (remove extraneous text).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 18:49:36 +00:00
Douglas Gregor 0b8ddb9a47 Implement the integral promotion rules for the C++0x char16_t and
char32_t character types and enable built-in overloaded operator
candidates for these types. Fixes PR8432.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 18:04:08 +00:00
Douglas Gregor 369ea27b56 Diagnose the declaration of template template parameters that
themselves have no template parameters. This is actually a restriction
due to the grammar of template template parameters, but we choose to
diagnose it in Sema to provide better recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 17:26:49 +00:00
Douglas Gregor 0bab54cf82 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
2010-10-21 16:57:46 +00:00
Douglas Gregor 9ee5ee84f0 When checking whether a return statement returns a stack-local
variable, handle conditional operators involving a
throw-expression. Fixes GCC DejaGNU's g++.dg/template/cond4.C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 16:21:08 +00:00
Ted Kremenek 4d8ae4d57e Previously, the printf warnings would say your arguments type was 'int' when it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.

Patch by Justin Bogner!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 04:00:58 +00:00
Craig Silverstein b41d899a60 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
2010-10-21 00:44:50 +00:00
John McCall aa56a66abb Access control polish: drop the note on the original declaration and
say 'implicitly' when it was implicit.  Resolves PR 7930 and my peace of mind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 08:15:06 +00:00
John McCall 4e2cbb28ba When matching template parameter lists to template-ids in a scope specifier
on a friend declaration, skip template-ids which do not depend on the
current parameter list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 05:44:58 +00:00
Douglas Gregor 9a632eaa0e Fix handling of property and ivar lookup in typo correction; the two
kinds of lookup into Objective-C classes were tangled together, a
situation that was compounded by automatically synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 03:06:34 +00:00
Douglas Gregor 3eedbb06dd Introduce a simple cache for unqualified typo corrections, so that we
don't repeatedly loop through identifiers, correcting the same typo'd
identifier over and over again. 

We still bail out after 20 typo corrections, but this should help
improve performance in the common case where we're typo-correcting
because the user forgot to include a header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 01:32:02 +00:00
Douglas Gregor f98402d9e6 Eliminate another ordering dependency in typo correction. Re-enable typo.m, which seems to be working properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 01:01:57 +00:00
Douglas Gregor a1194775dc Provide an upper bound to the edit-distance algorithm when performing
typo correction, to allow early exits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 22:14:33 +00:00
Douglas Gregor 362a8f21a6 Improve the performance of typo correction, by using a simple
computation to compute the lower bound of the edit distance, so that
we can avoid computing the edit distance for names that will clearly
be rejected later. Since edit distance is such an expensive algorithm
(M x N), this leads to a 7.5x speedup when correcting NSstring ->
NSString in the presence of a Cocoa PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 19:39:10 +00:00
Fariborz Jahanian 43e1b46d64 Fixes a bug in ivar lookup in the new objc's default
property synthesis mode, when dealing with legacy code.
Fixes //rdar: //8565343.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 19:08:23 +00:00
Fariborz Jahanian 4c73307c74 This patch implements Next's IRGen for -fconstant-string-class=class-name.
PR6056, //rdar: //8564463



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 17:19:29 +00:00
Douglas Gregor 102ff97bc5 When marking declarations referenced within an expression (e.g.,
within a default argument), recurse into default arguments. Fixes
PR8401, a regression I introduced in r113700 while refactoring our
handling of "used" declarations in default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 17:17:35 +00:00
John McCall c54d688c60 When instantiating a dependently-scoped friend function declaration,
we may need to complete the type before looking into it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 05:01:53 +00:00
John McCall 4eab39f074 Instantiate enclosing template parameter lists when instantiating friends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 02:26:41 +00:00
John McCall 613ef3d4c1 Uncomputable contexts are always records but can exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 01:54:45 +00:00
John McCall 9a34edb710 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
2010-10-19 01:40:49 +00:00
Douglas Gregor a5450a097e Fix the translation of the PCC_ForInit code-completion context for
C++/C99/Objective-C, so that we properly include types. This fix
affects global caching of code-completion results; without caching,
the behavior was already correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116757 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 22:01:46 +00:00
Douglas Gregor c7b7b7a8ed Introduce code completion results for Objective-C methods, both when
declaring methods and when sending messages to them, by bringing all
of the selector into TypedCheck chunks in the completion result. This
way, we can improve the sorting of these results to account for the
full selector name rather than just the first chunk.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 21:05:04 +00:00
Douglas Gregor ea76618ced When providing code completions of Objective-C method declarations
(after - or +), always traverse superclasses and all categories. The
programmer may want to complete a method from *anywhere*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 18:21:28 +00:00
Anders Carlsson 693d467ed4 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
2010-10-18 16:24:27 +00:00
Francois Pichet 842e7a22c6 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
2010-10-18 15:01:13 +00:00
Anders Carlsson 4d09e84fbb 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
2010-10-17 23:36:12 +00:00
John McCall be04b6df36 Reformatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 07:23:36 +00:00
John McCall 6102ca1d49 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
2010-10-16 06:59:13 +00:00
Douglas Gregor c6eddf50bf 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
2010-10-15 23:53:28 +00:00
Fariborz Jahanian 0313f441b7 Check for ivar being a C++ object before attempting to
find a copy constructor/assignment operator used
in getter/setter synthesis. This removes an unintended
diagnostics and makes objc++ consistant with objective-c.
// rdar: //8550657.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 22:42:59 +00:00
Nick Lewycky 3d6c45d8f8 Report the location of the syntax error inside a macro. Fixes PR7944.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 21:43:24 +00:00
Douglas Gregor 6eaac8b3e6 When performing typo correction, keep track of whether the last lookup
we did was an acceptable lookup. If it is, then we can re-use that
lookup result. If it isn't, we have to perform the lookup again. This
is almost surely the cause behind the mysterious typo.m failures on
some builders; we were getting the wrong lookup results returned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 16:49:56 +00:00
Douglas Gregor 7b824e854b When we're in the context of an Objective-C message send's receiver,
typo correction prefers "super" over other, equivalent completions. I
believe this will fix the regression on the buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116574 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 13:35:25 +00:00
Douglas Gregor a6e937ce32 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
2010-10-15 13:21:21 +00:00
Gabor Greif c5127edaec fix http://llvm.org/PR8371 in the straightforward way, also adding a comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 08:26:25 +00:00
John McCall b6bbcc9995 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
2010-10-15 04:57:14 +00:00
Douglas Gregor 66c42d4439 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
2010-10-15 01:21:46 +00:00
Douglas Gregor 5a1f97ee18 Add builtin conditional operator candidates for scoped enumeration
types, from Alp Toker! Fixes PR8344.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 00:50:56 +00:00
John McCall 8a407370c3 template-ids are looked up differently in friend declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 22:22:28 +00:00
Douglas Gregor 95f4292cc5 When performing typo correction, look through the set of known
identifiers to determine good typo-correction candidates. Once we've
identified those candidates, we perform name lookup on each of them
and the consider the results. 

This optimization makes typo correction > 2x faster on a benchmark
example using a single typo (NSstring) in a tiny file that includes
Cocoa.h from a precompiled header, since we are deserializing far less
information now during typo correction.

There is a semantic change here, which is interesting. The presence of
a similarly-named entity that is not visible can now affect typo
correction. This is both good (you won't get weird corrections if the
thing you wanted isn't in scope) and bad (you won't get good
corrections if there is a similarly-named-but-completely-unrelated
thing). Time will tell whether it was a good choice or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 22:11:03 +00:00
Douglas Gregor 708f3b8e35 Make sure that we diagnose invalid qualifiers on friend functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 22:03:51 +00:00
Fariborz Jahanian fa432391a7 Put line number on the diagnostic. //rdar: //8550657.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 21:30:10 +00:00
Douglas Gregor e24b575f06 Tweak the typo-correction implementation to determine corrections
solely based on the names it sees, rather than actual declarations it
gets. In essence, we determine the set of names that are "close
enough" to the typo'd name. Then, we perform name lookup for each of
those names, filtering out those that aren't actually visible, and
typo-correct from the remaining results.

Overall, there isn't much of a change in the behavior of typo
correction here. The only test-suite change comes from the fact that
we make good on our promise to require that the user type 3 characters
for each 1 character corrected. 

The real intent behind this change is to set the stage for an
optimization to typo correction (so that we don't need to deserialize
all declarations in a translation unit) and future work in finding
missing qualification ("'vector' isn't in scope; did you mean
'std::vector'?). Plus, the code is cleaner this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 20:34:08 +00:00
Argyrios Kyrtzidis 3b8f610ac9 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
2010-10-14 20:14:21 +00:00
Fariborz Jahanian 8ac2d44982 Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 16:04:05 +00:00
John McCall 008df5dce3 Whoops. This really shouldn't compile in clang, either.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 02:06:32 +00:00
John McCall 1e030eb119 Perform range restrictions on regparm when applied to a type and
not a decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 01:57:10 +00:00
Douglas Gregor a6c1e3a56a 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
2010-10-13 22:55:32 +00:00
Douglas Gregor 922fff2c9e 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
2010-10-13 22:19:53 +00:00
Douglas Gregor 6b0656a7c3 Eliminate the use of ObjCSuperExpr in code completion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 21:24:53 +00:00
Douglas Gregor 7d520baec9 There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even
though the standard requires it. GCC/EDG do not require a complete
type here, so we're calling this a problem with the standard. Fixes
PR8328.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 20:41:14 +00:00
Douglas Gregor db4d4bb03d Introduce a bit into Type that keeps track of whether there are any
unnamed or local types within that type. This bit is cached along with
the linkage of a type, so that it can be recomputed (e.g., when we see
that a typedef has given a name to an anonymous declaration).

Use this bit when checking C++03 [temp.arg.type]p2, so that we don't
walk template argument types repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 18:05:20 +00:00
Douglas Gregor b535041ee3 Fix a silly bug in the suppression of non-error diagnostics in a
SFINAE context, where we weren't getting the right diagnostic argument
count. I blame DiagnosticBuilder's weirdness. Fixes PR8372.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116411 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 17:22:14 +00:00
Fariborz Jahanian 7b1ec6c478 Eliminates a clang warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 16:19:16 +00:00
John McCall 380aaa4421 Preserve the original scope when picking the right scope for a friend
declaration, because we'll need it later.  Hopefully fixed self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 06:22:15 +00:00
John McCall 29ae6e5fb0 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
2010-10-13 05:45:15 +00:00
Douglas Gregor 5f3aeb6f8b Teach the warning about unnamed/local types in template arguments to
actually walk the template argument type to find any unnamed/local
types within it. Fixes PR6784.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 00:27:52 +00:00
Douglas Gregor 9b62363937 Introduce support for emitting diagnostics (warnings + their notes)
that are suppressed during template argument deduction. This change
queues diagnostics computed during template argument deduction. Then,
if the resulting function template specialization or partial
specialization is chosen by overload resolution or partial ordering
(respectively), we will emit the queued diagnostics at that point. 

This addresses most of PR6784. However, the check for unnamed/local
template arguments (which existed before this change) is still only
skin-deep, and needs to be extended to look deeper into types. It must
be improved to finish PR6784.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 23:32:35 +00:00
Devang Patel a2c21a2ddd Fix anon union member assignment expression's location.
This is tested by anon-union.exp in gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 23:23:25 +00:00
John McCall 337ec3d0e8 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
2010-10-12 23:13:28 +00:00
Eli Friedman 98efb9f6df PR8325: don't do destructor checking when a pointer is thrown.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 20:32:36 +00:00
John McCall df41f18936 Enter the context of the declared function template when performing
deduction and the final substitution, but not while substituting the
explicit template arguments.  Fixes rdar://problem/8537391



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 19:40:14 +00:00
Douglas Gregor 3273b0cea8 When finalizing a function template specialization following template
argument deduction, make sure to check the correctness of deduced template
type arguments (which we had previously skipped) along with other
kinds of template arguments. This fixes part of PR6784, but we're
still swallowing the extension warning about unnamed/local template
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116327 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 18:51:08 +00:00
Douglas Gregor 8cfb7a39ca If we end up instantiating a function parameter whose default argument
has not yet been parsed, note that the default argument hasn't been
parsed and keep track of all of the instantiations of that function
parameter. When its default argument does get parsed, imbue the
instantiations with that default argument. Fixes PR8245.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 18:23:32 +00:00
Chris Lattner 75c29a0127 fix PR7885, rejecting invalid uses of __builtin_constant_p.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 17:47:42 +00:00
Duncan Sands 240a020bed Pacify gcc-4.4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 14:07:59 +00:00
John McCall cf2e5063ae C's comma operator performs lvalue conversion on both its operands;
require them to have complete types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 07:14:40 +00:00
John McCall 2bf6f49ffa I just do what the comments tell me to do.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 02:19:57 +00:00
John McCall 2cd11fefb6 Progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 02:09:17 +00:00
John McCall 2a984cad5a Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 00:20:44 +00:00
Douglas Gregor a9f4f620da Eliminate the (de-)serialization of code completion results, now that
libclang does not support out-of-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 22:12:15 +00:00
Douglas Gregor 32be4a588f Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:

  - ASTUnit wasn't saving/restoring diagnostic state appropriately between
    reparses and code completions.
  - "Overload" completions weren't being passed through to the client



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 21:37:58 +00:00
Fariborz Jahanian f2ad2c9272 This patch does a few things in the area of objective-c
properties.
1. Generates the AST for lexical info. of accessing 
   getter/setter methods using dot-syntax notation.
   This fixes //rdar: //8528170.
2. Modifes rewriter to handle the AST putout in 1.
3. Supportes in rewriter ObjCImplicitSetterGetter ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 21:29:12 +00:00
Chris Lattner 16c5dea6c2 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
2010-10-10 18:16:20 +00:00
Chris Lattner 9046c224f1 Allow a string literal to initialize a tail array (PR8217), patch
by Pierre Habouzit!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-10 17:49:49 +00:00
Benjamin Kramer ce2d186a42 Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 15:49:00 +00:00
Argyrios Kyrtzidis 1d1e70ec65 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
2010-10-09 04:39:54 +00:00
Douglas Gregor 1274ccd90a 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
2010-10-08 23:50:27 +00:00
Fariborz Jahanian f54e3aec8a Method implemented in class's implementation may implement
one declared in class's extension and not one declared
in class's superclass. This supresses a bogus warning on
method type mismatch.
Fixes //rdar: // 8530080


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 22:59:25 +00:00
Douglas Gregor 022d13de47 This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:

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

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

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

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

Fixes PR6955, from Alp Toker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 20:44:28 +00:00
Douglas Gregor 5a9c0bca45 Fix the mapping of vertical-space cursor kinds to produce a newline,
rather than a space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 20:39:29 +00:00
John McCall b4eb64d842 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
2010-10-08 02:01:28 +00:00
Argyrios Kyrtzidis 9a2b9d794b Implement -fshort-enums (rdar://8490496).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 00:25:19 +00:00
Argyrios Kyrtzidis 63b57aeeeb Fix an infinite loop, caused by unintended syntax bug (the 'break;' after 'default:' was intended to break out of the while loop).
Fixes rdar://8518859&8520617.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 21:52:18 +00:00
Abramo Bagnara 8c4bfe52e5 Fixed cast to union with anonymous bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 21:20:44 +00:00
Fariborz Jahanian ed76f4474f Start and end location of a property-dot syntax expression
must match start and end location of the expression
as expected by the rewriter client. Fixes // rdar: // 8520727



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 18:12:21 +00:00
Fariborz Jahanian c784dc1caf Patch for adding message to unavailable attribute.
And its documentation.
Finishes off // rdar: // 6734520.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115862 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 23:12:32 +00:00
Fariborz Jahanian df9fb9150e Simplified code for deprecated attribute wih message a little.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 22:20:08 +00:00
Fariborz Jahanian c4b35cfdb9 Add message to attribute(deprecated).
attribute(unavailable) to do next.
// rdar:// 6734520.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 21:18:44 +00:00
Nick Lewycky edd59112ab Silence unused variable warning in Release builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115806 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 18:37:39 +00:00
Fariborz Jahanian 730e175910 Issue deprecated warning when typeof uses typedef
based on underlying type's deprecatedness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 17:00:02 +00:00
Douglas Gregor a075076871 Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 16:00:31 +00:00
Anders Carlsson 175ffbf7db When checking for uninitialized fields in member initializers, special case static variables and enums. Fixes PR8075.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 02:43:25 +00:00
John McCall 372e103dab Provide a slightly specialized diagnostic for tautological comparisons
of an enum value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 00:25:24 +00:00
Fariborz Jahanian aca7f7bab0 Ue TagType, added a FIXME. Per John's comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 00:23:25 +00:00
Fariborz Jahanian 2b1d51bcf8 Issue deprecated warning when typeof uses an
expression of deprecated type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:24:00 +00:00
John McCall 63d5fb3a14 When instantiating a new-expression, force a rebuild if there were default
arguments in either the placement or constructor arguments.  This is
important if the default arguments refer to a declaration or create a
temporary.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:36:42 +00:00
Fariborz Jahanian bdaae392d4 Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 21:02:11 +00:00
Douglas Gregor 4a1bb8c4d7 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
2010-10-05 15:41:24 +00:00
Argyrios Kyrtzidis b72db8977e In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 03:05:30 +00:00
Douglas Gregor c2760bc8e9 When providing a block literal as a code completion for a
function/method argument, include the parameter name and always
include parentheses (even for zero-parameter blocks). Otherwise, the
block literal placeholder '^' can look very weird.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 23:49:58 +00:00
Chris Lattner 57a4087b34 kill off CheckX86BuiltinFunctionCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:40:43 +00:00
Chris Lattner b803c66ae4 move imperative code to declarative definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:35:58 +00:00
Chris Lattner 946928f48c diagnose errors when a builtin that require constant arguments don't have them.
For example, on:

#include <emmintrin.h>
int foo(int N) {
 __m128i white2;
 white2 = _mm_slli_si128(white2, N);
 return 0;
} 

we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq

now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
      constant integer
 white2 = _mm_slli_si128(white2, N);
          ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
  ((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
            ^                                         ~~~~~~~
1 error generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:23:24 +00:00
Gabor Greif 28164ab2ac Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135

Some minor refacorings while I am here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 22:05:14 +00:00
Francois Pichet c71d8eb659 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
2010-10-01 21:19:28 +00:00
Douglas Gregor dab60ad68a Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 18:44:50 +00:00
Douglas Gregor fbb6fad63a When performing template argument deduction of a function template
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:14:36 +00:00
Daniel Dunbar dd0cb22bd6 Add support for attribute((naked)), patch by Zoxc on cfe-commits!
- Minor style tweaks by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 18:20:25 +00:00
Douglas Gregor 1b39820526 Fix handling of dependent nested namespace specifiers in UsingDecls
during template instantiation, from Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 17:58:28 +00:00
Douglas Gregor e80622fd48 Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 04:25:11 +00:00
Douglas Gregor 7a39dd01ed 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
2010-09-29 00:15:42 +00:00
Douglas Gregor 2138664dd2 Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit in
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 21:55:22 +00:00
Douglas Gregor 85606ebf3d 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
2010-09-28 20:50:54 +00:00
Fariborz Jahanian c5be7b0fc8 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
2010-09-28 20:42:35 +00:00
Douglas Gregor 2cf9d656f6 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
2010-09-28 20:38:10 +00:00
Sebastian Redl 8c84571f3e Move ExternalSemaSource::ReadMethodPool's implementation to Sema.cpp so that the header can get away with forward declarations only for ObjCMethodList and Selector. Fixes <rdar://8467631>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 20:23:00 +00:00
Douglas Gregor 9fe183ae1e 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
2010-09-28 19:45:33 +00:00
Argyrios Kyrtzidis b3358724d9 Don't warn with -Wbool-conversions if the user wrote an explicit cast like "(void *)false".
Fixes rdar://8459342.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 14:54:11 +00:00
Argyrios Kyrtzidis 1a18600b85 Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 14:54:07 +00:00
Bill Wendling 2a674e8e44 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
2010-09-28 01:09:49 +00:00
Douglas Gregor e10288c1e9 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
2010-09-28 00:00:00 +00:00
Douglas Gregor 4a74df5901 Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 23:39:06 +00:00
Douglas Gregor cdbfa6c411 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
2010-09-27 23:31:14 +00:00
Douglas Gregor 6e3c7713ca 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
2010-09-27 23:16:44 +00:00
Douglas Gregor 0ed2e0823c 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
2010-09-27 22:48:58 +00:00
Fariborz Jahanian ff3a078d2a Patch to support transparent_union arguments
passed to nonnull attributed functions. Implements radar
6857843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:42:37 +00:00
Douglas Gregor 3e9438b525 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
2010-09-27 22:37:28 +00:00
Douglas Gregor 27c08ab485 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
2010-09-27 22:06:20 +00:00
Douglas Gregor 5c0646b98b Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().

This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 21:17:54 +00:00
Nico Weber c956b6e8ff Correctly set "explicit template instantiation" kind on inner structs of templates whose explicit instantiation is first declared and then defined.
Fixes http://llvm.org/pr8207



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 21:02:09 +00:00
Fariborz Jahanian 60acea49c1 Issue warning for trivial cases of nonnull attributes
(on functions with no pointer arguments) but only when
the attribute has not been coming from a macro 
instantiation in a header file. Fixes first part
of radar 6857843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114860 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 19:05:51 +00:00
Fariborz Jahanian 3911a1a0ab Fix a NYI in IRGen which was due to incorrect AST
for property reference expression (of c++ object type)
in the conditional expression. Fixes // rdar://8291337



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 01:08:05 +00:00
Fariborz Jahanian 745da3a5bb Patch implements passing arrays to functions expecting
vla. Implements pr7827.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114737 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 17:30:16 +00:00
Ted Kremenek 2a6af6b787 Default synthesized ivars don't really have a location in the source. Using the location of the @implementation
is just confusing for clients that want to use SourceLocations for syntactic references.

Fixes: <rdar://problem/8470540>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114714 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 01:23:01 +00:00
Douglas Gregor 52779fb717 Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.

Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.

Fixes <rdar://problem/8470644>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 23:01:17 +00:00
Ted Kremenek e3b159c0d4 When warning about comparing an unsigned int to being >= 0, don't issue a warning if the zero value was an
enum or was expanded from a macro.

Fixes: <rdar://problem/8414119>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 21:43:44 +00:00
Ted Kremenek 4a2e9ea0c1 For properties declared in a @protocol and redeclared in a class extension, use the class extension
as the lexical DeclContext for the @property declaration that gets auto-created for the @interface.

Fixes: <rdar://problem/8467189>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 21:18:05 +00:00
Argyrios Kyrtzidis 2b64239a8e 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
2010-09-23 14:26:01 +00:00
Argyrios Kyrtzidis 47423bdaa0 Don't crash on _Imaginary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 09:40:31 +00:00
Douglas Gregor e45bb6aefb Fix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid result from ActOnIdExpression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114548 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 16:33:13 +00:00
Ted Kremenek a054fb46b1 Correctly register the class extension as the lexical DeclContext for ObjC methods declared with @property in class extensions.
This matches the behavior for setters.

Also pass the class extension to ProcessPropertyDecl as the lexical DeclContext, even when not redeclaring the @property.

This fixes the remaining issues in <rdar://problem/7410145>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:52:59 +00:00
Ted Kremenek 8254aa62d9 For ObjCPropertyDecls in class extensions, use the class extension as the lexical DeclContext for newly created
ObjCMethodDecls.  Further, use the location of the new property declaration as the location of new ObjCMethodDecls
(if they didn't previously exist).

This fixes more of the issues reported in <rdar://problem/7410145>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:28:43 +00:00
Douglas Gregor 6f942b2cab Add code completion for C++ constructors wherever we see the class (or
class template) and are in a context where we can have a value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 16:06:22 +00:00
Argyrios Kyrtzidis ff8819be64 Do not warn with -Wuninitialized when the member is used in a sizeof or address-of expression.
Fixes rdar://8331312.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 10:47:20 +00:00
Douglas Gregor b9d775734b When providing code completions for an argument in an Objective-C
message send, e.g.,

  [[NSString alloc] initWithCString:<CC>

look up all of the possible methods and determine the preferred type
for the argument expression based on the type of the corresponding
parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 00:03:25 +00:00
Douglas Gregor 70c5ac70ac Refactor code completion for expressions that occur as arguments in
Objective-C message sends. There is no functionality change here; this
is prep work for using the parameter types to help guide the
expression results when code-completing the argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 23:34:21 +00:00
Douglas Gregor 08f43cd5d9 Code completion has no reason to prefer values over types, especially
at the statement level or in Objective-C message receivers. Therefore,
just give types and declarations the same basic priority, and adjust
from there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 23:11:55 +00:00
Nate Begeman 6155d73ad1 Check in support for OpenCL conditional operator on vector types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 22:41:17 +00:00
Douglas Gregor cee9ff1668 Slight refactoring in code-completion results generation, placing the
various priority adjustments for preferences (based on selectors,
types) in a single function to make extension easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 22:39:41 +00:00
Douglas Gregor d475aad02d Get rid of the lame attempt to prioritize "void" functions at
statement context; it really isn't helpful in practice (remember
printf!) and we'll be doing other adjustments for statements very soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 21:25:19 +00:00
Douglas Gregor b05496dbd6 Tweak priorities for some types and macros:
- In Objective-C, we prefer BOOL to bool for historic reasons;
  slightly penalize "bool".
  - Treat Nil macro as a NULL pointer constant.
  - Treat YES, NO, true, and false macros as constants.
  - Treat the bool macro as a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 21:11:48 +00:00
Douglas Gregor ea844f3aa2 Check that an overloaded function name, when used by the ! operator,
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 17:13:33 +00:00
Douglas Gregor 4ada9d3aa4 Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 16:48:21 +00:00
Argyrios Kyrtzidis 355a9fe26a Implement -Wunused-label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 21:21:25 +00:00
Argyrios Kyrtzidis d2827af6f9 Warn when an expression result in a LabelStmt is unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 21:21:10 +00:00
Fariborz Jahanian 1fb019bf42 Problem with gnu conditional extension with missing
LHS and when conditional expression is an array. Since
it will be decayed, saved expression must be saved with
decayed expression. This is necessary to preserve semantics
of this extension (and prevent an IRGen crash which expects
an array to always be decayed). I am sure there will be other
cases in c++ (aggregate conditionals for example) when saving of the 
expression must happen after some transformation on conditional
expression has happened. 
Doug, please review.  Fixes // rdar://8446940


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 19:38:38 +00:00
Douglas Gregor 97fe61ca17 Give the Objective-C _cmd an "unlikely" code completion priority; it's
very rarely used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 15:16:27 +00:00
John McCall ae79222014 static local variables with destructors don't require a global destructor
unless we're on a platform without __cxa_atexit (or use thereof has been
disabled).  This patch actually just disables the check completely for
static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to
track the platform-specific fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 05:25:11 +00:00
Douglas Gregor ac5fd8404f Continue parsing more postfix expressions, even after semantic
errors. Improves code completion in yet another case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 01:28:11 +00:00
John Thompson 01add59bc8 Add more error checking to attribute vecreturn
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 01:12:07 +00:00
Daniel Dunbar 41e11a9315 Sema/transparent_union: Make sure to add implicit cast when constructing
implicit union values for the transparent_union extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 23:21:43 +00:00
Fariborz Jahanian 23c0104bb8 Diagnose use of incomplete type on method argument type of
method definitions instead of crashing in code gen.
Fixes radar 8421082.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 22:07:07 +00:00
Chris Lattner dd5fa7a21c fix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:12:38 +00:00
Fariborz Jahanian eb17e8b9ae Only assignment operator triggers property setter call.
Fixes radar 8437253.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:45:45 +00:00
John McCall 3019c444c6 When emitting a new-expression inside a conditional expression,
the cleanup might not be dominated by the allocation code.
In this case, we have to store aside all the delete arguments
in case we need them later.  There's room for optimization here
in cases where we end up not actually needing the cleanup in
different branches (or being able to pop it after the
initialization code).

Also make sure we only call this operator delete along the path
where we actually allocated something.

Fixes rdar://problem/8439196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 00:50:28 +00:00
Douglas Gregor 069ea64661 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
2010-09-16 23:58:57 +00:00
Chris Lattner ce78461303 improve the "enumeration value 'g' not handled in switch"
warning to handle multiple enumerators with one warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 17:09:42 +00:00
Douglas Gregor d36adf553c Don't add two code-completion results for the same selector; it
doesn't add any value. Instead, we'll just take the first method with
that selector that we find and create a completion for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 16:06:31 +00:00
Douglas Gregor e396c7bd99 When collecting Objective-C methods for message send completions, be
sure to visit the protocols of protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 15:34:59 +00:00
Douglas Gregor c7b6d88336 Implement code completion for Objective-C class message sends that are
missing the opening bracket '[', e.g.,

  NSArray <CC>

at function scope. Previously, we would only give trivial completions
(const, volatile, etc.), because we're in a "declaration name"
scope. Now, we also provide completions for class methods of NSArray,
e.g.,

  alloc

Note that we already had support for this after the first argument,
e.g.,

  NSArray method:x <CC>

would get code completion for class methods of NSArray whose selector
starts with "method:". This was already present because we recover
as if NSArray method:x were a class message send missing the opening
bracket (which was committed in r114057).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 15:14:18 +00:00
Douglas Gregor 9497a73ad0 Implement automatic bracket insertion for Objective-C class message
sends. These are far trickier than instance messages, because we
typically have something like

  NSArray alloc]

where it appears to be a declaration of a variable named "alloc" up
until we see the ']' (or a ':'), and at that point we can't backtrace.
So, we use a combination of syntactic and semantic disambiguation to
treat this as a message send only when the type is an Objective-C type
and it has the syntax of a class message send (which would otherwise
be ill-formed).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 01:51:54 +00:00
Zhongxing Xu b36cd3e175 Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 01:25:47 +00:00
Ted Kremenek b3198178da Do not warn about empty bodies for 'if' statements if the body is expanded from a macro.
Fixes <rdar://problem/8436021>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 00:37:05 +00:00
Ted Kremenek fbcb0ebb51 For self-comparison warning, check the source location of both the LHS and RHS to see if they
are expanded from macros (and if so, omit the warning).  Previously we were just looking at the
location of the binary expression.

Fixes <rdar://problem/8435950>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 00:03:01 +00:00
Douglas Gregor 77328d1bb9 Handle bracket insertion for Objective-C class messages in a very
narrow, almost useless case where we're inside a parenthesized
expression, e.g.,

  (NSArray alloc])

The solution to the general case still eludes me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 23:19:31 +00:00
Douglas Gregor 78edf51554 Improve code completion for Objective-C message sends when the opening
'[' is missing. Prior commits improving recovery also improved code
completion beyond the first selector, e.g., at or after the "to" in

  calculator add:x to:y

but not after "calculator". We now provide the same completions for

  calculator <CC>

that we would for

  [calculator <CC>

if "calculator" is an expression whose type is something that can
receive Objective-C messages.

This code completion works for instance and super message sends, but not
class message sends.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113976 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 16:23:04 +00:00
Douglas Gregor 0fbda68b50 Implement bracket insertion for Objective-C instance message sends as
part of parser recovery. For example, given:

  a method1:arg];

we detect after parsing the expression "a" that we have the start of a
message send expression. We pretend we've seen a '[' prior to the a,
then parse the remainder as a message send. We'll then give a
diagnostic+fix-it such as:

fixit-objc-message.m:17:3: error: missing '[' at start of message
      send expression
  a method1:arg];
  ^
  [

The algorithm here is very simple, and always assumes that the open
bracket goes at the beginning of the message send. It also only works
for non-super instance message sends at this time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 14:51:05 +00:00
John McCall 558d2abc7f one piece of code is responsible for the lifetime of every aggregate
slot.  The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 10:14:12 +00:00
Francois Pichet 0924618371 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
2010-09-15 00:14:08 +00:00
Douglas Gregor 0268810a46 Introduce a new code-completion context for a parenthesized
expression, e.g., after the '(' that could also be a type cast. Here,
we provide types as code-completion results in C/Objective-C (C++
already had them), although we wouldn't in a normal expression context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 23:59:36 +00:00
Sebastian Redl f8aca86645 Fix destructor and assignment operator lookup in the has_nothrow traits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 23:40:14 +00:00
Fariborz Jahanian c4e1a68152 RHS of property expression assignment requires
copy initialization before passing it to 
a setter. Fixes radar 8427922.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 23:02:38 +00:00
Douglas Gregor 5833b0b831 When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 22:55:20 +00:00
John McCall edeb6c9b47 The paired 'operator delete' for a placement 'operator new' is always a
placement 'operator delete', even if there are no placement args (i.e.
overload resolution selected an operator new with default arguments).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 21:34:24 +00:00
Michael J. Spencer 560a921b85 Revert "CMake: Update to use standard CMake dependency tracking facilities instead"
This reverts commit r113631

Conflicts:

	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:54:41 +00:00
Sebastian Redl 08295a592d Don't crash when using type traits on a class with a constructor template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 22:18:28 +00:00
Sebastian Redl 751025d5d1 Remove CXXRecordDecl::getDefaultConstructor(), an inherently unsafe function due to lazy declaration of default constructors. Now that __has_nothrow_constructor doesn't use it anymore, part of PR8101 is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 22:02:47 +00:00
Sebastian Redl 5f4e8999aa Have __has_nothrow_copy use Sema's lookup routines. This fixes the problem with not finding implicitly declared copy constructors, part of PR8107.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 21:10:20 +00:00
Sebastian Redl 0dfd848fa4 Eagerly evaluate type traits in Sema instead of lazily in AST. They actually need Sema access to be correct, fixes coming up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:56:31 +00:00
Argyrios Kyrtzidis 4076dacf14 When applying 'delete' on a pointer-to-array type match GCC and EDG behavior and treat it as 'delete[]'.
Also offer a fix-it hint adding '[]'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:15:54 +00:00
Douglas Gregor 1034170d05 Fix a typo noted by Gabor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 16:44:26 +00:00
Abramo Bagnara 46358457f7 Congruent diagnostic for void* arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 06:50:07 +00:00
Abramo Bagnara 2c5399f99c Parentheses around address non-type template argument is demoted to an extension warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 06:06:58 +00:00
Douglas Gregor 78c057e5a1 Don't assert when attempting to take the address of an overloaded
function fails due to ambiguities in partial ordering of function
templates. Fixes PR8033.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 08:16:09 +00:00
Douglas Gregor 8fcc516a5d When performing overload resolution, only compare the final conversion
sequences for two conversion functions when in fact we are in the text
of initialization by a user-defined conversion sequences. Fixes PR8034.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 08:07:23 +00:00
Douglas Gregor c6dbc3fa46 Diagnose the instantiation of variables (including static data
members) with function type. Fixes PR8047.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 07:37:24 +00:00
Douglas Gregor da0fd9a7fa Don't complain about useless user-defined conversion functions when
they were instantiated from a template. In template metaprogramming,
stuff happens. Fixes PR8065.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 07:22:28 +00:00
Douglas Gregor a4d5de539b When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade the
error to a warning if we're in a case that would be allowed in
C++0x. This "fixes" PR8084 by making Clang accept more code than GCC
and (non-strict) EDG do. 

Also, add the missing test case for the C++0x semantics, which should
have been in r113717.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 05:24:55 +00:00
Douglas Gregor 121dc9ab38 Implement C++0x semantics for [temp.expl.spec]p2, which loosens the
restrictions on out-of-line specializations to allow them anywhere in
an enclosing context. Motivated by PR8084.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 05:08:28 +00:00
Francois Pichet 8dc3abcc36 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
2010-09-12 05:06:55 +00:00
Douglas Gregor 661b4939ae Implement the "note" in C++ [over.built]p1, which is actually meant to
be a semantic requirement that a built-in overloaded operator is not
added to the overload set of there is already a user-defined
overloaded operator with the same parameter types. Fixes PR8087.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 04:28:07 +00:00
Douglas Gregor 5dde1605da Don't perform integral promotions from an incompletion enumeration
type. Fixes PR8089 in a slightly different way than had been suggested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 03:38:25 +00:00
Douglas Gregor 4fcf5b2f81 Teach the EvaluatedExprVisitor and its client, which marks
declarations in potentially-evaluated subexpressions, about
recursion. Fixes the release-mode self-host failure I introduced in
r113700.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 23:32:50 +00:00
Douglas Gregor be0f7bd61c When parsing default function arguments, do not mark any declarations
used in the default function argument as "used". Instead, when we
actually use the default argument, make another pass over the
expression to mark any used declarations as "used" at that point. This
addresses two kinds of related problems:

  1) We were marking some declarations "used" that shouldn't be,
  because we were marking them too eagerly.
  2) We were failing to mark some declarations as "used" when we
  should, if the first time it was instantiated happened to be an
  unevaluated context, we wouldn't mark them again at a later point.

I've also added a potentially-handy visitor class template
EvaluatedExprVisitor, which only visits the potentially-evaluated
subexpressions of an expression. I bet this would have been useful for
noexcept...

Fixes PR5810 and PR8127.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 20:24:53 +00:00
John McCall 4e6356426f 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
2010-09-10 23:21:22 +00:00
Sebastian Redl bd7c849de9 Eli helped me understand how evaluation contexts work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:57:27 +00:00
Michael J. Spencer 5a7f34958c CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:13:16 +00:00
Sebastian Redl 2e156225a2 Define and implement CXXNoexceptExpr. Create it in Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:55:43 +00:00
Sebastian Redl 02bc21a88e Parse the noexcept operator and stub out sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:55:37 +00:00
Fariborz Jahanian 4088ec00f0 property reference expression used on lhs of assignment
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 23:01:10 +00:00
Douglas Gregor a67e03fdf1 Teach libclang to walk the base and member initializers of a
constructor, in source order. Also introduces a new reference kind for
class members, which is used here (for member initializers) and will
also be used for designated initializers and offsetof.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 21:42:20 +00:00
Douglas Gregor 83cb942690 Simplify template instantiation for C++ exception declarations,
eliminating an unnecessary use of TemporaryBase in the process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 17:09:21 +00:00
Douglas Gregor ba48d6aad1 Eliminate some unnecessary uses of TreeTransform::TemporaryBase. There
are still a few (legitimate, unfortunate) uses of this hack around,
but at least now there are fewer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 16:55:46 +00:00
Douglas Gregor a1a04786ce Eliminate the comma locations from all of the Sema routines that deal
with comma-separated lists. We never actually used the comma
locations, nor did we store them in the AST, but we did manage to
waste time during template instantiation to produce fake locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 16:33:13 +00:00
Douglas Gregor 3d37c0ada0 Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 16:14:44 +00:00
Ted Kremenek 47bb27f168 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113476 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 06:53:59 +00:00
Ted Kremenek c82faca0be Check format strings when a called function has more than one FormatAttr (one for 'scanf' and one for 'printf'). Fixes <rdar://problem/8409437>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 04:33:05 +00:00
Ted Kremenek 95355bb53e It appears that technically a null format string is not warned under -Wformat-nonliteral, as
the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log).  Fixes <rdar://problem/8269537>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 03:51:42 +00:00
Ted Kremenek 4fe6441a55 Avoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
and trying again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 03:51:39 +00:00
Ted Kremenek e0ba9d1bee Remove tabs I accidentally introduced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 02:57:51 +00:00
Ted Kremenek 1db5d140b2 Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn
in this case, and the attribute is trivially satisfied (and benign).  Fixes <rdar://problem/8364828>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 01:17:32 +00:00
Ted Kremenek 90b828aa27 Enhance -Wreturn-type to not warn when control-flow is most likely limited by a switch statement explicitly covering
all the cases for an enum value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 00:06:07 +00:00
Ted Kremenek 559fb55460 When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where
covered by individual case statements.  Flow-based analyses may wish to consult this information,
and recording this in the AST allows us to obviate reconstructing this information later when
we build the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 00:05:53 +00:00
Douglas Gregor 1efb6c7163 Push the range associated with a nested-name-specifier further through
TreeTransform, since we were getting an empty source range where we
shouldn't. Sadly, the test case is Boost.Proto, and isn't worth
reducing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 23:56:00 +00:00
Douglas Gregor 4eb4f0f962 Fix a few minor issues with parsing and semantic analysis of C++
typeid expressions: 
  - make sure we have a proper source location for the closing ')'
  - cache the declaration of std::type_info once we've found it



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 23:14:30 +00:00
Douglas Gregor 382762582c When providing a completion for a function/method parameter of block
pointer type, actually provide a usable block literal expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 22:47:51 +00:00
Douglas Gregor bfae8bd625 Clean up some of the CMake dependencies
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:40:53 +00:00
Douglas Gregor 19311e70ed Use the new-initialization code for initializing scalars with a
function-style cast. Previously, we had a (redundant, incorrect)
semantic-checking path for non-class types, which allowed
value-initialization of a reference type and then crashed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:40:08 +00:00
Fariborz Jahanian 56a965c0f7 Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:36:35 +00:00
Bill Wendling b7566d8346 Initialize the MSVCGuidDecl variable in the correct order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 21:30:16 +00:00
Fariborz Jahanian d1877953f0 Fix a crash when overloading id with objc_object*.
Radar 8400356.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 20:08:18 +00:00
Francois Pichet 01b7c3028d Microsoft's __uuidof operator implementation part 1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 12:20:18 +00:00
Francois Pichet 538e0d0292 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
2010-09-08 11:32:25 +00:00
Sebastian Redl 36281c6fd7 Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 04:46:19 +00:00
Sebastian Redl 607a1788d9 Allow (cv) void and incomplete arrays to be passed to the type traits.
Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113326 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 00:48:43 +00:00
Gabor Greif a4a301dc74 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
2010-09-08 00:31:13 +00:00
Douglas Gregor ab6677ec40 Provide proper type-source location information for
CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and
CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the
process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 00:15:04 +00:00
Douglas Gregor 1bb2a93ab7 Improve source-location information for CXXNewExpr, by hanging on to
the TypeSourceInfo for the allocated type. Fixes PR7501.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 21:49:58 +00:00
Fariborz Jahanian 7da71020b9 Have Sema check for validity of CGString literal
instead of asserting in IRGen. Fixes radar 8390459.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 19:38:13 +00:00