| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function templates.
This commit ensures that friend function templates are constructed as
FunctionTemplateDecls rather than partial FunctionDecls (as they
previously were). It then implements template instantiation for friend
function templates, injecting the friend function template only when
no previous declaration exists at the time of instantiation.
Oh, and make sure that explicit specialization declarations are not
friends.
llvm-svn: 83970
|
| |
|
|
|
|
|
| |
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.
llvm-svn: 83890
|
| |
|
|
|
|
|
|
| |
injected-class-name (e.g., when we're referring to other
specializations of the current class template). Make sure that we see
the template rather than the injected-class-name. Fixes PR4768.
llvm-svn: 83672
|
| |
|
|
|
|
|
| |
template instantiation of a member function of a class template.
FIXME -= 2;
llvm-svn: 83520
|
| |
|
|
|
|
|
|
|
| |
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.
llvm-svn: 83509
|
| |
|
|
|
|
|
|
| |
templates. Previously, these weren't handled as specializations at
all. The AST for representing these as specializations is still a work
in progress.
llvm-svn: 83498
|
| |
|
|
|
|
|
|
|
| |
declarations and explicit template instantiations, improving
diagnostics and making the code usable for function template
specializations (as well as class template specializations and partial
specializations).
llvm-svn: 83436
|
| |
|
|
|
|
|
| |
explicit instantiation. Also, tighten up reference-count checking to
help catch these issues earlier. Fixes PR5069.
llvm-svn: 83225
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
overload candidates (but not the built-in ones). We still rely on the
underlying built-in semantic analysis to produce the initial
diagnostic, then print the candidates following that diagnostic.
One side advantage of this approach is that we can perform more validation
of C++'s operator overloading with built-in candidates vs. the
semantic analysis for those built-in operators: when there are no
viable candidates, we know to expect an error from the built-in
operator handling code. Otherwise, we are not modeling the built-in
semantics properly within operator overloading. This is checked as:
assert(Result.isInvalid() &&
"C++ binary operator overloading is missing
candidates!");
if (Result.isInvalid())
PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);
The assert() catches cases where we're wrong in a +Asserts build. The
"if" makes sure that, if this happens in a production clang
(-Asserts), we still build the proper built-in operator and continue
on our merry way. This is effectively what happened before this
change, but we've added the assert() to catch more flies.
llvm-svn: 83175
|
| |
|
|
|
|
| |
class templates
llvm-svn: 83063
|
| |
|
|
|
|
| |
type name within the declaration specifiers. Fixes PR5061.
llvm-svn: 82974
|
| |
|
|
| |
llvm-svn: 82950
|
| |
|
|
|
|
|
|
|
|
|
|
| |
specializations such as:
friend class std::vector<int>;
by using the same code path as explicit specializations, customized to
reference an existing ClassTemplateSpecializationDecl (or build a new
"undeclared" one).
llvm-svn: 82875
|
| |
|
|
|
|
|
|
|
| |
class templates. We now treat friend class templates much more like
normal class templates, except that they still get special name lookup
rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in
<iostream>.
llvm-svn: 82848
|
| |
|
|
|
|
| |
explicit template specializations, when available.
llvm-svn: 82824
|
| |
|
|
|
|
|
|
|
|
|
| |
template void f<int>(int);
~~~~~~
Previously, we silently dropped the template arguments. With this
change, we now use the template arguments (when available) as the
explicitly-specified template arguments used to aid template argument
deduction for explicit template instantiations.
llvm-svn: 82806
|
| |
|
|
|
|
|
|
| |
member functions of class template specializations, and static data
members. The mechanics are (mostly) present, but the semantic analysis
is very weak.
llvm-svn: 82789
|
| |
|
|
|
|
|
|
|
|
|
|
| |
value-dependent. Audit (and fixed) all calls to
Expr::isNullPointerConstant() to provide the correct behavior with
value-dependent expressions. Fixes PR5041 and a crash in libstdc++
<locale>.
In the same vein, properly compute value- and type-dependence for
ChooseExpr. Fixes PR4996.
llvm-svn: 82748
|
| |
|
|
|
|
|
|
| |
complete (or, possibly causing template instantiation).
Test this via some explicit specializations of member functions.
llvm-svn: 82732
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
first implementation recognizes when a function declaration is an
explicit function template specialization (based on the presence of a
template<> header), performs template argument deduction + ambiguity
resolution to determine which template is being specialized, and hooks
There are many caveats here:
- We completely and totally drop any explicitly-specified template
arguments on the floor
- We don't diagnose any of the extra semantic things that we should
diagnose.
- I haven't looked to see that we're getting the right linkage for
explicit specializations
On a happy note, this silences a bunch of errors that show up in
libstdc++'s <iostream>, although Clang still can't get through the
entire header.
llvm-svn: 82728
|
| |
|
|
|
|
|
| |
complain about specializations of member functions that are not
definitions. Fixes PR4995.
llvm-svn: 82159
|
| |
|
|
|
|
|
|
|
|
| |
when we are not instantiating the corresponding "current
instantiation." This happens, e.g., when we are instantiating a
declaration reference that refers into the "current instantiation" but
occurs in a default function argument. The libstdc++ vector default
constructor now instantiates properly.
llvm-svn: 82069
|
| |
|
|
| |
llvm-svn: 81916
|
| |
|
|
|
|
|
|
|
|
| |
point at the template and print out its template arguments, e.g.,
ambiguous-ovl-print.cpp:5:8: note: candidate function template specialization
[with T = int]
void f(T*, long);
llvm-svn: 81907
|
| |
|
|
|
|
| |
existing bug
llvm-svn: 81885
|
| |
|
|
|
|
| |
(C++ [temp.class.order]).
llvm-svn: 81866
|
| |
|
|
|
|
| |
conversion function.
llvm-svn: 81807
|
| |
|
|
|
|
| |
(C++ [temp.func.order]).
llvm-svn: 81777
|
| |
|
|
|
|
| |
except IDNS_TagFriend and IDNS_OrdinaryFriend but then check for IDNS_Tag and IDNS_Ordinary.
llvm-svn: 81730
|
| |
|
|
|
|
|
|
|
| |
instantiation definition can follow an explicit instantiation
declaration. This is as far as I want to go with extern templates now,
but they will still need quite a bit more work to get all of the C++0x
semantics right.
llvm-svn: 81573
|
| |
|
|
|
|
| |
suppressing the implicit instantiation of members of extern templates
llvm-svn: 81567
|
| |
|
|
|
|
|
|
|
|
|
| |
- Diagnose attempts to add default arguments to templates (or member
functions of templates) after the initial declaration (DR217).
- Improve diagnostics when a default argument is redefined. Now, the
note will always point at the place where the default argument was
previously defined, rather than pointing to the most recent
declaration of the function.
llvm-svn: 81548
|
| |
|
|
|
|
|
|
|
|
| |
from its location. Initialize appropriately.
When implicitly creating a declaration of a class template specialization
after encountering the first reference to it, use the pattern class's
location instead of the location of the first reference.
llvm-svn: 81515
|
| |
|
|
|
|
|
| |
partial specialization rather than a subclass of TemplateDecl. Fixes a
crash in libstdc++ 4.2's <map>.
llvm-svn: 81407
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
templates, e.g.,
x.template get<T>
We can now parse these, represent them within an UnresolvedMemberExpr
expression, then instantiate that expression node in simple cases.
This allows us to stumble through parsing LLVM's Casting.h.
llvm-svn: 81300
|
| |
|
|
|
|
|
|
|
| |
for (unsigned i = numargs; i < NumArgs; ++i)
Args[0] = 0;
;)
llvm-svn: 81123
|
| |
|
|
|
|
|
| |
destroying the CXXConstructExpr.", this is causing test failures across the
board.
llvm-svn: 81100
|
| |
|
|
|
|
| |
destroying the CXXConstructExpr.
llvm-svn: 81096
|
| |
|
|
| |
llvm-svn: 81063
|
| |
|
|
| |
llvm-svn: 81062
|
| |
|
|
|
|
|
|
|
|
|
| |
Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!
llvm-svn: 81025
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
expressions, e.g.,
p->~T()
when p is a pointer to a scalar type.
We don't currently diagnose errors when pseudo-destructor expressions
are used in any way other than by forming a call.
llvm-svn: 81009
|
| |
|
|
|
|
| |
then drop it on the floor.
llvm-svn: 80989
|
| |
|
|
|
|
|
|
|
|
|
| |
things, this means that we can properly cope with member access
expressions such as
t->operator T()
where T is a template parameter (or other dependent type).
llvm-svn: 80957
|
| |
|
|
|
|
|
|
|
| |
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.
llvm-svn: 80953
|
| |
|
|
|
|
|
|
| |
with to properly support member access expressions in templates. This
test is XFAIL'd, because we get it completely wrong, but I've made the
minimal changes to the representation to at least avoid a crash.
llvm-svn: 80856
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
x->Base::f
We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.
We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.
I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.
llvm-svn: 80843
|
| |
|
|
|
|
| |
the nested-name-specifier
llvm-svn: 80784
|
| |
|
|
|
|
|
|
|
|
|
|
| |
simple-template-id form), check whether the scope specifier is
computable as a declaration context rather than checking whether it is
dependent, so that we properly cope with members of the current
instantiation.
Improve testing for typename specifiers that terminate in a
simpe-template-id.
llvm-svn: 80783
|
| |
|
|
|
|
| |
each of the functions in the overload set
llvm-svn: 80692
|