Anders Carlsson [Wed, 26 Aug 2009 22:33:56 +0000 (22:33 +0000)]
Add a RequireCompleteType variant that takes a PartialDiagnostic. The old RequireCompleteType now creates a PartialDiagnostic and calls the new function.
Mike Stump [Wed, 26 Aug 2009 20:46:33 +0000 (20:46 +0000)]
Implement virtual dispatch. :-) This is self-consistent with clang,
but not yet necessarily perfectly consistent with gcc. Also addressed
Doug and John's comments.
Eli Friedman [Wed, 26 Aug 2009 20:01:39 +0000 (20:01 +0000)]
Make address-space qualification work correctly for compound literals.
Issue reported on cfe-dev.
Also fixed the code to use isConstant to determine whether to generate a
constant global, to be consistent with CodeGenModule. This probably
needs to be refactored to deal with C++, though.
Douglas Gregor [Wed, 26 Aug 2009 18:27:52 +0000 (18:27 +0000)]
When we know that we are parsing a class-name, implicitly construct a
TypenameType if getTypeName is looking at a member of an unknown
specialization. This allows us to properly parse class templates that
derived from type that could only otherwise be described by a typename type,
e.g.,
template<class T> struct X {};
template<typename T> struct Y : public X<T>::X { };
Douglas Gregor [Wed, 26 Aug 2009 00:04:55 +0000 (00:04 +0000)]
Improve diagnostics and recovery when the nested-name-specifier of a
qualified name does not actually refer into a class/class
template/class template partial specialization.
Improve printing of nested-name-specifiers to eliminate redudant
qualifiers. Also, make it possible to output a nested-name-specifier
through a DiagnosticBuilder, although there are relatively few places
that will use this leeway.
Ted Kremenek [Tue, 25 Aug 2009 23:29:04 +0000 (23:29 +0000)]
Fix regression in BasicStoreManager caused by implicitly casting loaded values and trying to load/store from arrays. RegionStoreManager already properly handles these cases well; we just need to gracefully not handle this case in BasicStoreManager. This fixes PR 4781.
Ted Kremenek [Tue, 25 Aug 2009 22:55:09 +0000 (22:55 +0000)]
Handle pointer arithmetic in RegionStoreManager involving Objective-C pointers
when using the non-fragile Objective-C ABI. This fixes <rdar://problem/7168531>.
Douglas Gregor [Tue, 25 Aug 2009 22:51:20 +0000 (22:51 +0000)]
Improve support for out-of-line definitions of nested templates and
their members, including member class template, member function
templates, and member classes and functions of member templates.
To actually parse the nested-name-specifiers that qualify the name of
an out-of-line definition of a member template, e.g.,
template<typename X> template<typename Y>
X Outer<X>::Inner1<Y>::foo(Y) {
return X();
}
we need to look for the template names (e.g., "Inner1") as a member of
the current instantiation (Outer<X>), even before we have entered the
scope of the current instantiation. Since we can't do this in general
(i.e., we should not be looking into all dependent
nested-name-specifiers as if they were the current instantiation), we
rely on the parser to tell us when it is parsing a declaration
specifier sequence, and, therefore, when we should consider the
current scope specifier to be a current instantiation.
Printing of complicated, dependent nested-name-specifiers may be
somewhat broken by this commit; I'll add tests for this issue and fix
the problem (if it still exists) in a subsequent commit.
Ted Kremenek [Tue, 25 Aug 2009 20:51:30 +0000 (20:51 +0000)]
Fix crash reported in <rdar://problem/7124210> by "back-porting" some of the
implicit cast logic in RegionStoreManager to BasicStoreManager. This involved
moving CastRetriedVal from RegionStoreManager to StoreManager.
John McCall [Tue, 25 Aug 2009 17:53:59 +0000 (17:53 +0000)]
Modify an assert to capture the restriction on friend declarations more
accurately. Prevents the assert from triggering incorrectly when friending
functions first declared in extern "C" contexts. Fixes bug 4757.
Douglas Gregor [Tue, 25 Aug 2009 17:23:04 +0000 (17:23 +0000)]
Implement out-of-line definitions of nested class templates. Most of
the logic is there for out-of-line definitions with multiple levels of
nested templates, but this is still a work-in-progress: we're having
trouble determining when we should look into a dependent
nested-name-specifier.
Anders Carlsson [Tue, 25 Aug 2009 13:46:13 +0000 (13:46 +0000)]
If a parameter has a default argument expression, make sure to instantiate the parameter type before checking that the expression is a valid initializer.
Zhongxing Xu [Tue, 25 Aug 2009 06:51:30 +0000 (06:51 +0000)]
Remove CodeDecl and CFG from GRExprEngine and GRStateManager.
Now AnalysisManager is the only place we can get CodeDecl.
This leads to an API change: GRState::bindExpr() now takes the CFG argument.
Douglas Gregor [Mon, 24 Aug 2009 23:03:25 +0000 (23:03 +0000)]
Keep track of the template parameter depth properly when we have
member templates declared inside other templates. This allows us to
match out-of-line definitions of member function templates within
class templates to the declarations within the class template. We
still can't handle out-of-line definitions for member class templates,
however.
Ted Kremenek [Mon, 24 Aug 2009 22:47:34 +0000 (22:47 +0000)]
ConstraintManager::AssumeDual now accepts a 'DefinedSVal' instead of 'SVal' for
the condition. This eliminates a source of bugs where the client doesn't
correctly reason about undefined or unknown values. This fixes PR 4759.
Ted Kremenek [Mon, 24 Aug 2009 22:41:15 +0000 (22:41 +0000)]
Introduce 'DefinedSVal', an intermediate parent class between Loc/NonLoc and
SVal. This allows us to use the C++ type system to distinguish between SVals
that are potentially unknown/undefined and those that are not.
Douglas Gregor [Mon, 24 Aug 2009 17:42:35 +0000 (17:42 +0000)]
Implement support for equality comparisons (!=, ==) of member
pointers, by extending the "composite pointer type" logic to include
member pointer types.
Introduce test cases for member pointer comparisons, including those
that involve the builtin operator candidates implemented earlier.
Douglas Gregor [Mon, 24 Aug 2009 15:23:48 +0000 (15:23 +0000)]
Try to complete a type before looking for conversion functions within
that type. Note that we do not produce a diagnostic if the type is
incomplete; rather, we just don't look for conversion functions. Fixes PR4660.
Douglas Gregor [Mon, 24 Aug 2009 13:43:27 +0000 (13:43 +0000)]
Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.
Douglas Gregor [Mon, 24 Aug 2009 11:57:43 +0000 (11:57 +0000)]
Make sure to adjust function template declarations to their templated
declarations (e.g., FunctionTemplateDecl -> CXXConstructorDecl) before
performing semantic analysis on the declarations. Fixes PR4761.