| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
pointed out a better/simpler way to do it.
llvm-svn: 132369
|
|
|
|
|
|
| |
declaration. This should fix the asserting buildbot.
llvm-svn: 132333
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declaration if the tag name is not already declared. The tag name is declared in the next outermost non record scope.
Example:
class A {
friend class B;
B* b;
};
B* global_b;
llvm-svn: 132332
|
|
|
|
|
|
|
|
| |
class type (or array thereof), eliminating some redundant checks
(thanks Eli!) and adding some tests where the behavior differs in
C++98/03 vs. C++0x.
llvm-svn: 132218
|
|
|
|
|
|
|
|
|
| |
makes it into a special member function. This is very bad and can lead
to all sorts of nastiness including implicit member functions violating
the One Definition Rule. This should probably be made ill-formed in a
later version of the standard, but for now we'll just warn.
llvm-svn: 132104
|
|
|
|
| |
llvm-svn: 132096
|
|
|
|
|
|
|
|
| |
behind implicit moves. We now correctly identify move constructors and
assignment operators and update bits on the record correctly. Generation
of implicit moves (declarations or definitions) is not yet supported.
llvm-svn: 132080
|
|
|
|
|
|
|
|
| |
type that turns one type into another. This is used as the basis to
implement __underlying_type properly - with TypeSourceInfo and proper
behavior in the face of templates.
llvm-svn: 132017
|
|
|
|
|
|
|
|
|
|
|
|
| |
that the unevaluated subexpressions of &&, ||, and ? : are not
considered when determining whether the expression is a constant
expression. Also, turn the "used in its own initializer" warning into
a runtime-behavior warning, so that it doesn't fire when a variable is
used as part of an unevaluated subexpression of its own initializer.
Fixes PR9999.
llvm-svn: 131968
|
|
|
|
|
|
| |
instantiations and specializations. Fixes <rdar://problem/9126453> and PR8700.
llvm-svn: 131802
|
|
|
|
|
|
|
|
| |
should use a constructor to default-initialize a
variable. InitializationSequence knows the rules for default
initialization, better. Fixes <rdar://problem/8501008>.
llvm-svn: 131796
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.
Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.
llvm-svn: 131735
|
|
|
|
| |
llvm-svn: 131722
|
|
|
|
| |
llvm-svn: 131640
|
|
|
|
| |
llvm-svn: 131633
|
|
|
|
|
|
| |
for destructors until the class is complete and destructors have been adjusted.
llvm-svn: 131632
|
|
|
|
|
|
| |
other things, libcxx not building.
llvm-svn: 131573
|
|
|
|
| |
llvm-svn: 131528
|
|
|
|
|
|
| |
my defaulted constructor tests stop yelling at me about them.
llvm-svn: 131432
|
|
|
|
|
|
|
|
|
|
|
|
| |
template<class U>
struct X1 {
template<class T> void f(T*);
template<> void f(int*) { }
};
Won't be so simple. I need to think more about it.
llvm-svn: 131362
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scope.
Necessary to parse MFC and MSVC standard lib code.
Example:
struct X {
template<class T> void f(T) { }
template<> void f(int) { }
}
llvm-svn: 131347
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
They are actually grammatically considered definitions and parsed
accordingly.
This fixes the outstanding bugs regarding defaulting functions after
their declarations.
We now really nicely diagnose the following construct (try it!)
int foo() = delete, bar;
Still todo: Defaulted functions other than default constructors
Test cases (including for the above construct)
llvm-svn: 131228
|
|
|
|
|
|
|
| |
We still don't parse out-of-line defaults correctly, which is needed to
get the full effect out of this patch.
llvm-svn: 131223
|
|
|
|
| |
llvm-svn: 131212
|
|
|
|
|
|
| |
This means we get C++0x jump-across-intializer semantics correct.
llvm-svn: 131204
|
|
|
|
|
|
|
|
| |
Yes, I'm aware that the diagnostics are awful.
Tests to follow.
llvm-svn: 131203
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
class scope.
This removes 2 errors when parsing MFC code with clang
Example:
class A {
virtual void f() = 0 { }
}
llvm-svn: 131175
|
|
|
|
|
|
|
|
|
| |
I've edited one diagnostic which would print "copy constructor" for copy
constructors and "constructor" for any other constructor. If anyone is
extremely enamored with this, it can be reinstated with a simple boolean
flag rather than calling getSpecialMember, which is inappropriate.
llvm-svn: 131143
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the semantic context referenced by the nested-name-specifier rather
than the syntactic form of the nested-name-specifier. The previous
incarnation was based on my complete misunderstanding of C++
[temp.expl.spec]. The latest C++0x working draft clarifies the
requirements here, and this rewrite is intended to follow that.
Along the way, improve source location information in the
diagnostics. For example, if we report that a specific type needs or
doesn't need a 'template<>' header, we dig out that type in the
nested-name-specifier and highlight its range.
Fixes: PR5907, PR9421, PR8277, PR8708, PR9482, PR9668, PR9877, and
<rdar://problem/9135379>.
llvm-svn: 131138
|
|
|
|
| |
llvm-svn: 131126
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Focus is on default constructors for the time being. Currently the
exception specification and prototype are processed correctly. Codegen
might work but in all likelihood doesn't.
Note that due to an error, out-of-line defaulting of member functions is
currently impossible. It will continue to that until I muster up the
courage to admit that I secretly pray to epimetheus and that I need to
rework the way default gets from Parse -> Sema.
llvm-svn: 131115
|
|
|
|
|
|
| |
reflect our new, more accurate AST.
llvm-svn: 131114
|
|
|
|
|
|
| |
unions. Fixes PR8326.
llvm-svn: 131109
|
|
|
|
|
|
| |
definitions to also include tag declarations. Fixes PR8151.
llvm-svn: 131102
|
|
|
|
|
|
|
| |
modify the semantics slightly to accomodate default constructors (I
hope).
llvm-svn: 131087
|