- Jan 08, 2011
-
-
Chandler Carruth authored
temporaries with no-return destructors. The CFG now properly supports temporaries and implicit destructors which both makes this kludge no longer work, and conveniently removes the need for it. Turn on CFG handling of implicit destructors and initializers. Several ad-hoc benchmarks don't indicate any measurable performance impact from growing the CFG, and it fixes real correctness problems with warnings. As a result of turning on these CFG elements, we started to tickle an inf-loop in the unreachable code logic used for warnings. The fix is trivial. llvm-svn: 123056
-
Ted Kremenek authored
prefix in a printf format string is matched with the appropriate conversion specifier. llvm-svn: 123055
-
- Jan 07, 2011
-
-
Douglas Gregor authored
TreeTransform version of TransformExprs() rather than explicit loop, so that we expand pack expansions properly. Test cast coming soon... llvm-svn: 123014
-
Douglas Gregor authored
function parameter pack expansions. llvm-svn: 123007
-
Douglas Gregor authored
instantiated function parameters, enabling instantiation of arbitrary pack expansions involving function parameter packs. At this point, we can now correctly compile a simple, variadic print() example: #include <iostream> #include <string> void print() {} template<typename Head, typename ...Tail> void print(const Head &head, const Tail &...tail) { std::cout << head; print(tail...); } int main() { std::string hello = "Hello"; print(hello, ", world!", " ", 2011, '\n'); } llvm-svn: 123000
-
Douglas Gregor authored
parameters into parameter types, so that substitution of explicitly-specified function template arguments uses the same path. This enables the use of explicitly-specified function template arguments with variadic templates. llvm-svn: 122986
-
- Jan 06, 2011
-
-
Douglas Gregor authored
template whose last parameter is a parameter pack. This allows us to form a call to, e.g., template<typename ...Args1, typename ...Args2> void f(std::pair<Args1, Args2> ...pairs); given zero or more instances of "pair". llvm-svn: 122973
-
John McCall authored
The initial TreeTransform is a cop-out, but it's more-or-less equivalent to what we were doing before, or rather what we're doing now and might eventually stop doing in favor of using this type. I am simultaneously intrigued by the possibilities of rebuilding a dependent Attri llvm-svn: 122942
-
Douglas Gregor authored
Fast-path an arity check when performing template argument deduction that compares two parameter-type-lists. No functionality change. llvm-svn: 122928
-
Douglas Gregor authored
TypeSourceInfo when transforming a function parameter. The callees of this routine already assume that TypeSourceInfo will be present, and we want to always be sure that it exists. llvm-svn: 122927
-
Douglas Gregor authored
1) Declaration of function parameter packs 2) Instantiation of function parameter packs within function types. 3) Template argument deduction of function parameter packs when matching two function types. We're missing all of the important template-instantiation logic for function template definitions, along with template argument deduction from the argument list of a function call, so don't even think of trying to use these for real yet. llvm-svn: 122926
-
Fariborz Jahanian authored
property when it is 'readonly'. // rdar://8820813 llvm-svn: 122923
-
- Jan 05, 2011
-
-
Douglas Gregor authored
llvm-svn: 122905
-
Douglas Gregor authored
parameter packs, along with ParmVarDecl::isParameterPack(), which looks for function parameter packs. Use these routines to fix some obvious FIXMEs. llvm-svn: 122904
-
Douglas Gregor authored
template argument packs. Plus, remove a FIXME that I fixed yesterday. llvm-svn: 122903
-
Douglas Gregor authored
corresponding template parameter, make sure that prior converted template arguments are available for substitution. llvm-svn: 122902
-
Argyrios Kyrtzidis authored
llvm-svn: 122900
-
Douglas Gregor authored
for template template argument pack expansions (which was no longer used) and another that was a placeholder for an llvm_unreachable. llvm-svn: 122898
-
Douglas Gregor authored
expansions with something that is easier to use correctly: a new template argment kind, rather than a bit on an existing kind. Update all of the switch statements that deal with template arguments, fixing a few latent bugs in the process. I"m happy with this representation, now. And, oh look! Template instantiation and deduction work for template template argument pack expansions. llvm-svn: 122896
-
Douglas Gregor authored
for template template argument pack expansions. This allows fun such as: template<template<class> class ...> struct apply_impl { /*...*/ }; template<template<class> class ...Metafunctions> struct apply { typedef typename apply_impl<Metafunctions...>::type type; }; However, neither template argument deduction nor template instantiation is implemented for template template argument packs, so this functionality isn't useful yet. I'll probably replace the encoding of template template argument pack expansions in TemplateArgument so that it's harder to accidentally forget about the expansion. However, this is a step in the right general direction. llvm-svn: 122890
-
Douglas Gregor authored
llvm-svn: 122878
-
Douglas Gregor authored
parameter packs. Also, the "no template parameters after a template parameter pack" rule only applies to primary class templates. llvm-svn: 122877
-
Douglas Gregor authored
parameters and template template parameters. llvm-svn: 122875
-
Douglas Gregor authored
template<template<class> class ...Metafunctions> struct apply_to_each; llvm-svn: 122874
-
John McCall authored
llvm-svn: 122872
-
John McCall authored
the declaration-specifiers and on the declarator itself are moved to the appropriate declarator chunk. This permits a greatly simplified model for how to apply these attributes, as well as allowing a much more efficient query for the GC attribute. Now all qualifier queries follow the same basic strategy of "local qualifiers, local qualifiers on the canonical type, then look through arrays". This can be easily optimized by changing the canonical qualified-array-type representation. Do not process type attributes as decl attributes on declarations with declarators. When computing the type of a block, synthesize a prototype function declarator chunk if the decl-spec type was not a function. This simplifies the logic for building block signatures. Change the logic which inserts an objc_read_weak on a block literal to only fire if the block has a __weak __block variable, rather than if the return type of the block is __weak qualified, which is not actually a sensible thing to ask. llvm-svn: 122871
-
Douglas Gregor authored
resolution require that the pointed-to type be an object type, but we weren't filtering out non-object types. Do so, fixing PR7851. llvm-svn: 122853
-
Douglas Gregor authored
conversions on the substituted non-type template arguments of a class template partial specialization. C++ [temp.class.spec]p8 actually prohibits all of the cases where this code would have fired. Hey, it's better than having to deal with variadic templates here! llvm-svn: 122852
-
Douglas Gregor authored
specializations. We weren't dealing with any of the cases where the type of the non-type template argument differs from the type of the corresponding template parameter in the primary template. We would think that the template parameter in the partial specialization was not deducible (and warn about it, incorrectly), then fail to convert a deduced parameter to the type of the template parameter in the partial specialization (which may involve truncation, among other things). Fixes PR8905. llvm-svn: 122851
-
- Jan 04, 2011
-
-
Douglas Gregor authored
llvm-svn: 122848
-
Douglas Gregor authored
variadic templates. No functionality change. llvm-svn: 122847
-
Douglas Gregor authored
Improve the checking of deduced template arguments stored within template argument packs when finishing template argument deduction for a function template llvm-svn: 122843
-
Douglas Gregor authored
parameter pack. Note that we're missing proper libclang support for the new SizeOfPackExpr expression node. llvm-svn: 122813
-
Abramo Bagnara authored
Prefer getAs<ComplexType> rather than cast<ComplexType> on canonical type. Suggestion by Douglas Gregor! llvm-svn: 122807
-
Chandler Carruth authored
int x = 42; x = x; // Warns here. The warning avoids macro expansions, templates, user-defined assignment operators, and volatile types, so false positives are expected to be low. The common (mis-)use of this code pattern is to silence unused variable warnings, but a more idiomatic way of doing that is '(void)x;'. A follow-up to this will add a note and fix-it hint suggesting this replacement in cases where the StmtExpr consists precisely of the self assignment. llvm-svn: 122804
-
Chandler Carruth authored
declaration name of the array when present. This ensures that a poor-man's C++03 static_assert will include the user error message often embedded in the name. Update all the tests to reflect the new wording, and add a test for the name behavior. llvm-svn: 122802
-
Douglas Gregor authored
initialize those lovely mixins that come from pack expansions of base specifiers. llvm-svn: 122793
-
- Jan 03, 2011
-
-
Douglas Gregor authored
llvm-svn: 122782
-
Argyrios Kyrtzidis authored
llvm-svn: 122781
-
Douglas Gregor authored
argument. As part of this, be more careful when determining if there are any parameter packs that cannot be expanded. llvm-svn: 122776
-