- May 30, 2009
-
-
Anders Carlsson authored
llvm-svn: 72627
-
Anders Carlsson authored
llvm-svn: 72624
-
Douglas Gregor authored
llvm-svn: 72616
-
Douglas Gregor authored
using namespace std::debug; Extended UsingDirectiveDecl to store the nested-name-specifier that precedes the nominated namespace. llvm-svn: 72614
-
Anders Carlsson authored
Add a member lookup criteria constructor for searching for overridden virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298. llvm-svn: 72601
-
Douglas Gregor authored
walks through DeclContexts properly, and prints more of the information available in the AST. The functionality is still available via -ast-print, -ast-dump, etc., and also via the new member functions Decl::dump() and Decl::print(). llvm-svn: 72597
-
Anders Carlsson authored
llvm-svn: 72594
-
- May 29, 2009
-
-
Douglas Gregor authored
printing logic to help customize the output. For now, we use this rather than a special flag to suppress the "struct" when printing "struct X" and to print the Boolean type as "bool" in C++ but "_Bool" in C. llvm-svn: 72590
-
Eli Friedman authored
hadError (suppressing future diagnostics) if we didn't print an error. llvm-svn: 72588
-
Eli Friedman authored
VLAs. llvm-svn: 72587
-
Douglas Gregor authored
template instantiation. This helps reduce our stack footprint when performing deep template instantiations. llvm-svn: 72582
-
Eli Friedman authored
handle the construct in question correctly. llvm-svn: 72581
-
Sebastian Redl authored
llvm-svn: 72580
-
Mike Stump authored
a vla is used. llvm-svn: 72575
-
Sebastian Redl authored
llvm-svn: 72571
-
Douglas Gregor authored
llvm-svn: 72570
-
Douglas Gregor authored
instantiation of tags local to member functions of class templates (and, eventually, function templates) works when the tag is defined as part of the decl-specifier-seq, e.g., struct S { T x, y; } s1; Also, make sure that we don't try to default-initialize a dependent type. llvm-svn: 72568
-
Eli Friedman authored
to the DeclGroup. llvm-svn: 72559
-
Douglas Gregor authored
specifier resulted in the creation of a new TagDecl node, which happens either when the tag specifier was a definition or when the tag specifier was the first declaration of that tag type. This information has several uses, the first of which is implemented in this commit: 1) In C++, one is not allowed to define tag types within a type specifier (e.g., static_cast<struct S { int x; } *>(0) is ill-formed) or within the result or parameter types of a function. We now diagnose this. 2) We can extend DeclGroups to contain information about any tags that are declared/defined within the declaration specifiers of a variable, e.g., struct Point { int x, y, z; } p; This will help improve AST printing and template instantiation, among other things. 3) For C99, we can keep track of whether a tag type is defined within the type of a parameter, to properly cope with cases like, e.g., int bar(struct T2 { int x; } y) { struct T2 z; } We can also do similar things wherever there is a type specifier, e.g., to keep track of where the definition of S occurs in this legal C99 code: (struct S { int x, y; } *)0 llvm-svn: 72555
-
- May 28, 2009
-
-
Douglas Gregor authored
given DeclContext is dependent on type parameters. Use this to properly determine whether a TagDecl is dependent; previously, we were missing the case where the TagDecl is a local class of a member function of a class template (phew!). Also, make sure that, when we instantiate declarations within a member function of a class template (or a function template, eventually), that we add those declarations to the "instantiated locals" map so that they can be found when instantiating declaration references. Unfortunately, I was not able to write a useful test for this change, although the assert() that fires when uncommenting the FIXME'd line in test/SemaTemplate/instantiate-declref.cpp tells the "experienced user" that we're now doing the right thing. llvm-svn: 72526
-
Douglas Gregor authored
parser. Rather than placing all of the delayed member function declarations and inline definitions into a single bucket corresponding to the top-level class, we instead mirror the nesting structure of the nested classes and place the delayed member functions into their appropriate place. Then, when we actually parse the delayed member function declarations, set up the scope stack the same way as it was when we originally saw the declaration, so that we can find, e.g., template parameters that are in scope. llvm-svn: 72502
-
Sebastian Redl authored
Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere. llvm-svn: 72498
-
- May 27, 2009
-
-
Sebastian Redl authored
llvm-svn: 72489
-
Douglas Gregor authored
declaration references. The key realization is that dependent Decls, which actually require instantiation, can only refer to the current instantiation or members thereof. And, since the current context during instantiation contains all of those members of the current instantiation, we can simply find the real instantiate that matches up with the "current instantiation" template. llvm-svn: 72486
-
Douglas Gregor authored
improve some error recovery with explicit template instantiation. llvm-svn: 72484
-
Douglas Gregor authored
within a template now have a link back to the enumeration from which they were instantiated. This means that we can now find the instantiation of an anonymous enumeration. llvm-svn: 72482
-
Douglas Gregor authored
references. There are several smallish fixes here: - Make sure we look through template parameter scope when determining whether we're parsing a nested class (or nested class *template*). This makes sure that we delay parsing the bodies of inline member functions until after we're out of the outermost class (template) scope. - Since the bodies of member functions are always parsed "out-of-line", even when they were declared in-line, teach unqualified name lookup to look into the (semantic) parents. - Use the new InstantiateDeclRef to handle the instantiation of a reference to a declaration (in DeclRefExpr), which drastically simplifies template instantiation for DeclRefExprs. - When we're instantiating a ParmVarDecl, it must be in the current instantiation scope, so only look there. Also, remove the #if 0's and FIXME's from the dynarray example, which now compiles and executes thanks to Anders and Eli. llvm-svn: 72481
-
Anders Carlsson authored
llvm-svn: 72478
-
Anders Carlsson authored
llvm-svn: 72477
-
Steve Naroff authored
This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType. No functionality change. llvm-svn: 72475
-
Anders Carlsson authored
llvm-svn: 72474
-
Douglas Gregor authored
instantiation of a declaration from the template version (or version that lives in a template) and a given set of template arguments. This needs much, much more testing, but it suffices for simple examples like typedef T* iterator; iterator begin(); llvm-svn: 72461
-
Douglas Gregor authored
overloaded operator[] or overloaded postfix unary operator (++, --). Thanks to Eli for finding this bug! llvm-svn: 72460
-
Douglas Gregor authored
llvm-svn: 72440
-
- May 26, 2009
-
-
Douglas Gregor authored
llvm-svn: 72433
-
Douglas Gregor authored
an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. llvm-svn: 72428
-
Anders Carlsson authored
llvm-svn: 72417
-
- May 25, 2009
-
-
Chris Lattner authored
argument. This avoids the argument from being silenced when the argument is the NULL macro, which is defined in a system header. This also makes the output a bit nicer, e.g.: t.c:8:3: warning: null passed to a callee which requires a non-null argument func1(NULL, cp2, i1); ^ ~~~~ vs something like: t.c:8:10: warning: argument is null where non-null is required func1(NULL, cp2, i1); ^ llvm-svn: 72393
-
- May 23, 2009
-
-
Douglas Gregor authored
expressions. We are now missing template instantiation logic for only three classes of expressions: - Blocks-related expressions (BlockExpr, BlockDeclRefExpr) - C++ default argument expressions - Objective-C expressions Additionally, our handling of DeclRefExpr is still quite poor, since it cannot handle references to many kinds of declarations. As part of this change, converted the TemplateExprInstantiator to use iteration through all of the expressions via clang/AST/StmtNodes.def, ensuring that we don't forget to add template instantiation logic for any new expression node kinds. llvm-svn: 72303
-
Douglas Gregor authored
llvm-svn: 72301
-