| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
after we've already instantiated a definition for the function, pass it to the
ASTConsumer again so that it knows the specialization kind has changed and can
update the function's linkage.
This only matters if we instantiate the definition of the function before we
reach the end of the TU; this can happen in at least three different ways:
C++11 constexpr functions, C++14 deduced return types, and functions
instantiated within modules.
llvm-svn: 207152
|
|
|
|
|
|
| |
symbols in non-imported modules.
llvm-svn: 206977
|
|
|
|
| |
llvm-svn: 206452
|
|
|
|
|
|
|
|
| |
definition.
clang\lib\Sema\SemaTemplate.cpp(1826) : error C2064: term does not evaluate to a function taking 1 arguments
llvm-svn: 206451
|
|
|
|
|
|
|
| |
that looks like it might be an explicit specialization, don't recover as an
explicit specialization (bypassing the check that would reject that).
llvm-svn: 206444
|
|
|
|
|
|
| |
template-id after its scope specifier into a single place.
llvm-svn: 206442
|
|
|
|
|
|
|
|
|
|
|
|
| |
at ... )')
For namespaces, this is consistent with mangling and GCC's debug info
behavior. For structs, GCC uses <anonymous struct> but we prefer
consistency between all anonymous entities but don't want to confuse
them with template arguments, etc, so we'll just go with parens in all
cases.
llvm-svn: 205398
|
|
|
|
|
|
| |
param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204045
|
|
|
|
|
|
| |
class.
llvm-svn: 203640
|
|
|
|
|
|
| |
iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203248
|
|
|
|
|
|
| |
spotting this!
llvm-svn: 201871
|
|
|
|
|
|
|
|
|
|
| |
template parameters, don't look for parameters of outer templates. If a problem
is found in a default template argument, point the diagnostic at the partial
specialization (with a note pointing at the default argument) instead of
pointing it at the default argument and leaving it unclear which partial
specialization os problematic.
llvm-svn: 201031
|
|
|
|
|
|
|
|
|
|
|
|
| |
Properly determine the inheritance model when dealing with nullptr:
- If a nullptr template argument is being checked against
pointer-to-member parameter, nail down an inheritance model.
N.B. We will chose an inheritance model even if we won't ultimately
choose the template to instantiate! Cooky, right?
- Null pointer-to-datamembers have a virtual base table offset of -1,
not zero. Previously, we chose an offset of 0.
llvm-svn: 200920
|
|
|
|
|
|
| |
variable template until we know what the template arguments actually are.
llvm-svn: 200714
|
|
|
|
|
|
|
| |
Otherwise we'd accept them if the LinkageDecl was not the direct
parent DeclContext. PR17968.
llvm-svn: 200641
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A return type is the declared or deduced part of the function type specified in
the declaration.
A result type is the (potentially adjusted) type of the value of an expression
that calls the function.
Rule of thumb:
* Declarations have return types and parameters.
* Expressions have result types and arguments.
llvm-svn: 200082
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a perennial source of confusion in the clang type system: Declarations and
function prototypes have parameters to which arguments are supplied, so calling
these 'arguments' was a stretch even in C mode, let alone C++ where default
arguments, templates and overloading make the distinction important to get
right.
Readability win across the board, especially in the casting, ADL and
overloading implementations which make a lot more sense at a glance now.
Will keep an eye on the builders and update dependent projects shortly.
No functional change.
llvm-svn: 199686
|
|
|
|
|
|
| |
lookup when declaring a variable template specialization.
llvm-svn: 199438
|
|
|
|
|
|
|
| |
issue 1430. Don't allow a pack expansion to be used as an argument to an alias
template unless the corresponding parameter is a parameter pack.
llvm-svn: 198833
|
|
|
|
|
|
|
|
| |
type-specifier in C++. Some checks will assert in this case otherwise (in
particular, the access specifier may be missing if this happens inside a class
definition, due to a violation of an AST invariant).
llvm-svn: 198721
|
|
|
|
|
|
|
| |
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.
llvm-svn: 198686
|
|
|
|
|
|
|
|
| |
unneeded typecasts. getScopeRep() already returns a NestedNameSpecifier.
No functional changes intended.
llvm-svn: 198414
|
|
|
|
|
|
|
|
|
|
| |
is specialized by an explicit specialization, start from the first declaration
in case we've got a member of a class template (redeclarations might not number
the template parameters the same way).
Our recover here is still far from ideal.
llvm-svn: 197305
|
|
|
|
|
|
| |
This fixes pr18141.
llvm-svn: 196855
|
|
|
|
|
|
|
|
|
|
|
|
| |
The standard is pretty clear on what it allows inside of template
arguments for non-type template parameters of pointer-to-member.
They must be of the form &qualified-id and cannot come from sources like
constexpr VarDecls or things of that nature.
This fixes PR18192.
llvm-svn: 196852
|
|
|
|
|
|
|
| |
instantiation appears in a non-enclosing namespace (the previous diagnostic
talked about the C++98 rule even in C++11 mode).
llvm-svn: 196642
|
|
|
|
|
|
|
| |
name from the enclosing namespace set if the name is specified as a
qualified-id.
llvm-svn: 196464
|
|
|
|
|
|
|
|
|
| |
nested-name-specifier, rather than crashing. (In fact, reject all
literal-operator-ids that have a non-namespace nested-name-specifier). The
grammar doesn't allow these in some cases, and in other cases does allow them
but instantiation will always fail.
llvm-svn: 196443
|
|
|
|
|
|
| |
to a variable template specialization.
llvm-svn: 196337
|
|
|
|
|
|
| |
simple-template-ids (eg, 'operator+<int>') in weird places.
llvm-svn: 196333
|
|
|
|
|
|
|
|
| |
Before we were considering them only when instantiating templates.
This fixes pr18033.
llvm-svn: 196050
|
|
|
|
|
|
|
|
|
|
|
| |
We would fail to instantiate them when the surrounding function was
instantiated. Instantiate the class and add it's members to the list of
pending instantiations, they should be resolved when we are finished
with the function's body.
This fixes PR9685.
llvm-svn: 195827
|
|
|
|
|
|
|
| |
There are about 30 removed in this patch, generated by a new FixIt I haven't
got round to submitting yet.
llvm-svn: 195814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous patches tried to deduce the correct function type. I now realize
this is not possible in general. Consider
class foo {
template <typename T> static void bar(T v);
};
extern template void foo::bar(const void *);
We will only know that bar is static after a lookup, so we have to handle this
in the template instantiation code.
This patch reverts my previous two changes (but not the tests) and instead
handles the issue in DeduceTemplateArguments.
llvm-svn: 195154
|
|
|
|
|
|
| |
support.
llvm-svn: 194273
|
|
|
|
|
|
| |
inappropriately in non-type template arguments
llvm-svn: 193462
|
|
|
|
|
|
|
|
|
|
|
|
| |
with an IndirectFieldDecl
We only considered FieldDecl and CXXMethodDecl as appropriate which
would cause us to believe the IndirectFieldDecl corresponded to an
argument of it's field type instead of a pointer-to-member type.
This fixes PR17696.
llvm-svn: 193461
|
|
|
|
|
|
|
|
|
|
|
| |
We would not identify pointer-to-member construction in a non-type
template argument if it was either a FieldDecl or a CXXMethodDecl.
However, this would incorrectly reject declarations that were injected
via an IndirectFieldDecl (e.g. a field inside of an anonymous union).
This fixes PR17657.
llvm-svn: 193203
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Enforce the rule in C++11 [temp.mem]p2 that local classes cannot have
member templates.
This fixes PR16947.
N.B. C++14 has slightly different wording to afford generic lambdas
declared inside of functions.
Fun fact: Some formulations of local classes with member templates
would cause clang to crash during Itanium mangling, such as the
following:
void outer_mem() {
struct Inner {
template <typename = void>
struct InnerTemplateClass {
static void itc_mem() {}
};
};
Inner::InnerTemplateClass<>::itc_mem();
}
Reviewers: eli.friedman, rsmith, doug.gregor, faisalv
Reviewed By: doug.gregor
CC: cfe-commits, ygao
Differential Revision: http://llvm-reviews.chandlerc.com/D1866
llvm-svn: 193144
|
|
|
|
|
|
| |
holdover from the long-dead Action interface.
llvm-svn: 192203
|
|
|
|
|
|
|
|
|
|
| |
The bool conversion operator on InstantiatingTemplate never added value and
only served to obfuscate the template instantiation routines.
This replaces the conversion and its callers with an explicit isInvalid()
function to make it clear what's going on at a glance.
llvm-svn: 192177
|
|
|
|
|
|
|
|
|
| |
uses.
This fixes one of the two remaining failures to implement [[deprecated]]
as specified for C++14.
llvm-svn: 191572
|
|
|
|
|
|
| |
appropriately, especially when they appear within class templates.
llvm-svn: 191548
|
|
|
|
|
|
| |
something, for variable templates.
llvm-svn: 191278
|
|
|
|
| |
llvm-svn: 190959
|
|
|
|
|
|
| |
argument list, but could be instantiated with argument list of <>.
llvm-svn: 190913
|
|
|
|
|
|
|
| |
call; remove its 'number of explicit arguments' and 'what kind of call'
parameters.
llvm-svn: 190444
|
|
|
|
|
|
|
|
|
|
| |
As requested when applying the same logic to calling conventions.
Reviewers: rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D1634
llvm-svn: 190441
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Calling conventions are inherited during decl merging. Before this
change, deduction would fail due to a type mismatch between the template
and the specialization. This change adjusts the CCs to match before
deduction, and lets the decl merging logic diagnose mismatch or inherit
the CC from the template.
This allows specializations of static member function templates in the
Microsoft C++ ABI.
Reviewers: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1570
llvm-svn: 190377
|
|
|
|
| |
llvm-svn: 189857
|