diff options
Diffstat (limited to 'compilerplugins/clang/test/constparams.cxx')
-rw-r--r-- | compilerplugins/clang/test/constparams.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/constparams.cxx b/compilerplugins/clang/test/constparams.cxx index 60d0148c1d69..e6b22ca91529 100644 --- a/compilerplugins/clang/test/constparams.cxx +++ b/compilerplugins/clang/test/constparams.cxx @@ -48,4 +48,26 @@ void f4(std::string * p) { *p = std::string("xxx"); } + +namespace test5 +{ +struct Rectangle {}; + +struct Foo +{ + void CallConst(const Rectangle*); + void CallNonConst(Rectangle*); + // expected-error@+1 {{this parameter can be const test5::Foo::ImplInvalidateParentFrameRegion [loplugin:constparams]}} + void ImplInvalidateParentFrameRegion( Rectangle& rRegion ) + { + CallConst( &rRegion ); + } + // no warning expected + void ImplInvalidateParentFrameRegion2( Rectangle& rRegion ) + { + CallNonConst( &rRegion ); + } +}; + +} /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |