* Add test for #11177 * Add test for #6504
This commit is contained in:
parent
f27fbdd8ab
commit
bb2ba53bf5
|
@ -4332,6 +4332,14 @@ private:
|
|||
"template<class T1, class T2>\n"
|
||||
"A<B<T1, T2>>::A() : m_value(false) {}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("template <typename T> struct S;\n" // #11177
|
||||
"template <> struct S<void> final {\n"
|
||||
" explicit S(int& i);\n"
|
||||
" int& m;\n"
|
||||
"};\n"
|
||||
"S<void>::S(int& i) : m(i) {}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void unknownTemplateType() {
|
||||
|
|
|
@ -696,6 +696,12 @@ private:
|
|||
ASSERT_EQUALS("[test.cpp:2]: (warning) Redundant code: Found a statement that begins with NULL constant.\n"
|
||||
"[test.cpp:3]: (warning) Redundant code: Found a statement that begins with NULL constant.\n",
|
||||
errout.str());
|
||||
|
||||
check("struct S { int i; };\n" // #6504
|
||||
"void f(S* s) {\n"
|
||||
" (*s).i;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (warning) Redundant code: Found unused member access.\n", errout.str());
|
||||
}
|
||||
|
||||
void vardecl() {
|
||||
|
|
Loading…
Reference in New Issue