- Apr 30, 2010
-
-
Douglas Gregor authored
llvm-svn: 102695
-
Douglas Gregor authored
specializations, which keeps track of the order in which they were originally declared. We use this number so that we can always walk the list of partial specializations in a predictable order during matching or template instantiation. This also fixes a failure in Boost.Proto, where SourceManager::isBeforeInTranslationUnit was behaving poorly in inconsistent ways. llvm-svn: 102693
-
John McCall authored
entering the current instantiation. Set up a little to preserve type location information for typename types while we're in there. Fixes a Boost failure. llvm-svn: 102673
-
- Apr 29, 2010
-
-
Douglas Gregor authored
address of an overloaded function (or function template), perform that resolution prior to determining the implicit conversion sequence. This resolution is not part of the implicit conversion sequence itself. Previously, we would always consider this resolution to be a function pointer decay, which was a lie: there might be an explicit & in the expression, in which case decay should not occur. This caused the CodeGen assertion in PR6973 (where we created a pointer to a pointer to a function when we should have had a pointer to a function), but it's likely that there are corner cases of overload resolution where this would have failed. Cleaned up the code involved in determining the type that will produced afer resolving the overloaded function reference, and added an assertion to make sure the result is correct. Fixes PR6973. llvm-svn: 102650
-
Fariborz Jahanian authored
categories. Issue usual warnings instead of confusing error message. Radar 7920807 llvm-svn: 102645
-
Ted Kremenek authored
Do some minor refactoring along the way. llvm-svn: 102635
-
Ted Kremenek authored
for similar methods. No functionality change. llvm-svn: 102634
-
Douglas Gregor authored
specializations, substitute the deduced template arguments and check the resulting substitution before concluding that template argument deduction succeeds. This marvelous little fix makes a bunch of Boost.Spirit tests start working. llvm-svn: 102601
-
Douglas Gregor authored
specializations, separate out the deduction part from the checking and substitution of the deduced arguments. llvm-svn: 102600
-
Douglas Gregor authored
bindings when the template argument is still an expression; it happens while checking the template arguments of a class template partial specializations. Fixes PR6964. llvm-svn: 102595
-
John McCall authored
template decl itself, not its context. Testcase to follow; fixes selfhost. llvm-svn: 102578
-
John McCall authored
template argument deduction or (more importantly) the final substitution required by such deduction. Makes access control magically work in these cases. Fixes PR6967. llvm-svn: 102572
-
Douglas Gregor authored
classes, since we only warn (not error) on offsetof() for non-POD types. We store the base path within the OffsetOfExpr itself, then evaluate the offsets within the constant evaluator. llvm-svn: 102571
-
Alexis Hunt authored
as well as pre- and post-inc/decrements in C (not that I think it matters for any C code). llvm-svn: 102552
-
Douglas Gregor authored
Fix template instantiation for __builtin_offfsetof expressions that refer to members of anonymous structs/unions llvm-svn: 102551
-
Douglas Gregor authored
llvm-svn: 102548
-
Douglas Gregor authored
Amadini. This change introduces a new expression node type, OffsetOfExpr, that describes __builtin_offsetof. Previously, __builtin_offsetof was implemented using a unary operator whose subexpression involved various synthesized array-subscript and member-reference expressions, which was ugly and made it very hard to instantiate as a template. OffsetOfExpr represents the AST more faithfully, with proper type source information and a more compact representation. OffsetOfExpr also has support for dependent __builtin_offsetof expressions; it can be value-dependent, but will never be type-dependent (like sizeof or alignof). This commit introduces template instantiation for __builtin_offsetof as well. There are two major caveats to this patch: 1) CodeGen cannot handle the case where __builtin_offsetof is not a constant expression, so it produces an error. So, to avoid regressing in C, we retain the old UnaryOperator-based __builtin_offsetof implementation in C while using the shiny new OffsetOfExpr implementation in C++. The old implementation can go away once we have proper CodeGen support for this case, which we expect won't cause much trouble in C++. 2) __builtin_offsetof doesn't work well with non-POD class types, particularly when the designated field is found within a base class. I will address this in a subsequent patch. Fixes PR5880 and a bunch of assertions when building Boost.Python tests. llvm-svn: 102542
-
- Apr 28, 2010
-
-
Fariborz Jahanian authored
ivar of c++ object types. llvm-svn: 102500
-
Abramo Bagnara authored
llvm-svn: 102496
-
Douglas Gregor authored
complete, return an error rather than falling back to building a dependent declaration reference, since we might not be in a dependent context. Fixes a fiendish crash-on-invalid in Boost.FunctionTypes that I wasn't able to reduce to anything useful. llvm-svn: 102491
-
Douglas Gregor authored
template argument deduction, use the lexical declaration context as the owner for friend function templates. Fixes 2 failures in Boost.Graph. llvm-svn: 102489
-
- Apr 27, 2010
-
-
Douglas Gregor authored
visible. Fixes the remaining two failures in Boost.ScopeExit. llvm-svn: 102466
-
Douglas Gregor authored
keep track of whether we need to zero-initialize storage prior to calling its constructor. Previously, we were only tracking this when implicitly constructing the object (a CXXConstructExpr). Fixes Boost's value-initialization tests, which means that the Boost.Config library now passes all of its tests. llvm-svn: 102461
-
Douglas Gregor authored
we were relying on checking for abstract class types when an array type was actually used to declare a variable, parameter, etc. However, we need to check when the construct the array for, e.g., SFINAE purposes (see DR337). Fixes problems with Boost's is_abstract type trait. llvm-svn: 102452
-
Douglas Gregor authored
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the naming class we computed when building the expression in the template... ... which we didn't always do correctly. Teach UnresolvedMemberExpr::getNamingClass() all about the new representation of injected-class-names in templates, so that it can return a naming class that is the current instantiation. Also, when decomposing a template-id into its template name and its arguments, be sure to set the naming class on the LookupResult structure. Fixes PR6947 the right way. llvm-svn: 102448
-
Fariborz Jahanian authored
from AST, consider ivar array of objects (per Doug's comment). llvm-svn: 102446
-
Douglas Gregor authored
tag of the same name, compare the lookup contexts rather than the actual contexts. Fixes PR6923. llvm-svn: 102437
-
Douglas Gregor authored
variables. Fixes PR6948. llvm-svn: 102436
-
Douglas Gregor authored
expressions, be sure to set the naming class of the LookupResult structure. Fixes PR6947. llvm-svn: 102434
-
John McCall authored
with a qualifier referencing a different type. llvm-svn: 102409
-
John McCall authored
of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
-
Douglas Gregor authored
by using TypeSourceInfo, cleaning up the representation somewhat. Teach getTypeOperand() to strip references and cv-qualifiers, providing the semantic view of the type without requiring any extra storage (the unmodified type remains within the TypeSourceInfo). This fixes a bug found by Boost's call_traits test. Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId functions, which perform the semantic analysis for typeid(type) and typeid(expression), respectively. We now perform less work at template instantiation time (we don't look for std::type_info again) and can give better diagnostics. llvm-svn: 102393
-
Fariborz Jahanian authored
llvm-svn: 102390
-
- Apr 26, 2010
-
-
Douglas Gregor authored
thing. Audit all uses of Type::isStructure(), changing those calls to isStructureOrClassType() as needed (which is alsmost everywhere). Fixes the remaining failure in Boost.Utility/Swap. llvm-svn: 102386
-
Douglas Gregor authored
Objective-C++. This is the last bit of (non-blocks-related) template instantiation logic for Objective-C++. Yay! llvm-svn: 102382
-
Douglas Gregor authored
llvm-svn: 102379
-
Douglas Gregor authored
references and isa expressions. Also, test template instantiation of unresolved member references to Objective-C ivar references and isa expressions. llvm-svn: 102374
-
Douglas Gregor authored
statements. This is the last of the Objective-C statements. llvm-svn: 102356
-
Douglas Gregor authored
function-parameter checking and splitting it into the normal ActOn*/Build* pair in Sema. We now use VarDecl to represent the @catch parameter rather than the ill-fitting ParmVarDecl. llvm-svn: 102347
-
Douglas Gregor authored
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
-