diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-03-10 20:44:00 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-03-10 20:44:00 +0000 |
| commit | 79cf603428c2d93d80f1871c24c8c35805225d31 (patch) | |
| tree | 33d96b462058d10958b5c3b69a226119e83bb388 /clang/test/SemaTemplate | |
| parent | e8dd2847ff3eb3918bfb07706920e741d21608fd (diff) | |
| download | bcm5719-llvm-79cf603428c2d93d80f1871c24c8c35805225d31.tar.gz bcm5719-llvm-79cf603428c2d93d80f1871c24c8c35805225d31.zip | |
Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.
In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.
llvm-svn: 66572
Diffstat (limited to 'clang/test/SemaTemplate')
| -rw-r--r-- | clang/test/SemaTemplate/instantiation-default-1.cpp | 3 | ||||
| -rw-r--r-- | clang/test/SemaTemplate/instantiation-default-2.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/SemaTemplate/instantiation-default-1.cpp b/clang/test/SemaTemplate/instantiation-default-1.cpp index 57071f46402..3060fdc6fd6 100644 --- a/clang/test/SemaTemplate/instantiation-default-1.cpp +++ b/clang/test/SemaTemplate/instantiation-default-1.cpp @@ -32,7 +32,8 @@ void test_Def2(Def2<int, int const*> *d2) { d2->foo(); } -Def2<int&> *d2; +typedef int& int_ref_t; +Def2<int_ref_t> *d2; // expected-note{{in instantiation of default argument for 'Def2<int &>' required here}} template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1'}} diff --git a/clang/test/SemaTemplate/instantiation-default-2.cpp b/clang/test/SemaTemplate/instantiation-default-2.cpp index e91a98e2f71..9d6b047f377 100644 --- a/clang/test/SemaTemplate/instantiation-default-2.cpp +++ b/clang/test/SemaTemplate/instantiation-default-2.cpp @@ -15,4 +15,4 @@ Constant<float (*)(int, double), &f> *c5; Constant<float (*)(int, int), f> *c6; // expected-error{{non-type template argument of type 'float (*)(int, double)' cannot be converted to a value of type 'float (*)(int, int)'}} -Constant<float, 0> *c7; +Constant<float, 0> *c7; // expected-note{{in instantiation of default argument for 'Constant<float>' required here}} |

