Skip to content

Commit eba957a

Browse files
committed
Add LIT test
1 parent ff5dfd4 commit eba957a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

clang/test/SemaCXX/wreturn-always-throws.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,18 @@ void testTemplates() {
4444
throwErrorTemplate("ERROR");
4545
(void)ensureZeroTemplate(42);
4646
}
47+
48+
// Ensure that explicit specialization of a member function does not inherit
49+
// the warning from the primary template.
50+
51+
template<typename T>
52+
struct S {
53+
void f();
54+
};
55+
56+
template<typename T>
57+
void S<T>::f() { throw 0; }
58+
template<>
59+
void S<int>::f() {} // expected-no-diagnostics
60+
61+

0 commit comments

Comments
 (0)