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