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 <sal/types.h>
16 SAL_CALL
Class1() {} // expected-error {{SAL_CALL unnecessary here [loplugin:salcall]}}
17 SAL_CALL
~Class1() {} // expected-error {{SAL_CALL unnecessary here [loplugin:salcall]}}
18 SAL_CALL
operator int() // expected-error {{SAL_CALL unnecessary here [loplugin:salcall]}}
23 void SAL_CALL
method1(); // expected-error {{SAL_CALL unnecessary here [loplugin:salcall]}}
25 // no SAL_CALL for above method2, even though "SAL_CALL" appears between definition of VOID and
26 // the declaration's name, "method2"
28 void SAL_CALL
Class1::method1()
29 { // expected-error@-1 {{SAL_CALL unnecessary here [loplugin:salcall]}}
34 void method1(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
36 void SAL_CALL
Class2::method1() {} // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
38 // comment this out because it seems to generate a warning in some internal buffer of clang that I can't annotate
40 // no warning, this appears to be legal
43 void SAL_CALL
method1(); // expected-error {{SAL_CALL unnecessary here [loplugin:salcall]}}
45 void Class3::method1() {}
48 // no warning, normal case for reference
53 void Class4::method1() {}
57 virtual void method1(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
62 virtual void SAL_CALL
method1();
65 class Class5_3
: public Class5_1
, public Class5_2
68 method1() override
; // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
74 virtual void SAL_CALL
method1();
79 virtual void SAL_CALL
method1();
82 class Class6_3
: public Class6_1
, public Class6_2
84 virtual void SAL_CALL
method1() override
;
90 virtual void method1();
95 virtual void method1();
98 class Class7_3
: public Class7_1
, public Class7_2
100 virtual void method1() override
;
106 virtual void method2();
111 virtual void SAL_CALL
method2(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
114 class Class8_3
: public Class8_1
, public Class8_2
116 virtual void method2() override
; // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
123 Class9(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
124 M1(method1
)(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
125 void method2(); // expected-note {{SAL_CALL inconsistency [loplugin:salcall]}}
128 Class##num::Class##num() {}
129 SAL_CALL
MC(9) // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
130 ; // to appease clang-format
131 void SAL_CALL
Class9::method1() // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
134 #define M2(T) T SAL_CALL
135 M2(void) Class9::method2() {} // expected-error {{SAL_CALL inconsistency [loplugin:salcall]}}
137 #if 0 // see TODO in SalCall::isSalCallFunction
142 #define M3(T, SAL_CALL) T SAL_CALL::
143 M3(void, Class10
) method1() {} // false "SAL_CALL inconsistency"
147 template<typename
> struct S
{
151 template<typename T
> S
<T
>::~S() {}
152 template<typename T
> void S
<T
>::f() {}
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */