1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include "tools/solar.h"
16 void bar(sal_uIntPtr x
); // expected-note {{declaration site here [loplugin:typedefparam]}}
17 sal_uIntPtr
bar(); // expected-note {{declaration site here [loplugin:typedefparam]}}
20 void Foo::bar(sal_uLong
)
21 // expected-error-re@-1 {{function param 1 at definition site does not match function param at declaration site, 'sal_uLong' (aka 'unsigned {{.+}}') vs 'sal_uIntPtr' (aka 'unsigned {{.+}}') [loplugin:typedefparam]}}
26 // expected-error-re@-1 {{function return type at definition site does not match function param at declaration site, 'sal_uLong' (aka 'unsigned {{.+}}') vs 'sal_uIntPtr' (aka 'unsigned {{.+}}') [loplugin:typedefparam]}}
32 // Carve out an exception for the "typedef struct S {...} T" idiom we use in the UNO code
40 void bar(struct Foo
*);
43 // no warning expected
56 // no warning expected
60 // check method overrides
65 virtual sal_uIntPtr
foo1();
66 // expected-note@-1 {{super-class method here [loplugin:typedefparam]}}
67 virtual void foo2(sal_uIntPtr
);
68 // expected-note@-1 {{super-class method here [loplugin:typedefparam]}}
71 struct Struct2
: public Struct1
73 virtual sal_uLong
foo1() override
;
74 // expected-error-re@-1 {{method return type does not match overridden method 'sal_uLong' (aka 'unsigned {{.+}}') vs 'sal_uIntPtr' (aka 'unsigned {{.+}}') [loplugin:typedefparam]}}
75 virtual void foo2(sal_uLong
) override
;
76 // expected-error-re@-1 {{method param 1 does not match overridden method param 'sal_uLong' (aka 'unsigned {{.+}}') vs 'sal_uIntPtr' (aka 'unsigned {{.+}}') [loplugin:typedefparam]}}
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */