diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaCXX/warn-unused-filescoped.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-unused-filescoped.cpp b/test/SemaCXX/warn-unused-filescoped.cpp index 75fc6a4da0..628075ac04 100644 --- a/test/SemaCXX/warn-unused-filescoped.cpp +++ b/test/SemaCXX/warn-unused-filescoped.cpp @@ -54,3 +54,19 @@ namespace { }; template <> int TS2<int>::x; // expected-warning{{unused}} } + +namespace PR8841 { + // Ensure that friends of class templates are considered to have a dependent + // context and not marked unused. + namespace { + template <typename T> struct X { + friend bool operator==(const X&, const X&) { return false; } + }; + } + template <typename T> void template_test(X<T> x) { + (void)(x == x); + } + void test(X<int> x) { + template_test(x); + } +} |