diff options
Diffstat (limited to 'compilerplugins/clang/test')
-rw-r--r-- | compilerplugins/clang/test/redundantinline.cxx | 10 | ||||
-rw-r--r-- | compilerplugins/clang/test/redundantinline.hxx | 20 |
2 files changed, 21 insertions, 9 deletions
diff --git a/compilerplugins/clang/test/redundantinline.cxx b/compilerplugins/clang/test/redundantinline.cxx index 038a1497d98e..f69e0a3b80cf 100644 --- a/compilerplugins/clang/test/redundantinline.cxx +++ b/compilerplugins/clang/test/redundantinline.cxx @@ -11,4 +11,14 @@ S1::~S1() = default; +static inline int f8() { return 0; } // expected-error {{function has no external linkage but is explicitly declared 'inline' [loplugin:redundantinline]}} + +namespace { + +static inline int f9() { return 0; } // expected-error {{function has no external linkage but is explicitly declared 'inline' [loplugin:redundantinline]}} + +} + +int main() { return f8() + f9(); } + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/test/redundantinline.hxx b/compilerplugins/clang/test/redundantinline.hxx index e4efc5663e42..8e87ae05fcf7 100644 --- a/compilerplugins/clang/test/redundantinline.hxx +++ b/compilerplugins/clang/test/redundantinline.hxx @@ -52,27 +52,29 @@ void f3() {} S3::operator int() { return 0; } struct S4 { - inline S4() {} // expected-error {{[loplugin:redundantinline]}} - inline ~S4() { f1(); } // expected-error {{[loplugin:redundantinline]}} + inline S4() {} // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} + inline ~S4() { f1(); } // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} - inline void f1() { (void)this; } // expected-error {{[loplugin:redundantinline]}} + inline void f1() { (void)this; } // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} - static inline void f2() {} // expected-error {{[loplugin:redundantinline]}} + static inline void f2() {} // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} - inline void operator +() {} // expected-error {{[loplugin:redundantinline]}} + inline void operator +() {} // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} - inline operator int() { return 0; } // expected-error {{[loplugin:redundantinline]}} + inline operator int() { return 0; } // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} - friend inline void f4() {} // expected-error {{[loplugin:redundantinline]}} + friend inline void f4() {} // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} static constexpr int f5() { return 0; } - static constexpr inline int f6() { return 0; } // expected-error {{[loplugin:redundantinline]}} + static constexpr inline int f6() { return 0; } // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} }; constexpr int f5() { return 0; } -constexpr inline int f6() { return 0; } // expected-error {{[loplugin:redundantinline]}} +constexpr inline int f6() { return 0; } // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} + +static inline int f7() { return 0; } #endif |