| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that this is mostly a structural patch that handles the change from the old
spelling style to the new one. One consequence of this is that all AT_foo_bar
enum values have changed to not be based off of the first spelling, but rather
off of the class name, so they are now AT_FooBar and the like (a straw poll on
IRC showed support for this). Apologies for code churn.
Most attributes have GNU spellings as a temporary solution until everything else
is sorted out (such as a Keyword spelling, which I intend to add if someone else
doesn't beat me to it). This is definitely a WIP.
I've also killed BaseCheckAttr since it was unused, and I had to go through
every attribute anyway.
llvm-svn: 158700
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
because it expects a reference and receives a non-l-value.
For example, given:
int foo(int &);
template<int x> void b() { foo(x); }
clang will now print "expects an l-value for 1st argument" instead of
"no known conversion from 'int' to 'int &' for 1st argument". The change
in wording (and associated code to detect the case) was prompted by
comment #5 in PR3104, and should be the last bit of work needed for the
bug.
llvm-svn: 158691
|
| |
|
|
|
|
|
|
|
|
| |
Per post-commit review, it's not appropriate to use ExtWarn in C++, because
we can't prove that the inline function will actually be defined in more than
one place (and thus we can't prove that this violates the ODR).
This removes the warning entirely from uses in the main source file in C++.
llvm-svn: 158689
|
| |
|
|
|
|
|
|
| |
This includes treating anonymous namespaces like internal linkage, and allowing
const variables to be used even if internal. The whole thing's been broken out
into a separate function to avoid nested ifs.
llvm-svn: 158683
|
| |
|
|
|
|
|
|
|
|
|
| |
This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)
I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.
llvm-svn: 158666
|
| |
|
|
|
|
| |
crash on invalid function decl with alloc_size attribute
llvm-svn: 158663
|
| |
|
|
|
|
| |
means the function allocates x^2 bytes. GCC also accepts this syntax
llvm-svn: 158662
|
| |
|
|
|
|
|
|
| |
Now, as long as the 'Namespaces' variable is correct inside Attr.td, the
generated code will correctly admit a C++11 attribute only when it has the
appropriate namespace(s).
llvm-svn: 158661
|
| |
|
|
|
|
| |
__forceinline is a combination of the inline keyword and __attribute__((always_inline))
llvm-svn: 158653
|
| |
|
|
|
|
| |
the member expression is in parentheses.
llvm-svn: 158651
|
| |
|
|
| |
llvm-svn: 158630
|
| |
|
|
| |
llvm-svn: 158617
|
| |
|
|
|
|
|
| |
The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.
llvm-svn: 158592
|
| |
|
|
|
|
|
|
| |
semantics when promotions are involved.
(As far as I can tell, this only affects some edge cases.)
llvm-svn: 158591
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
method definition that has its '{' attached to the method name without
a space.
With a method like:
-(id)meth{
.....
}
the logic in ObjCMethodDecl that determined the selector locations got
confused because it was initialized based on an end location for '{' but
that end location changed to '}' after the method was finished.
Fix this by having an immutable end location for the declarator and
for getLocEnd() get the end location from the body itself.
Fixes rdar://11659739.
llvm-svn: 158583
|
| |
|
|
| |
llvm-svn: 158573
|
| |
|
|
| |
llvm-svn: 158572
|
| |
|
|
|
|
|
|
|
| |
* Escaped "::" and "<" as needed in Doxygen comments;
* Marked up code examples with \code...\endcode;
* Documented a \param that is current, instead of a few that aren't;
* Fixed up some \file and \brief comments.
llvm-svn: 158562
|
| |
|
|
| |
llvm-svn: 158545
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically, @[] and @{} didn't have a type associated with them; we now
use "NSArray *" and "NSDictionary *", respectively. @"" has the type
"NSString *". @(), unfortunately, has type "id", since it (currently) may
be either an NSNumber or an NSString.
Add a test for all the Objective-C at-expression completions.
<rdar://problem/11507708&11507668&11507711>
llvm-svn: 158533
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is explicitly forbidden in C99 6.7.4p3. This is /not/ forbidden in C++,
probably because by default file-scope const/constexpr variables have internal
linkage, while functions have external linkage. There's also the issue of
anonymous namespaces to consider. Nevertheless, there should probably be a
similar warning, since the semantics of inlining a function that references
a variable with internal linkage do not seem well-defined.
<rdar://problem/11577619>
llvm-svn: 158531
|
| |
|
|
|
|
|
| |
for unexpanded parameter packs. Fixes the crash-on-invalid in
PR13117.
llvm-svn: 158525
|
| |
|
|
|
|
|
|
|
| |
* Removed \param comments for parameters that no longer exist;
* Fixed a "\para" typo to "\param";
* Escaped @, # and \ symbols as needed in Doxygen comments;
* Added use of \brief to output short summaries.
llvm-svn: 158498
|
| |
|
|
| |
llvm-svn: 158478
|
| |
|
|
| |
llvm-svn: 158477
|
| |
|
|
|
|
|
|
| |
* Escape #, < and @ symbols where Doxygen would try to interpret them;
* Fix several function param documentation where names had got out of sync;
* Delete param documentation referring to parameters that no longer exist.
llvm-svn: 158472
|
| |
|
|
|
|
| |
a CXXRecordDecl is complete. Fixes Bug 13086.
llvm-svn: 158469
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OBJC_AT_KEYWORD_NAME take a string literal argument where previously
its second argument was an unquoted token; macro invocations such as
OBJC_AT_KEYWORD_NAME(NeedAt,{) confuse Doxygen's parser.
While I'm wary of changing code (rather than just comments) to work
around Doxygen's limitations, in this case the change makes the code
more readable for human beings as well, and the macro derived no
benefit from using the preprocessor's stringification operator, as
it never has need of the unquoted token.
I've also included a couple of trivial drive-by fixes to doc comments.
llvm-svn: 158440
|
| |
|
|
|
|
| |
-Wunused-private-field.
llvm-svn: 158411
|
| |
|
|
|
|
| |
escape sequences.
llvm-svn: 158390
|
| |
|
|
|
|
| |
unsigned type is narrowing if the source is non-constant or negative.
llvm-svn: 158377
|
| |
|
|
|
|
| |
make sure that we walk the definition. Fixes <rdar://problem/11427742>.
llvm-svn: 158357
|
| |
|
|
|
|
| |
all. Suppresses follow-on errors mentioned in PR13074.
llvm-svn: 158348
|
| |
|
|
| |
llvm-svn: 158325
|
| |
|
|
|
|
| |
consider them when enumerating builtin operator candidates.
llvm-svn: 158293
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need an efficient mechanism to determine whether a defaulted default
constructor is constexpr, in order to determine whether a class is a literal
type, so keep the incrementally-built form on CXXRecordDecl. Remove the
on-demand computation of same, so that we only have one method for determining
whether a default constructor is constexpr. This doesn't affect correctness,
since default constructor lookup is much simpler than selecting a constructor
for copying or moving.
We don't need a corresponding mechanism for defaulted copy or move constructors,
since they can't affect whether a type is a literal type. Conversely, checking
whether such functions are constexpr can require non-trivial effort, so we defer
such checks until the copy or move constructor is required.
Thus we now only compute whether a copy or move constructor is constexpr on
demand, and only compute whether a default constructor is constexpr in advance.
This is unfortunate, but seems like the best solution.
llvm-svn: 158290
|
| |
|
|
|
|
|
|
|
|
| |
an explicitly-defaulted default constructor would be constexpr. This is
necessary in weird (but well-formed) cases where a class has more than one copy
or move constructor.
Cleanup of now-unused parts of CXXRecordDecl to follow.
llvm-svn: 158289
|
| |
|
|
|
|
|
| |
initialization, and use that information to produce the right kind of
initialization during template instantiation.
llvm-svn: 158288
|
| |
|
|
| |
llvm-svn: 158241
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This could happen for cases like this:
- (NSArray *)getAllNames:(NSArray *)images {
NSMutableArray *results = [NSMutableArray array];
for (auto img in images) {
[results addObject:img.name];
}
return results;
}
Here the property access will fail because 'img' has type 'id', rather than,
say, NSImage.
This warning will not fire in templated code, since the 'id' could have
come from a template parameter.
llvm-svn: 158239
|
| |
|
|
|
|
| |
typo-correction after a scope specifier.
llvm-svn: 158231
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Objective-C literals conceptually always create new objects, but may be
optimized by the compiler or runtime (constant folding, singletons, etc).
Comparing addresses of these objects is relying on this optimization
behavior, which is really an implementation detail.
In the case of == and !=, offer a fixit to a call to -isEqual:, if the
method is available. This fixit is directly on the error so that it is
automatically applied.
Most of the time, this is really a newbie mistake, hence the fixit.
llvm-svn: 158230
|
| |
|
|
|
|
| |
variable which wasn't removed when the original patch was committed.
llvm-svn: 158225
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
AST: For auto-synthesized ivars give them the location of the related
property (previously they had no source location). This allows them
to be indexed by libclang.
libclang: Make sure synthesized ivars are indexed before the methods that
may reference them.
Fixes rdar://11607001.
llvm-svn: 158189
|
| |
|
|
|
|
| |
definitions of such members are prohibited, not mere declarations.
llvm-svn: 158186
|
| |
|
|
|
|
| |
feedback from Doug Gregor.
llvm-svn: 158185
|
| |
|
|
|
|
|
| |
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.
llvm-svn: 158178
|
| |
|
|
|
|
| |
correction to use for an invalid function redeclaration.
llvm-svn: 158177
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The integral APSInt value is now stored in a decomposed form and the backing
store for large values is allocated via the ASTContext. This way its not
leaked as TemplateArguments are never destructed when they are allocated in
the ASTContext. Since the integral data is immutable it is now shared between
instances, making copying TemplateArguments a trivial operation.
Currently getting the integral data out of a TemplateArgument requires creating
a new APSInt object. This is cheap when the value is small but can be expensive
if it's not. If this turns out to be an issue a more efficient accessor could
be added.
llvm-svn: 158150
|
| |
|
|
|
|
|
|
|
| |
Before, the note showed the location where you could insert __bridge variants,
but the actual fixit edit came after the cast.
No functionality change.
llvm-svn: 158131
|