summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/test/redundantcast.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/test/redundantcast.cxx')
-rw-r--r--compilerplugins/clang/test/redundantcast.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/redundantcast.cxx b/compilerplugins/clang/test/redundantcast.cxx
index 0c1087ab32af..f3573d0ad20d 100644
--- a/compilerplugins/clang/test/redundantcast.cxx
+++ b/compilerplugins/clang/test/redundantcast.cxx
@@ -473,6 +473,18 @@ void testSalIntTypes() {
(void) static_cast<Other>(n); // doesn't warn either
}
+void testFunctionalCast2() {
+ struct S1 { S1(int, int, int, int) {} };
+
+ // expected-error@+1 {{redundant functional cast [loplugin:redundantcast]}}
+ S1 aTitleBarBox(S1(0, 0, 0, 0));
+ (void)aTitleBarBox;
+
+ // no warning expected
+#define S1_COL S1(0,0,0,0)
+ S1 aTest2(S1_COL);
+}
+
int main() {
testConstCast();
testStaticCast();