diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-11 21:54:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-11 21:54:23 +0000 |
commit | f35f828f9883123772a9731af190a608f3236ef4 (patch) | |
tree | 01f5a4ff2168279d314ec964b4531d78185a8f8b /include/clang/Basic | |
parent | 961c76ea8d5089293e448e5d538570653e28080c (diff) |
Improve diagnostics when a default template argument does not match
with its corresponding template parameter. This can happen when we
performed some substitution into the default template argument and
what we had doesn't match any more, e.g.,
template<int> struct A;
template<typename T, template<T> class X = A> class B;
B<long> b;
Previously, we'd emit a pretty but disembodied diagnostic showing how
the default argument didn't match the template parameter. The
diagnostic was good, but nothing tied it to the *use* of the default
argument in "B<long>". This commit fixes that.
Also, tweak the counting of active template instantiations to avoid
counting non-instantiation records, such as those we create for
(surprise!) checking default arguments, instantiating default
arguments, and performing substitutions as part of template argument
deduction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index e0ac0ada8b..f0e1be82a7 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1102,6 +1102,8 @@ def note_partial_spec_deduct_instantiation_here : Note< def note_prior_template_arg_substitution : Note< "while substituting prior template arguments into %select{non-type|template}0" " template parameter%1 %2">; +def note_template_default_arg_checking : Note< + "while checking a default template argument used here">; def err_field_instantiates_to_function : Error< "data member instantiated with function type %0">; |