Ted Kremenek
33ba99566f
Only emit implicit constant conversion truncation warnings in reachable code. Apparently this is what GCC does, and some code depends on this. Fixes <rdar://problem/10321089>.
...
llvm-svn: 142716
2011-10-22 02:37:33 +00:00
Fariborz Jahanian
e96f9c816b
Fixes a minor hick up to my last patch.
...
llvm-svn: 142711
2011-10-22 01:56:45 +00:00
Fariborz Jahanian
512a4cc967
objc: private methods can have their attributes, no diagnostic is required.
...
None private methods if their implementation have attribute, they must exactly
match those in their declarations. // rdar://10271563
llvm-svn: 142709
2011-10-22 01:21:15 +00:00
Argyrios Kyrtzidis
d4590a5d5f
Don't try to set the "array filler" in a InitListExpr twice.
...
llvm-svn: 142695
2011-10-21 23:02:22 +00:00
Fariborz Jahanian
47f9a73f51
c++: support gcc's application of weak attribute on
...
class declaration which forces any such class and any
class that inherits from such a class to have their
typeinfo symbols be marked as weak.
// rdar://10246395
A test/CodeGenCXX/weak-extern-typeinfo.cpp
M lib/Sema/SemaDeclCXX.cpp
M lib/Sema/SemaDeclAttr.cpp
M lib/CodeGen/CGRTTI.cpp
llvm-svn: 142693
2011-10-21 22:27:12 +00:00
DeLesley Hutchins
c20905110a
Thread safety analysis refactoring: invalid lock expressions.
...
llvm-svn: 142666
2011-10-21 18:10:14 +00:00
Fariborz Jahanian
2512747959
objective-c: Diagnose redeclaration of private
...
ivars in class extensions. // rdar://10309454
llvm-svn: 142664
2011-10-21 18:03:52 +00:00
Douglas Gregor
fbf8752597
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>.
llvm-svn: 142652
2011-10-21 15:47:52 +00:00
Peter Collingbourne
99eddc3d92
Permit auto SCS on parameter declarations, C++03 [dcl.stc]p2
...
llvm-svn: 142649
2011-10-21 11:55:09 +00:00
Richard Smith
fe2750db42
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.
llvm-svn: 142619
2011-10-20 21:42:12 +00:00
Douglas Gregor
7f4fbecbe2
When fixing up the storage class for an anonymous union, don't mark
...
the anonymous union as valid: our fixes have Fix-Its.
llvm-svn: 142616
2011-10-20 20:40:00 +00:00
Douglas Gregor
f4ef4d2ec5
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.
llvm-svn: 142596
2011-10-20 17:58:49 +00:00
Douglas Gregor
44e5a0a72b
Diagnose class template (partial) specializations that occur in the
...
*wrong* class scope. This is one of the problems behind
<rdar://problem/9676205>.
llvm-svn: 142588
2011-10-20 16:41:18 +00:00
Douglas Gregor
f65d8ffca7
When we parse something that looks like a templated friend tag but
...
actually just has an extraneous 'template<>' header, strip off the
'template<>' header and treat it as a normal friend tag. Fixes PR10660
/ <rdar://problem/9958322>.
llvm-svn: 142587
2011-10-20 15:58:54 +00:00
Richard Smith
91c7bbde4b
Add -Wc++98-compat warning for enumerations in nested name specifiers.
...
llvm-svn: 142568
2011-10-20 03:28:47 +00:00
David Blaikie
733f7bb81f
FixIt insert 'static' for anonymous unions at global or namespace scope.
...
llvm-svn: 142566
2011-10-20 02:49:08 +00:00
David Blaikie
6f686fc271
Add a fixit to remove storage specifiers on anonymous enums.
...
llvm-svn: 142565
2011-10-20 02:10:55 +00:00
David Blaikie
30d15445ed
80 cols (one I created in my last commit, plus a bunch of others that were already there)
...
llvm-svn: 142552
2011-10-19 22:56:21 +00:00
David Blaikie
0a8e8999d6
Don't provide errors for anonymous unions when they're actually anonymous classes.
...
llvm-svn: 142551
2011-10-19 22:43:29 +00:00
Richard Smith
f720df0ed6
-Wc++98-compat: warn on nontrivial types used in unions and anonymous structs.
...
llvm-svn: 142541
2011-10-19 20:41:51 +00:00
Matt Beaumont-Gay
4b489fa629
Only warn at self-initialization if some later use is always uninitialized.
...
llvm-svn: 142538
2011-10-19 18:53:03 +00:00
Richard Smith
c620f554b9
-Wc++98-compat: diagnose if a reference is bound to a prvalue which does not
...
have an unambiguous accessible copying constructor; this is ill-formed in C++98.
llvm-svn: 142533
2011-10-19 16:55:56 +00:00
Douglas Gregor
e248eea214
Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!
...
llvm-svn: 142478
2011-10-19 06:04:55 +00:00
David Blaikie
651c73ce78
Fix pr9789, assert-on-invalid while instantiating an (invalid) class template with a non-final parameter pack. Also improve the warning for non-final parameter packs in this scenario so it only fires once, rather than once for every template parameter after the non-final parameter pack.
...
llvm-svn: 142473
2011-10-19 05:19:50 +00:00
Argyrios Kyrtzidis
4e8b13613b
Don't forget to complete the objc interface before asking for information,
...
otherwise lldb will suffer.
llvm-svn: 142471
2011-10-19 02:25:16 +00:00
Richard Smith
a066ccfcf1
Add a -Wc++98-compat warning for friend functions of class templates which would
...
be implicitly instantiated (resulting in a redefinition) in C++98.
llvm-svn: 142468
2011-10-19 00:54:10 +00:00
Peter Collingbourne
a48f33f951
Move static array parameter checks to SemaExpr, per Doug's request
...
llvm-svn: 142465
2011-10-19 00:16:45 +00:00
Richard Smith
38c0e0417c
-Wc++98-compat: warn if a SFINAE substitution in C++11 suppresses an access
...
control diagnostic.
llvm-svn: 142463
2011-10-19 00:07:01 +00:00
Richard Smith
c82397332d
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 2.
...
llvm-svn: 142426
2011-10-18 21:39:00 +00:00
Douglas Gregor
e5c79d5ea8
Provide result types for code completions that describe built-in
...
expressions (this, sizeof, etc.).
llvm-svn: 142424
2011-10-18 21:20:17 +00:00
John McCall
e314e27c58
Macro metaprogramming for builtin types.
...
llvm-svn: 142420
2011-10-18 21:02:43 +00:00
Richard Smith
0bf8a492fd
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.
...
llvm-svn: 142419
2011-10-18 20:49:44 +00:00
Fariborz Jahanian
2f31b33f34
objc: more changes in use of IBOutletCollection attribute.
...
'Class' is disallowed as argument. If the argument is missing,
NSObject is assumed. // rdar://10296078
llvm-svn: 142409
2011-10-18 19:54:31 +00:00
Argyrios Kyrtzidis
b51684d7a1
Set the objc "property attributes as written" for extension properties as well.
...
llvm-svn: 142406
2011-10-18 19:49:16 +00:00
Richard Smith
c30493db3c
In C++11, a class's members are allowed to be nominated as friends.
...
llvm-svn: 142393
2011-10-18 18:33:57 +00:00
Douglas Gregor
09deffa067
Make it possible to compute the type of 'this' without capturing
...
it. Refactoring to be used in a moment.
llvm-svn: 142360
2011-10-18 16:47:30 +00:00
Douglas Gregor
4205feffcd
Add code completions for C++0x expressions
...
llvm-svn: 142357
2011-10-18 16:29:03 +00:00
Hans Wennborg
f99d04f841
Suggest %zu for size_t args to printf.
...
For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.
llvm-svn: 142342
2011-10-18 08:10:06 +00:00
Douglas Gregor
d793e7c3f7
Don't format the code completion for parameters of block literal
...
arguments as block literal arguments; the block literal argument code
completion should only go one level deep. Fixes <rdar://problem/10291294>.
llvm-svn: 142335
2011-10-18 04:23:19 +00:00
Richard Smith
83c19296ff
Add -Wc++11-compat warning for an inline specifier on an explicit instantiation.
...
llvm-svn: 142333
2011-10-18 03:44:03 +00:00
Douglas Gregor
f333f8c40d
When transforming the arguments for a C++ "new" expression, make sure
...
to drop the implicitly-generated value initialization expression used
for initializing scalars. Fixes <rdar://problem/10283928>.
llvm-svn: 142330
2011-10-18 02:43:19 +00:00
Richard Smith
050d261ec7
Refactor the checking for explicit template instantiations being performed in
...
the right namespace in C++11 mode. Teach the code to prefer the 'must be in
precisely this namespace' diagnostic whenever that's true, and fix a defect
which resulted in the -Wc++11-compat warning in C++98 mode sometimes being
omitted.
llvm-svn: 142329
2011-10-18 02:28:33 +00:00
Richard Smith
9fcc5c31c4
Perform lvalue-to-rvalue conversions on __builtin_offsetof array argument index
...
before typechecking, as suggested by John.
llvm-svn: 142308
2011-10-17 23:29:39 +00:00
Richard Smith
b15c11c819
Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',
...
'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'.
llvm-svn: 142302
2011-10-17 23:06:20 +00:00
Tanya Lattner
49b3841398
The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
...
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.
llvm-svn: 142250
2011-10-17 21:00:38 +00:00
Fariborz Jahanian
502d2eee09
obj-c++: Fix a IRGen crash when getter is a reference type.
...
Fix is in Sema. // rdar://10153365
llvm-svn: 142249
2011-10-17 21:00:22 +00:00
Eli Friedman
15b1a7be1e
Add missing case to switch.
...
llvm-svn: 142246
2011-10-17 20:46:28 +00:00
John McCall
444bd25dff
Strip qualifiers off the type of an implicit property defined by
...
only a setter.
llvm-svn: 142236
2011-10-17 20:05:43 +00:00
Argyrios Kyrtzidis
bd8b150dfc
Introduce ASTConsumer::HandleTopLevelDeclInObjCContainer which accepts
...
top-level declarations that occurred inside an ObjC container.
This is useful to keep track of such decls otherwise when e.g. a function
is declared inside an objc interface, it is not passed to HandleTopLevelDecl
and it is not inside the DeclContext of the interface that is returned.
llvm-svn: 142232
2011-10-17 19:48:13 +00:00
Argyrios Kyrtzidis
1f4bee5601
Keep track when a ObjC interface/protocol was initially created as a forward reference.
...
llvm-svn: 142230
2011-10-17 19:48:06 +00:00
John McCall
4124c4924d
Teach the ARC compiler to not require __bridge casts when
...
passing/receiving CF objects at +0 to/from Objective-C methods
or audited C functions.
llvm-svn: 142219
2011-10-17 18:40:02 +00:00
John McCall
a072f5d454
Add a helper function for determining whether an expression
...
has placeholder type.
llvm-svn: 142203
2011-10-17 17:42:19 +00:00
Sebastian Redl
962070d49c
Revert r142142: "Make a C-style cast a const-cast, to suppress a GCC warning."
...
Richard already fixed the underlying issue, so the cast was superfluous.
llvm-svn: 142192
2011-10-17 16:53:50 +00:00
Douglas Gregor
ebf0049901
For modules, all macros that aren't include guards are implicitly
...
public. Add a __private_macro__ directive to hide a macro, similar to
the __module_private__ declaration specifier.
llvm-svn: 142188
2011-10-17 15:32:29 +00:00
Richard Smith
eda61288ad
Perform an lvalue-to-rvalue conversion on an array index in a __builtin_offsetof expression.
...
llvm-svn: 142179
2011-10-17 05:48:07 +00:00
Richard Smith
00ab3ae72b
Slightly simplify a constant expression check. No functional change.
...
llvm-svn: 142167
2011-10-16 23:01:09 +00:00
Peter Collingbourne
5aa6ecb619
Add sema checks for calls to functions taking static array parameters
...
llvm-svn: 142157
2011-10-16 21:17:32 +00:00
Sebastian Redl
b17be8dcfe
Implement overload resolution from init lists for scalar parameter types.
...
llvm-svn: 142148
2011-10-16 18:19:34 +00:00
Sebastian Redl
8b6412af46
Diagnose when omitting braces in direct list-initialization in C++0x.
...
This also applies to C99-style aggregate literals, should they be used in C++11, since they are effectively identical to constructor call list-initialization syntax.
llvm-svn: 142147
2011-10-16 18:19:28 +00:00
Sebastian Redl
2b47b7a3e6
In the verify-only pass, check that items that don't have an initializer in an init list can be value-initialized, at least when designated initializers are not involved. No test case yet, since early failures cannot be distinguished from late failures until overload resolution works.
...
llvm-svn: 142146
2011-10-16 18:19:20 +00:00
Sebastian Redl
5999aec4e1
Check for unavailable declarations in Sema::CanUseDecl.
...
llvm-svn: 142145
2011-10-16 18:19:16 +00:00
Sebastian Redl
cc152641c0
Drop the Diagnose parameter from Sema::PerformImplicitConversion again and instead use TryImplicitConversion in CheckSingleAssignmentConstraints when that function is in no-diagnostics mode.
...
llvm-svn: 142143
2011-10-16 18:19:06 +00:00
Sebastian Redl
47fa9a346d
Make a C-style cast a const-cast, to suppress a GCC warning. I should fix the underlying issue eventually, but this interface will probably change anyway.
...
llvm-svn: 142142
2011-10-16 18:18:59 +00:00
Fariborz Jahanian
c27cd1b881
Avoid duplicate unavailbility diagnostics in objc++.
...
// rdar://10268422
llvm-svn: 142078
2011-10-15 19:18:36 +00:00
Fariborz Jahanian
7c386f838a
obj-c++: allow the getter/setter to return/take parameters
...
by reference. // rdar://10188258
llvm-svn: 142075
2011-10-15 17:36:49 +00:00
Richard Smith
e41fac231c
Add -Wc++98-compat warning for deduced 'auto' type specifier.
...
llvm-svn: 142057
2011-10-15 05:42:01 +00:00
Anton Korobeynikov
f0c267e6e0
Provide half floating point support as a storage only type.
...
Lack of half FP was a regression compared to llvm-gcc.
llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Eli Friedman
1e7a0c6a1d
Attempt to fix Windows buildbot, round 2.
...
llvm-svn: 142014
2011-10-14 23:10:30 +00:00
Eli Friedman
8d3e43ff4a
Add template instantiation support for AtomicExpr.
...
llvm-svn: 142012
2011-10-14 22:48:56 +00:00
Eli Friedman
e2c600cf43
Attempt to fix buildbot failure on Windows.
...
llvm-svn: 142008
2011-10-14 21:52:24 +00:00
Douglas Gregor
7e1aa5b7ac
Don't try to diagnose anything when we're passing incomplete types
...
through varargs. This only happens when we're in an unevaluated
context, where we don't want to trigger an error anyway. Fixes PR11131
/ <rdar://problem/10288375>.
llvm-svn: 141986
2011-10-14 20:34:19 +00:00
Richard Smith
96bd62f769
Reinstate r141898 (reverted in r141921), without the -Wc++98-compat-variadic-templates flag. Consensus is that -Wc++98-compat is a useful addition to clang, but per-C++11-feature warnings may not be.
...
Original patch by Jeffrey Yasskin.
llvm-svn: 141985
2011-10-14 20:31:37 +00:00
Richard Smith
465841e48c
[temp.explicit]p1: constexpr cannot be specified in explicit instantiations.
...
llvm-svn: 141982
2011-10-14 19:58:02 +00:00
Benjamin Kramer
b89514a9b8
Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.
...
Passing a pointer was a bad idea as it collides with the overload for void*.
llvm-svn: 141971
2011-10-14 18:45:37 +00:00
Fariborz Jahanian
e1e17cd8e2
Fix misplaced comment.
...
llvm-svn: 141967
2011-10-14 18:35:31 +00:00
Fariborz Jahanian
03df2b2e56
Make value kind based on the return type of the getter, not
...
property type, for when getter may be a reference type.
// rdar://10188258 revised.
llvm-svn: 141966
2011-10-14 18:31:36 +00:00
Douglas Gregor
f1404d7d49
Under ARC, merge the bit corresponding to the ns_returns_retained
...
attribute from the first declaration to later declarations. Fixes
<rdar://problem/10142572>.
llvm-svn: 141957
2011-10-14 15:55:40 +00:00
Matt Beaumont-Gay
c622163b0f
Only warn in -Wliteral-conversion if the conversion loses information
...
llvm-svn: 141955
2011-10-14 15:36:25 +00:00
Douglas Gregor
041b084f73
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>.
llvm-svn: 141954
2011-10-14 15:31:12 +00:00
Erik Verbruggen
98ea7f6737
Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
...
retrieve annotations from completion string.
llvm-svn: 141953
2011-10-14 15:31:08 +00:00
Argyrios Kyrtzidis
dcaaa21fbe
Really protect from infinite loop when there are objc method redeclarations.
...
Serialization part will come later.
llvm-svn: 141950
2011-10-14 08:02:31 +00:00
Argyrios Kyrtzidis
c5e829cad2
Keep track of objc method redeclarations in the same interface.
...
Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations.
llvm-svn: 141946
2011-10-14 06:48:06 +00:00
Jeffrey Yasskin
de8a104633
Revert the -Wc++98-compat flag because dgregor doesn't like it.
...
llvm-svn: 141921
2011-10-14 00:04:00 +00:00
Fariborz Jahanian
df4f7ca331
objc-arc: 'Class' property is implicitly __unsafe_unretained.
...
// rdar://10239594
llvm-svn: 141915
2011-10-13 23:45:45 +00:00
Nico Weber
39bfed8ad6
Extend -Wno-sizeof-array-argument to strncpy and friends.
...
This finds 2 bugs in chromium and 1 in hunspell, with 0 false positives.
llvm-svn: 141902
2011-10-13 22:30:23 +00:00
Jeffrey Yasskin
a722170eb9
Implement the first piece of a -Wc++98-compat flag so that people can build in
...
C++11 mode but keep their sources compatible with C++98. This patch implements
the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include
it.
llvm-svn: 141898
2011-10-13 22:18:05 +00:00
Ted Kremenek
596fa16dd3
Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable. Fixes <rdar://problem/9259237>.
...
llvm-svn: 141881
2011-10-13 18:50:06 +00:00
Douglas Gregor
f4a06c2104
HasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify
...
llvm-svn: 141878
2011-10-13 18:26:27 +00:00
Douglas Gregor
cda2270217
Allow calling an overloaded function set by taking the address of the
...
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>.
llvm-svn: 141877
2011-10-13 18:10:35 +00:00
Erik Verbruggen
ca98f2a63f
Allow for annotate attributes after access specifiers. When such
...
attributes are found, propagate them to subsequent declarations.
llvm-svn: 141861
2011-10-13 09:41:32 +00:00
Douglas Gregor
ebcfbb5d22
When we determine that a function template specialization produced as
...
part of template argument deduction is ill-formed, we mark it as
invalid and treat it as a deduction failure. If we happen to find that
specialization again, treat it as a deduction failure rather than
silently building a call to the declaration.
Fixes PR11117, a marvelous bug where deduction failed after creating
an invalid specialization, causing overload resolution to pick a
different candidate. Then we performed a similar overload resolution
later, and happily picked the invalid specialization to
call... resulting in a silent link failure.
llvm-svn: 141809
2011-10-12 20:35:48 +00:00
Rafael Espindola
2d21ab024e
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.
llvm-svn: 141803
2011-10-12 19:51:18 +00:00
Ted Kremenek
6effcb5082
Fix typo in name of diagnostic.
...
llvm-svn: 141793
2011-10-12 18:03:37 +00:00
Douglas Gregor
6a0e23ff8b
Teach __has_nothrow_assign not to complain about access (GCC and EDG
...
ignore access entirely for it) and not to crash on assignment operator
templates. Fixes PR11110.
llvm-svn: 141777
2011-10-12 15:40:49 +00:00
Richard Smith
fd53aaf7e7
constexpr: don't consider class types with mutable members to be literal types.
...
The standard doesn't allow this, but mutable constexpr variables break the
semantics so badly that we can't reasonably accept them.
llvm-svn: 141768
2011-10-12 05:08:15 +00:00
Fariborz Jahanian
fa643c8f3b
objc: note location of the previously declared
...
property in the diagnostic.
llvm-svn: 141745
2011-10-12 00:00:57 +00:00
John McCall
50a2c2c19d
Catch placeholder types in DefaultLvalueConversion
...
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.
llvm-svn: 141738
2011-10-11 23:14:30 +00:00
John McCall
3cec19f925
Rename SemaCXXCast.cpp to SemaCast.cpp.
...
llvm-svn: 141686
2011-10-11 17:38:55 +00:00
Alexis Hunt
77c1f9f888
Get rid of ShouldDeleteMoveConstructor.
...
llvm-svn: 141650
2011-10-11 06:43:29 +00:00
Alexis Hunt
1bc6f71ebc
Consolidate copy constructor deletion into ShouldDeleteSpecialMember.
...
llvm-svn: 141645
2011-10-11 04:55:36 +00:00
Eli Friedman
df14b3a837
Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
...
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Francois Pichet
9a57fb5734
[Microsoft] If -fms-compatibility, then downgrade missing typename error to warning at function prototype scope.
...
llvm-svn: 141630
2011-10-11 01:50:09 +00:00
Kaelyn Uhrain
85308c6ecd
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.
llvm-svn: 141621
2011-10-11 01:02:41 +00:00
Kaelyn Uhrain
8af2c9f5c6
Clean up DiagnoseInvalidRedeclaration a bit
...
llvm-svn: 141612
2011-10-11 00:28:52 +00:00
Kaelyn Uhrain
e1a9ff7934
Move a couple chunks of ActOnFunctionDeclarator to separate functions
...
llvm-svn: 141611
2011-10-11 00:28:49 +00:00
Kaelyn Uhrain
4dc695daea
Move some bool flags out of function parameter lists.
...
llvm-svn: 141610
2011-10-11 00:28:45 +00:00
Kaelyn Uhrain
0a32fcaf65
Only accept a typo correction if it doesn't trigger additional errors
...
llvm-svn: 141609
2011-10-11 00:28:39 +00:00
Douglas Gregor
2259d85a43
Don't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member. Fixes PR11108.
...
llvm-svn: 141600
2011-10-10 23:44:35 +00:00
Douglas Gregor
c7a3107baf
When performing a user-defined conversion via a constructor, be sure
...
to check whether the constructor is accessible. Fixes
<rdar://problem/10202900>.
llvm-svn: 141588
2011-10-10 22:41:00 +00:00
Ted Kremenek
bed648e0b0
Rework construction of CXXForRangeStmt not to recycle the same DeclRefExpr in multiple subexpressions. This breaks the tree structure
...
of the AST and completely breaks the CFG invariants.
Patch by Jim Goodnow II and reviewed by Richard Smith!
llvm-svn: 141586
2011-10-10 22:36:28 +00:00
Fariborz Jahanian
55b4e5c208
objc: err on a property designated both atomic and
...
nonatomic. // rdar://10260017
llvm-svn: 141580
2011-10-10 21:53:24 +00:00
Douglas Gregor
ab96bcf6ea
When substituting into a sizeof parameter pack expression in a context
...
where we can't expand (i.e., multi-level substitution), be sure to
substitute the pack with its level-reduced pack. Fixes PR10230.
llvm-svn: 141568
2011-10-10 18:59:29 +00:00
Richard Smith
caf3390d44
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.
llvm-svn: 141561
2011-10-10 18:28:20 +00:00
Douglas Gregor
0de5720737
Don't suggest 'noreturn' for function template instantiations, because
...
it might be wrong for other instantiations of the same function
template. Fixes PR10801.
llvm-svn: 141559
2011-10-10 18:15:57 +00:00
Kaelyn Uhrain
1a6eb99d45
Give nicer note when a member redeclaration has or lacks 'const'
...
llvm-svn: 141555
2011-10-10 18:01:37 +00:00
Fariborz Jahanian
9a81f848c8
objc: Some refactoring of overriding method decl. code
...
for future work.
llvm-svn: 141553
2011-10-10 17:53:29 +00:00
Douglas Gregor
6e8da6a291
Don't analyze comparisons in type- or value-dependent
...
subexpressions. Fixes PR10291.
llvm-svn: 141552
2011-10-10 17:38:18 +00:00
Douglas Gregor
556e5860f9
Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.
...
llvm-svn: 141549
2011-10-10 17:22:13 +00:00
Richard Smith
f368fb40df
constexpr: Disable checking of constructor member initializer lists for
...
constexpr constructor templates. Such checking is optional, and currently hard
to get right since clang doesn't generate implicit member initializers until
instantiation (even for non-dependent members).
This is needed for clang to accept libstdc++ from g++4.6 in c++0x mode.
llvm-svn: 141547
2011-10-10 16:38:04 +00:00
Douglas Gregor
bcc9539323
Don't complain about qualified property or ivar access when the
...
qualifier itself is invalid. Crasher noticed by Fariborz.
llvm-svn: 141544
2011-10-10 16:09:49 +00:00
Douglas Gregor
b06fa540e8
When adding a direct initializer to a declaration, allow the
...
initializer to update the type of the declaration. For example, this
allows us to determine the size of an incomplete array from its
initializer. Fixes PR10288.
llvm-svn: 141543
2011-10-10 16:05:18 +00:00
Douglas Gregor
728d00b8e7
Parse the initializer for a class member after handling its
...
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.
llvm-svn: 141539
2011-10-10 14:49:18 +00:00
Douglas Gregor
877d4ebba4
Always add the built-in overload candidates for operators &&, ||, and
...
!. Fixes PR9865.
llvm-svn: 141537
2011-10-10 14:05:31 +00:00
Alexis Hunt
d6da876bac
Begin work consolidating ShouldDelete* functions.
...
Begin with just default constructors. One note is that as a side effect
of this, a conformance test was removed on the basis that this is almost
certainly a defect as with most of union initialization. As it is, clang
does not implement union initialization close to the standard as it's
quite broken as written. I hope to write a paper addressing the issues
eventually.
llvm-svn: 141528
2011-10-10 06:18:57 +00:00
Douglas Gregor
16e65616d6
Implement the restrictions in C++ [class.friend]p6, which disallow
...
defining a friend function with a qualified name or in a local
class. Fixes PR9853.
llvm-svn: 141524
2011-10-10 01:11:59 +00:00
Douglas Gregor
12340e5b18
Diagnose attempts to qualify the name of an instance variable or
...
property in an Objective-C++ member access expression. Fixes PR9759.
llvm-svn: 141522
2011-10-09 23:22:49 +00:00
Douglas Gregor
f7b98957ac
Push "out-of-line" declarations into scope when their lexical/semantic
...
redeclaration contexts are the same, as occurs within linkage
specifications. Fixes PR9162.
llvm-svn: 141521
2011-10-09 22:57:49 +00:00
Douglas Gregor
56636589ff
The effective context of a friend function is its lexical
...
context. Fixes PR9103.
llvm-svn: 141520
2011-10-09 22:38:36 +00:00
Douglas Gregor
f892c7fe60
For the various CF and NS attributes, don't complain if the parameter
...
or return types are dependent. Fixes PR9049.
llvm-svn: 141518
2011-10-09 22:26:49 +00:00
Douglas Gregor
0c83c8128b
Per the note in C++0x [temp.deduct.call]p4, don't attempt template
...
argument deduction against a function parameter that has no deducible
template parameters in it. Fixes PR8598.
llvm-svn: 141517
2011-10-09 22:06:46 +00:00
Douglas Gregor
e9d075e434
A friend template specialization is also dependent if any of its
...
template arguments are dependent. Fixes PR10913.
llvm-svn: 141515
2011-10-09 20:59:17 +00:00
Douglas Gregor
668d362503
Only allow taking the address of an expression of type 'overloaded
...
function type' when that expression is actually an overloaded function
reference (and not the address of an overloaded function
reference). Fixes PR11066.
llvm-svn: 141514
2011-10-09 19:10:41 +00:00
Douglas Gregor
bb64afcc39
Diagnose attempts to declare a non-static data member with a
...
non-identifier name. Fixes PR10839.
llvm-svn: 141513
2011-10-09 18:55:59 +00:00
Douglas Gregor
c4475e8cd6
When building source location information for an _Atomic type, be sure
...
to fill in the source locations for the underlying value type. Fixes
an intermittent crasher (due to uninitialized data) in the PCH test
for _Atomic types.
llvm-svn: 141512
2011-10-09 18:45:17 +00:00
Douglas Gregor
4d328b6e16
After instantiating a 'noexcept' expression, be sure to convert it to
...
a boolean value and check that it is a constant expression. Fixes
PR11084.
llvm-svn: 141511
2011-10-09 18:31:23 +00:00
Benjamin Kramer
ec44099cf8
Initialize the HadMultipleCandidates flag.
...
Found by valgrind.
llvm-svn: 141510
2011-10-09 17:58:25 +00:00
Fariborz Jahanian
9059124b41
objc: Do not warn about mismatch on Super's readonly property attribute,
...
related to a readwrite property, and
Sub's readwrite property. // rdar://9396329
llvm-svn: 141497
2011-10-08 17:45:33 +00:00
Benjamin Kramer
ec173a5c92
Silence a warning about casting away constness.
...
llvm-svn: 141496
2011-10-08 16:15:07 +00:00
NAKAMURA Takumi
82a351197f
Whitespace
...
llvm-svn: 141486
2011-10-08 11:31:46 +00:00
Fariborz Jahanian
13d3f86577
objc++: some minor cleanup and a test case
...
for atomic setters which requires assignment operator.
llvm-svn: 141415
2011-10-07 21:08:14 +00:00
Chandler Carruth
08d0491006
Hack in a workaround for PR11082 until we have a proper fix. This
...
un-breaks every glib-dependent compile with Clang.
I'm not sure this is even the best workaround, so suggestions welcome.
llvm-svn: 141381
2011-10-07 18:40:27 +00:00
John McCall
f937c023bf
Rename TagDecl::isDefinition -> isCompleteDefinition
...
for better self-documenting code, since the semantics
are subtly different from getDefinition().
llvm-svn: 141355
2011-10-07 06:10:15 +00:00
Fariborz Jahanian
9cd57a7061
objc: Improve on diagnostic when atomic proeprty is synthesized
...
on one accessor and user-provide with another.
llvm-svn: 141343
2011-10-06 23:47:58 +00:00
John McCall
9776e438cf
Move type-checking for C-style casts in C into the now-misnamed
...
SemaCXXCast.cpp. Should have no functionality change.
llvm-svn: 141336
2011-10-06 23:25:11 +00:00
Argyrios Kyrtzidis
c281c96675
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
llvm-svn: 141335
2011-10-06 23:23:27 +00:00
Argyrios Kyrtzidis
9321ad3f97
When using an unavailable/deprecated interface Foo inside Foo's interface/implementation
...
don't emit unavailable errors.
llvm-svn: 141334
2011-10-06 23:23:20 +00:00
Eli Friedman
0dfb889575
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!
llvm-svn: 141330
2011-10-06 23:00:33 +00:00
Fariborz Jahanian
565ed7a4c1
objc++: For atomic properties of c++ class objec typet, appropriate
...
operator= is called. Issue a warning for non-trivial case until
runtime support is provided. // rdar://6137845
llvm-svn: 141302
2011-10-06 18:38:18 +00:00
Richard Smith
43a87fe86a
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.
...
llvm-svn: 141279
2011-10-06 09:21:12 +00:00
Erik Verbruggen
2e657ffd8e
Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.
...
llvm-svn: 141278
2011-10-06 07:27:49 +00:00