- Aug 04, 2009
-
-
Mike Stump authored
llvm-svn: 78102
-
- Jul 29, 2009
-
-
Douglas Gregor authored
template arguments, as in template specialization types. This permits matching out-of-line definitions of members for class templates that involve non-type template parameters. llvm-svn: 77462
-
- Jul 27, 2009
-
-
Douglas Gregor authored
ActOnUninitializedDecl. llvm-svn: 77211
-
- Jul 24, 2009
-
-
Douglas Gregor authored
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
-
- Jul 21, 2009
-
-
Douglas Gregor authored
Zaffanella, with tweaks from Abramo Bagnara. llvm-svn: 76576
-
- Jul 18, 2009
-
-
Argyrios Kyrtzidis authored
llvm-svn: 76274
-
- Jul 17, 2009
-
-
Daniel Dunbar authored
llvm-svn: 76112
-
- Jul 14, 2009
-
-
Steve Naroff authored
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
-
- Jul 02, 2009
-
-
Douglas Gregor authored
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
-
- Jun 30, 2009
-
-
Douglas Gregor authored
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
-
Douglas Gregor authored
"semantic analysis" part. Use the "semantic analysis" part when performing template instantiation on a DeclRefExpr, rather than an ad hoc list of rules to construct DeclRefExprs from the instantiation. A test case for this change will come in with a large commit, which illustrates what I was actually trying to work on. llvm-svn: 74528
-
Argyrios Kyrtzidis authored
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
-
Argyrios Kyrtzidis authored
Timings showed no significant difference before and after the commit. llvm-svn: 74504
-
- Jun 29, 2009
-
-
Douglas Gregor authored
redundant, implicit instantiations of function templates and provide a place where we can hang function template specializations. llvm-svn: 74454
-
- Jun 26, 2009
-
-
Douglas Gregor authored
For a FunctionDecl that has been instantiated due to template argument deduction, we now store the primary template from which it was instantiated and the deduced template arguments. From this information, we can instantiate the body of the function template. llvm-svn: 74232
-
Douglas Gregor authored
templates. For example, this now type-checks (but does not instantiate the body of deref<int>): template<typename T> T& deref(T* t) { return *t; } void test(int *ip) { int &ir = deref(ip); } Specific changes/additions: * Template argument deduction from a call to a function template. * Instantiation of a function template specializations (just the declarations) from the template arguments deduced from a call. * FunctionTemplateDecls are stored directly in declaration contexts and found via name lookup (all forms), rather than finding the FunctionDecl and then realizing it is a template. This is responsible for most of the churn, since some of the core declaration matching and lookup code assumes that all functions are FunctionDecls. llvm-svn: 74213
-
- Jun 23, 2009
-
-
Douglas Gregor authored
specialization. At present, all implicit instantiations occur at the end of the translation unit. llvm-svn: 73915
-
- Jun 22, 2009
-
-
Douglas Gregor authored
compilation, and (hopefully) introduce RAII objects for changing the "potentially evaluated" state at all of the necessary places within Sema and Parser. Other changes: - Set the unevaluated/potentially-evaluated context appropriately during template instantiation. - We now recognize three different states while parsing or instantiating expressions: unevaluated, potentially evaluated, and potentially potentially evaluated (for C++'s typeid). - When we're in a potentially potentially-evaluated context, queue up MarkDeclarationReferenced calls in a stack. For C++ typeid expressions that are potentially evaluated, we will play back these MarkDeclarationReferenced calls when we exit the corresponding potentially potentially-evaluated context. - Non-type template arguments are now parsed as constant expressions, so they are not potentially-evaluated. llvm-svn: 73899
-
- May 29, 2009
-
-
Douglas Gregor authored
template instantiation. This helps reduce our stack footprint when performing deep template instantiations. llvm-svn: 72582
-
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
-
- 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
-
- May 27, 2009
-
-
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
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
-
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
-
- May 26, 2009
-
-
Douglas Gregor authored
llvm-svn: 72433
-
- May 21, 2009
-
-
Jay Foad authored
llvm-svn: 72210
-
- May 18, 2009
-
-
Douglas Gregor authored
llvm-svn: 72035
-
Douglas Gregor authored
template, introduce that member function into the template instantiation stack. Also, add diagnostics showing the member function within the instantiation stack and clean up the qualified-name printing so that we get something like: note: in instantiation of member function 'Switch1<int, 2, 2>::f' requested here in the template instantiation backtrace. llvm-svn: 72015
-
- May 16, 2009
-
-
Mike Stump authored
llvm-svn: 71936
-
Mike Stump authored
llvm-svn: 71930
-
- May 15, 2009
-
-
Douglas Gregor authored
constructors and destructors. This is a requirement of DeclarationNameTable::getCXXSpecialName that we weren't assert()'ing, so it should have been caught much earlier :( Big thanks to Anders for the test case. llvm-svn: 71895
-
Douglas Gregor authored
instantiating the definition of a function from a template. llvm-svn: 71869
-
Douglas Gregor authored
llvm-svn: 71818
-
Douglas Gregor authored
functions of class templates. Only compound statements and expression statements are currently implemented. llvm-svn: 71814
-
Anders Carlsson authored
llvm-svn: 71802
-
- May 14, 2009
-
-
Douglas Gregor authored
Introduce a stack of instantiation scopes that are used to store the mapping from variable declarations that occur within templates to their instantiated counterparts llvm-svn: 71799
-
Douglas Gregor authored
template to the FunctionDecls from which they were instantiated. This is a necessary first step to support instantiation of the definitions of such functions, but by itself does essentially nothing. llvm-svn: 71792
-
- May 13, 2009
-
-
Douglas Gregor authored
of class members (recursively). Only member classes are actually instantiated; the instantiation logic for member functions and variables are just stubs. llvm-svn: 71713
-
- May 12, 2009
-
-
Douglas Gregor authored
TemplateArgumentList. This avoids the need to pass around pointer/length pairs of template arguments lists, and will eventually make it easier to introduce member templates and variadic templates. llvm-svn: 71517
-