| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
expressions and a test case.
llvm-svn: 78213
|
| |
|
|
|
|
|
| |
super class(s) and warn on any parameter
type mismatch if potentially unsafe.
llvm-svn: 78029
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
implementation of '#pragma unused' by not constructing intermediate
DeclRefExprs, but instead do the name lookup directly. The
implementation is greatly simplified.
Along the way, degrade '#pragma unused(undeclaredvariable)' to a
warning instead of being a hard error. This implements:
<rdar://problem/6761874> [sema] allow #pragma unused to reference undefined variable (with warning)
llvm-svn: 78019
|
| |
|
|
| |
llvm-svn: 77985
|
| |
|
|
| |
llvm-svn: 77660
|
| |
|
|
|
|
| |
and a name collision.
llvm-svn: 77658
|
| |
|
|
| |
llvm-svn: 77652
|
| |
|
|
| |
llvm-svn: 77628
|
| |
|
|
| |
llvm-svn: 77573
|
| |
|
|
|
|
| |
with dependent types. Fixes PR4621 and PR4627.
llvm-svn: 77498
|
| |
|
|
|
|
| |
class.
llvm-svn: 77497
|
| |
|
|
|
|
|
| |
excpression, if needed, and remove some ir-gen code
now unnencessary.
llvm-svn: 77490
|
| |
|
|
| |
llvm-svn: 77451
|
| |
|
|
| |
llvm-svn: 77377
|
| |
|
|
|
|
|
|
| |
regresses Clang extension conversions, like vectors, but allows conversions via constructors and conversion operators.
Add custom conversions to static_cast.
llvm-svn: 77076
|
| |
|
|
|
|
|
|
| |
Note that this also fixes a bug that affects non-template code, where we
were not treating out-of-line static data members are "file-scope" variables,
and therefore not checking their initializers.
llvm-svn: 77002
|
| |
|
|
| |
llvm-svn: 76934
|
| |
|
|
|
|
| |
with constructors don't have a matching constructor.
llvm-svn: 76913
|
| |
|
|
|
|
|
|
|
| |
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.
Removed the ActOnClassTemplate action, which is no longer used.
llvm-svn: 76881
|
| |
|
|
|
|
|
|
| |
- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible().
- Tweak several test cases to accommodate the new/improved type checking.
llvm-svn: 76830
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
value. This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall). I believe there should be very few false positives, though
the most interesting case would be:
int() { bar(); }
when bar does:
bar() { while (1) ; }
Here, we assume functions return, unless they are marked with the
noreturn attribute. I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.
If anyone spots other false positives, let me know!
llvm-svn: 76821
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates, e.g.,
template<typename T>
struct Outer {
struct Inner;
};
template<typename T>
struct Outer<T>::Inner {
// ...
};
Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.
There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.
llvm-svn: 76820
|
| |
|
|
|
|
| |
[class.union]p1", from John McCall!
llvm-svn: 76766
|
| |
|
|
|
|
|
| |
data members of class templates. We don't instantiate the definitions yet,
however.
llvm-svn: 76756
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
member functions of class templates, e.g.,
template<typename T>
struct X {
void f(T);
};
template<typename T> X<T>::f(T) { /* ... */ }
llvm-svn: 76692
|
| |
|
|
|
|
| |
destruction of base/members for each destructor AST.
llvm-svn: 76663
|
| |
|
|
|
|
| |
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.
llvm-svn: 76510
|
| |
|
|
|
|
| |
ObjCInterfaceDecl::getImplementation().
llvm-svn: 76509
|
| |
|
|
|
|
|
|
|
|
| |
- Remove Sema::CheckPointeeTypesForAssignment(), a temporary API I added to ease migration to ObjCObjectPointerType. Convert Sema::CheckAssignmentConstraints() to no longer depend on the temporary API.
- Sema::ConvertDeclSpecToType(): Replace a couple FIXME's with an important comment/example.
- Sema::GetTypeForDeclarator(): Get the protocol's from the interface, NOT the declspec (to support the following C typedef idiom: "typedef C<P> T; T *obj").
- Sema::ObjCQualifiedIdTypesAreCompatible(): Removed some dead code.
- ASTContext::getObjCEncodingForTypeImpl(): Some minor cleanups.
llvm-svn: 76443
|
| |
|
|
| |
llvm-svn: 76317
|
| |
|
|
|
|
| |
base/members.
llvm-svn: 75849
|
| |
|
|
|
|
| |
semantics of order of construction [class.init].
llvm-svn: 75649
|
| |
|
|
|
| |
Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).
llvm-svn: 75635
|
| |
|
|
| |
llvm-svn: 75591
|
| |
|
|
|
|
| |
have an initializer. Also, move some tests around to match the C++0x draft better.
llvm-svn: 75322
|
| |
|
|
| |
llvm-svn: 75315
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.
This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.
By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.
Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.
llvm-svn: 75314
|
| |
|
|
|
|
|
|
| |
function template. Most of the change here is in factoring out the
common bits used for template argument deduction from a function call
and when taking the address of a function template.
llvm-svn: 75044
|
| |
|
|
|
|
|
|
| |
implement C++ [temp.deduct.call]p3b3, which allows a template-id
parameter to match a derived class of the argument, while deducing
template arguments.
llvm-svn: 74965
|
| |
|
|
|
|
| |
functions.
llvm-svn: 74943
|
| |
|
|
|
|
| |
from Enea Zaffanella!
llvm-svn: 74831
|
| |
|
|
| |
llvm-svn: 74787
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declaration in the AST.
The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment,
which may be composed of several comment blocks.
Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).
Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile).
The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.
Some notes:
- We don't actually attempt to parse the comment blocks themselves,
beyond identifying them as Doxygen comment blocks to associate them
with a declaration.
- We won't find comment blocks that aren't adjacent to the
declaration, because we start our search based on the location of
the declaration.
- We don't go through the necessary hops to find, for example,
whether some redeclaration of a declaration has comments when our
current declaration does not. Similarly, we don't attempt to
associate a \param Foo marker in a function body comment with the
parameter named Foo (although that is certainly possible).
- Verification of my "no performance impact" claims is still "to be
done".
llvm-svn: 74704
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
by distinguishing between substitution that occurs for template
argument deduction vs. explicitly-specifiad template arguments. This
is used both to improve diagnostics and to make sure we only provide
SFINAE in those cases where SFINAE should apply.
In addition, deal with the sticky issue where SFINAE only considers
substitution of template arguments into the *type* of a function
template; we need to issue hard errors beyond this point, as
test/SemaTemplate/operator-template.cpp illustrates.
llvm-svn: 74651
|
| |
|
|
|
|
| |
Also has fix for bugzilla-4469.
llvm-svn: 74631
|
| |
|
|
|
|
|
| |
are fewer template arguments than there are template parameters for
that function.
llvm-svn: 74578
|
| |
|
|
|
|
|
|
|
| |
substitute those template arguments into the function parameter types
prior to template argument deduction. There's still a bit of work to
do to make this work properly when only some of the template arguments
are specified.
llvm-svn: 74576
|
| |
|
|
|
|
| |
list.
llvm-svn: 74571
|
| |
|
|
|
|
|
| |
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.
llvm-svn: 74563
|
| |
|
|
|
|
|
|
|
|
|
|
| |
instantiation stack so that we provide a full instantiation
backtrace. Previously, we performed all of the instantiations implied
by the recursion, but each looked like a "top-level" instantiation.
The included test case tests the previous fix for the instantiation of
DeclRefExprs. Note that the "instantiated from" diagnostics still
don't tell us which template arguments we're instantiating with.
llvm-svn: 74540
|