| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. For
A f() {
return A();
}
we were incorrectly calling the A destructor on the returned object.
2. For
void f(A);
void g() {
A a;
f(a);
}
we were incorrectly not calling the copy constructor.
llvm-svn: 87082
|
|
|
|
| |
llvm-svn: 86931
|
|
|
|
|
|
|
| |
and give that category an explicit test. Generalize the internal diagnostic
name.
llvm-svn: 86905
|
|
|
|
|
|
| |
anonymous members. Partial fix for PR 5390.
llvm-svn: 86796
|
|
|
|
|
|
|
| |
if (self = [super init])
Recognize it and only warn if -Wparentheses is explicitly enabled.
llvm-svn: 86790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
handling template template parameters properly. This refactoring:
- Parses template template arguments as id-expressions, representing
the result of the parse as a template name (Action::TemplateTy)
rather than as an expression (lame!).
- Represents all parsed template arguments via a new parser-specific
type, ParsedTemplateArgument, which stores the kind of template
argument (type, non-type, template) along with all of the source
information about the template argument. This replaces an ad hoc
set of 3 vectors (one for a void*, which was either a type or an
expression; one for a bit telling whether the first was a type or
an expression; and one for a single source location pointing at
the template argument).
- Moves TemplateIdAnnotation into the new Parse/Template.h. It never
belonged in the Basic library anyway.
llvm-svn: 86708
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example:
@class NSString;
@interface Test
+ (void)test:(NSString *)string;
@end
void g(NSString *a);
void f() {
NSString *a = "Foo";
g("Foo");
[Test test:"Foo"];
}
will produce
t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *'
NSString *a = "Foo";
^~~~~
@
t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *'
g("Foo");
^~~~~
@
t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *'
[Test test:"Foo"];
^~~~~
@
3 diagnostics generated.
llvm-svn: 86665
|
|
|
|
|
|
|
| |
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).
llvm-svn: 86597
|
|
|
|
|
|
| |
McCall
llvm-svn: 86442
|
|
|
|
|
|
|
|
| |
error, rather
than an error about incompatible types. Patch by Sean Hunt.
llvm-svn: 86402
|
|
|
|
|
|
| |
a typo pointed out by Fariborz.
llvm-svn: 86265
|
|
|
|
|
|
| |
at it.
llvm-svn: 86243
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* If the unsigned type is smaller than the signed type, never warn, because
its value will not change when zero-extended to the larger type.
* If we're testing for (in)equality, and the unsigned value is an integer
constant whose sign bit is not set, never warn, because even though the
signed value might change, it can't affect the result of the equality.
Also make the comparison test cases much more rigorous, and have them expose
the subtle differences between C and C++ here.
llvm-svn: 86242
|
|
|
|
|
|
|
|
|
|
|
| |
get_origin->x
where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover.
llvm-svn: 86238
|
|
|
|
|
|
| |
and should especially not try to evaluate them.
llvm-svn: 86173
|
|
|
|
|
|
|
| |
always zero in this context" warning logic. Also, make the diagnostic
itself more precise when referring to pointer values ("NULL" vs. "zero").
llvm-svn: 86143
|
|
|
|
|
|
|
|
|
|
|
|
| |
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.
Add some enumerator tests. These seem to expose some oddities in the
types we're converting C++ enumerators to; in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.
Note to self: stop baiting Doug in my commit messages.
llvm-svn: 86128
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
still be dependent or invoke an overloaded operator. Previously, we
only supported builtin operators.
BinaryOperator/CompoundAssignOperator didn't have this issue because
we always built a CXXOperatorCallExpr node, even when name lookup
didn't find any functions to save until instantiation time. Now, that
code builds a BinaryOperator or CompoundAssignOperator rather than a
CXXOperatorCallExpr, to save some space.
llvm-svn: 86087
|
|
|
|
|
|
|
|
| |
Conditional operands are next.
Fixes part of rdar://problem/7289584.
llvm-svn: 86083
|
|
|
|
|
|
| |
through to indexing.
llvm-svn: 86018
|
|
|
|
|
|
| |
rdar://problem/7222956
llvm-svn: 85999
|
|
|
|
|
|
|
|
|
|
|
|
| |
appears in a deprecated context. In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C. If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.
llvm-svn: 85998
|
|
|
|
|
|
|
|
| |
overloaded operators, e.g.,
p->template operator+<T>()
llvm-svn: 85989
|
|
|
|
|
|
|
| |
one instance of a large problem. assert for non-canoical types would
help track down these things.
llvm-svn: 85956
|
|
|
|
|
|
|
|
|
|
|
|
| |
"->" with a use of ParseUnqualifiedId. Collapse
ActOnMemberReferenceExpr, ActOnDestructorReferenceExpr (both of them),
ActOnOverloadedOperatorReferenceExpr,
ActOnConversionOperatorReferenceExpr, and
ActOnMemberTemplateIdReferenceExpr into a single, new action
ActOnMemberAccessExpr that does the same thing more cleanly (and can
keep more source-location information).
llvm-svn: 85930
|
|
|
|
|
|
|
|
|
|
|
| |
yet another copy of the unqualified-id parsing code.
Also, use UnqualifiedId to simplify the Action interface for building
id-expressions. ActOnIdentifierExpr, ActOnCXXOperatorFunctionIdExpr,
ActOnCXXConversionFunctionExpr, and ActOnTemplateIdExpr have all been
removed in favor of the new ActOnIdExpression action.
llvm-svn: 85904
|
|
|
|
| |
llvm-svn: 85524
|
|
|
|
|
|
|
| |
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.
llvm-svn: 85500
|
|
|
|
|
|
| |
expression instead of crashing.
llvm-svn: 85401
|
|
|
|
|
|
|
| |
class pointer is the most derived common class of the two.
This is <rdar://problem/7334235>.
llvm-svn: 85337
|
|
|
|
|
|
|
| |
function template specializations and member functions of class
template specializations.
llvm-svn: 85300
|
|
|
|
|
|
| |
code a bit. Test the fixits.
llvm-svn: 85231
|
|
|
|
| |
llvm-svn: 85129
|
|
|
|
|
|
| |
PR5297.
llvm-svn: 85117
|
|
|
|
|
|
| |
should not warn
llvm-svn: 85073
|
|
|
|
| |
llvm-svn: 85058
|
|
|
|
| |
llvm-svn: 85033
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
so that we maintain better source information after template argument
deduction and overloading resolves down to a specific
declaration. Found and dealt with a few more cases that
FixOverloadedFunctionReference didn't cope with.
(Finally) added a test case that puts together this change with the
DeclRefExpr change to (optionally) include nested-name-specifiers and
explicit template argument lists.
llvm-svn: 84974
|
|
|
|
|
|
| |
argument-dependent lookup too. This fixes PR5244.
llvm-svn: 84963
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,
namespace N { int i; }
int j = N::i;
Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.
Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.
llvm-svn: 84962
|
|
|
|
|
|
| |
of the logic out of BuildDeclarationNameExpr
llvm-svn: 84847
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to all callers. Switch a few other users of CK_Unknown to proper cast
kinds.
Note that there are still some situations where we end up with
CK_Unknown; they're pretty easy to find with grep. There
are still a few missing conversion kinds, specifically
pointer/int/float->bool and the various combinations of real/complex
float/int->real/complex float/int.
llvm-svn: 84623
|
|
|
|
| |
llvm-svn: 84436
|
|
|
|
| |
llvm-svn: 84423
|
|
|
|
| |
llvm-svn: 84393
|
|
|
|
| |
llvm-svn: 84370
|
|
|
|
|
|
| |
fixing PR4838.
llvm-svn: 84353
|
|
|
|
| |
llvm-svn: 84245
|
|
|
|
|
|
| |
CheckCastTypes.
llvm-svn: 84242
|
|
|
|
| |
llvm-svn: 84241
|