| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
| |
diagnosing invalid function redeclarations.
llvm-svn: 137966
|
| |
|
|
| |
llvm-svn: 137653
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.
Example:
template <class T>
class A {
public:
template <class U> void f(U p) { }
template <> void f(int p) { } // <== class scope specialization
};
This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.
llvm-svn: 137573
|
| |
|
|
| |
llvm-svn: 137491
|
| |
|
|
|
|
|
| |
done and is likely to not work well anyway; take away this unnecessary
complexity.
llvm-svn: 137465
|
| |
|
|
|
|
|
|
|
| |
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.
llvm-svn: 137349
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having a function declaration and definition with different types for a
parameter where the types have same (textual) name can occur when an unqualified
type name resolves to types in different namespaces in each location.
The error messages have been extended by adding notes that point to the first
parameter of the function definition that doesn't match the declaration, instead
of a generic "member declaration nearly matches". The generic message is still
used in cases where the mismatch is not in the paramenter list, such as
mismatched cv qualifiers on the member function itself.
llvm-svn: 136891
|
| |
|
|
|
|
|
|
| |
integer, and initialise its TypeSourceInfo. The initialisation fixes a
crash when using pre-compiled preambles with C++ code-completion. From
Erik Verbruggen! Fixes PR10511.
llvm-svn: 136786
|
| |
|
|
| |
llvm-svn: 136389
|
| |
|
|
|
|
|
|
|
| |
we could turn this into an on-disk hash table so we don't load the
whole thing the first time we need it. However, it tends to be very,
very small (i.e., empty) for most precompiled headers, so it isn't all
that interesting.
llvm-svn: 136352
|
| |
|
|
|
|
|
| |
in few more places and in each instance, fix up
the type to the expected type. // rdar://9603056
llvm-svn: 136103
|
| |
|
|
|
|
| |
to declare a static object. // rdar://9603056
llvm-svn: 135970
|
| |
|
|
|
|
|
|
| |
LLVM.h imports
them into the clang namespace.
llvm-svn: 135852
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
methods, including indirectly overridden methods like those
declared in protocols and categories. There are mismatches
that we would like to diagnose but aren't yet, but this
is fine for now.
I looked at approaches that avoided doing this lookup
unless we needed it, but the infer-related-result-type
checks were doing it anyway, so I left it with the same
fast-path check for no previous declartions of that
selector.
llvm-svn: 135743
|
| |
|
|
|
|
|
| |
is still terrible here because typo correction is not behaving well in
the presence of overloaded functions.
llvm-svn: 135128
|
| |
|
|
|
|
| |
parsing lambda expressions, from John Freeman!
llvm-svn: 135090
|
| |
|
|
|
|
| |
Uhrain! Fixes PR10318.
llvm-svn: 135086
|
| |
|
|
|
|
|
| |
implicit ivar accesses to go through the 'self' variable
rather than the real 'self' for the method. // rdar://9730771
llvm-svn: 134992
|
| |
|
|
|
|
| |
code so that they only occur in a single place. No functionality change.
llvm-svn: 134961
|
| |
|
|
|
|
| |
functions. Fixes <rdar://problem/9731999>.
llvm-svn: 134897
|
| |
|
|
| |
llvm-svn: 134377
|
| |
|
|
| |
llvm-svn: 134305
|
| |
|
|
|
|
| |
a virtual function in the base class to be inserted into the derived class function list to prevent extra errors every time the derived class is used.
llvm-svn: 134251
|
| |
|
|
|
|
| |
classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch.
llvm-svn: 134250
|
| |
|
|
|
|
|
| |
replace the existing declaration appropriately. Patch by Jordy Rose,
fixes PR10013 / <rdar://problem/9584157>.
llvm-svn: 134097
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vector<int>
to
std::vector<int>
Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes
PR5776/<rdar://problem/8652971>.
Thanks Kaelyn!
llvm-svn: 134007
|
| |
|
|
|
|
|
|
| |
Sema::GetTypeForDeclarator and remove its 'OwnedDecl' out parameter.
No functionality change.
llvm-svn: 133986
|
| |
|
|
|
|
|
|
| |
inside GetTypeForDeclarator.
No functionality change.
llvm-svn: 133985
|
| |
|
|
|
|
|
|
| |
'ownership', not 'lifetime'.
rdar://9477613.
llvm-svn: 133779
|
| |
|
|
|
|
| |
same declaration. Templatize dropAttr for general use.
llvm-svn: 133724
|
| |
|
|
|
|
| |
// rdar://9538608
llvm-svn: 133721
|
| |
|
|
|
|
| |
declared variable and ignore it. // rdar://9538608
llvm-svn: 133654
|
| |
|
|
|
|
|
|
|
| |
(or follow up) extern declaration with weak_import as
an actual definition. make clang follows this behavior.
// rdar://9538608
llvm-gcc treats an extern declaration with weak_import
llvm-svn: 133450
|
| |
|
|
|
|
|
|
|
| |
storage specifier is different from the storage specifier on the
template. If that storage specifier is the same, then we only warn.
Thanks to John for the prodding.
llvm-svn: 133236
|
| |
|
|
|
|
|
| |
specifier on an explicit specialization to a warning, since neither
EDG nor GCC diagnose this code as ill-formed.
llvm-svn: 133232
|
| |
|
|
|
|
|
|
|
|
| |
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.
Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.
llvm-svn: 133103
|
| |
|
|
|
|
|
| |
either imlicitly (for builtins) or explicitly (due to multiple
specification of the same attributes). Fixes <rdar://problem/9612060>.
llvm-svn: 133045
|
| |
|
|
|
|
| |
as an extension.
llvm-svn: 132980
|
| |
|
|
|
|
|
|
| |
functions in gnu89 mode in terms of redefinitions.
rdar://9559708 .
llvm-svn: 132953
|
| |
|
|
|
|
|
|
|
|
|
|
| |
struct {
typedef int A = 0;
};
According to the C++11 standard, this is not ill-formed, but does not have any ascribed meaning. We can't reasonably accept it, so treat it as ill-formed.
Also switch C++ from an incorrect 'fields can only be initialized in constructors' diagnostic for this case to C's 'illegal initializer (only variables can be initialized)'
llvm-svn: 132890
|
| |
|
|
| |
llvm-svn: 132878
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:
t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^
It also means that we get decent type inference when writing code in
Objective-C++0x:
auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id
llvm-svn: 132868
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Wmismatched-tags.
- Removed fix-it hints from template instaniations since changes to the
templates are rarely helpful.
- Changed the caret in template instaniations from the class/struct name to the
class/struct keyword, matching the other warnings.
- Do not offer fix-it hints when multiple declarations disagree. Warnings are
still given.
- Once a definition is found, offer a fix-it hint to all previous declarations
with wrong tag.
- Declarations that disagree with a previous definition will get a fix-it hint
to change the declaration.
llvm-svn: 132831
|
| |
|
|
|
|
| |
declared __weak objc-gc mode. // rdar://9666091.
llvm-svn: 132731
|
| |
|
|
|
|
|
| |
specializing a member of an unspecialized template, and recover from
such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>.
llvm-svn: 132677
|
| |
|
|
| |
llvm-svn: 132546
|
| |
|
|
| |
llvm-svn: 132544
|
| |
|
|
|
|
| |
I'll try to implement this functionality again soon.
llvm-svn: 132536
|
| |
|
|
| |
llvm-svn: 132460
|
| |
|
|
| |
llvm-svn: 132387
|