/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once struct S1 { inline S1(); inline ~S1(); }; S1::S1() = default; struct S2 { inline S2() = default; // expected-error {{[loplugin:redundantinline]}} inline ~S2() = default; // expected-error {{[loplugin:redundantinline]}} }; struct S3 { inline S3(); inline ~S3(); inline void f1(); static inline void f2(); inline void operator +(); inline operator int(); friend inline void f3(); }; S3::S3() {} S3::~S3() { f1(); } void S3::f1() { (void)this; } void S3::f2() {} void S3::operator +() {} void f3() {} S3::operator int() { return 0; } struct S4 { 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 {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} static inline void f2() {} // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} inline void operator +() {} // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} inline operator int() { return 0; } // expected-error {{function definition redundantly declared 'inline' [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 {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} }; constexpr int f5() { return 0; } constexpr inline int f6() { return 0; } // expected-error {{function definition redundantly declared 'inline' [loplugin:redundantinline]}} static inline int f7() { return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ stro/collabora/cd-5.3-3.4'>distro/collabora/cd-5.3-3.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/codemaker/source/cppumaker/cpputype.hxx
AgeCommit message (Collapse)Author
2013-04-09[API CHANGE] WIP: Experimental new binary type.rdb formatStephan Bergmann
Make cppumaker work on top of unoidl/ instead of registry/, as a first step to change all the various codemakers. * API CHANGE: cppumaker no longer supports the -B switch, as that is meaningless with the new format. When reading from an old-format .rdb file, /UCR is hard-coded as the prefix now. * TODO: The new format does not yet support deprecation annotations, so the generated .hdl/.hpp files lack any SAL_DEPRECATED_INTERNALs for now. * codemaker/typemanager.hxx is extended with access to unoidl/ functionality, so the various codemakers can use registry/ and unoidl/ in parallel for now. The access to registry/ functionality will be removed. (Added small throwaway helper functions u2b/b2u to easily map between OString and OUString at the remaining seams for now.) * Includes a selective revert of ba044b1e9613ed30906a9a540b7da8392923e4e3 "remove needless forward rtl::OUString declarations" in those parts of codemaker, unodevtools, unoidl that were covered by this local work-in-progress patch; I would otherwise have hard a hard time re-applying it. * The generated .hdl/.hpp files are mostly unchanged, except for a few minor things: ** Any SAL_DEPRECATED_INTERNALs are missing (see above). ** In comprehensive getCppuType definitions, some members were erroneously classified as TypeCalss_UNKNOWN. ** In comprehensive getCppuType definitions, some unnecessary calls like ::cppu::UnoType< ::sal_Int32 >::get(); can be removed. ** For typedef sequence<X>, the .hdl file need not include X.hdl, but only needs to forward-declare it. ** Unnecessary includes for optional bases of interfaces can be removed. ** Some numbering of local variable names (sMethodName1, ...) has changed. Change-Id: Icad98f248ac15177337f1b4ab709a755a8af6238
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk have kept them, in order not to break external API (the automatic using declaration is LO-internal). Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-03-27Clean up codemaker/typemanager.hxxStephan Bergmann
Change-Id: I650efd6780070410eaf34993dd41ed1b8ada7c9a
2012-12-02cppumaker: do write exception specifications on --enable-dbgutilMichael Stahl
Exception specifications are useless for production code, but make for useful assertions in dbgutil builds (on platforms where they are enforced at runtime). Because we do not have API tests that exhaustively trigger all documented error conditions, much less the undocumented or wrongly handled error conditions that would cause the implementation to violate its API specification, there is likely some benefit in having these runtime-checked specifications in debug builds, in the hope that our various tests which may incidentally call various API methods, or general soffice usage, uncovers these bugs. Also, there may be some benefit to making API implementers more aware of the exception specifications, to quote Stephan's mail: To be able to programmatically react to an exception raised by a UNO method (which is the raison d'être of non-runtime UNO exceptions), the specification of that method must document the method's behavior with respect to raising that exception, and any implementation of the method must adhere to that specification. However, with that part of a UNO method's interface moved out of sight of a programmer writing a C++ implementation of that method, I fear that adherence to specification will degrade in practice. And that negatively affects an area where we do not shine anyway: reaction to errors. This partially reverts commits: 0295bd6b3f21dd648af6145ca23d90467f3cec73 155cd09b5eebe0c1eab0610a7f1f04f09de4b217 Change-Id: I9c7664c9f1b238f4f9501aacb065981236949440
2012-11-29Remove some commented-out or otherwise unused code.Thorsten Behrens
2012-11-29Remove exception spec from idl-generated c++ headers.Thorsten Behrens
The general agreement in the project is that c++ exception specs are pointless and add bloat in production code. See also this rant for more background: http://drdobbs.com/cpp/184401544 This removes the code that generates the exception specs on the generated c++ headers, and fixes up the few places that broke subsequently because of widening exception specs, which in turn was due to the rather unfortunate decision to not have a virtual dtor in XInterface. Change-Id: I60db26e1cc4d4fe6eeef5975e39497841e92588a
2012-11-23Adding SAL_DEPRECATED_INTERNAL to an implementation function is pointlessStephan Bergmann
...as there are typically no direct calls to it anyway. What is apparently needed is to decorate the cppumaker-generated headers instead: * cppumaker obtains deprecation-information from the documentation strings in .rdb files. As these are normally generated by idlc without documentation included (no -C), idlc got changed to nevertheless contain documentation consisting of just "@deprecated" in this case, to allow to easily tunnel this information to cppumaker always. * The mechanism of parsing for "@deprecated" in documentation strings is somewhat crude, of course. * For now, cppumaker only decorates C++ functions that correspond to UNOIDL interface attributes and methods. More should be possible (but, e.g., being able to decorate a complete C++ class corresponding to a deprecated UNOIDL interface type depends on whether all platforms would accept SAL_DEPRECATED_INTERNAL at the same position in a C++ class declaration. * This could also be extended to other languages than C++/cppumaker. * Always using SAL_DEPRECATED_INERNAL instead of SAL_DEPRECATED for decoration is to keep things simple and our codebase working. Improvements are possible here, too, of course. Change-Id: Ia2917892f780d477652e4cd9f286588a6898c3f5
2012-10-04sal_Bool->bool in codemakerNoel Grandin
Change-Id: Icea58e7c1dea14f524d6a8d479b7d85e79d6266b
2012-06-12re-base on ALv2 code.Michael Meeks
2011-11-02Make .hpp/.hdl more robust against accidental include of .hdl instead of .hpp.Stephan Bergmann
.hdl failed to declare the inline cppu_detail_getUnoType functions defined in .hpp, which if client code only includes .hdl instead of .hpp could lead to runtime failures, now leads to compiler warnings.
2010-10-14Add vim/emacs modelines to all source filesSebastian Spaeth
Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail 1286706307.1871.1399280959@webmail.messagingengine.com) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-02-12changefileheader2: #i109125#: change source file copyright notice from Sun ↵Jens-Heiner Rechtien
Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision)
2008-07-11INTEGRATION: CWS jsc21 (1.13.16); FILE MERGEDRüdiger Timm
2008/04/23 09:48:42 jsc 1.13.16.2: RESYNC: (1.13-1.14); FILE MERGED 2008/02/13 08:54:57 jsc 1.13.16.1: #i72964# remove external header guards
2008-04-11INTEGRATION: CWS changefileheader (1.13.20); FILE MERGEDRüdiger Timm
2008/04/01 15:04:47 thb 1.13.20.3: #i85898# Stripping all external header guards 2008/04/01 12:26:07 thb 1.13.20.2: #i85898# Stripping all external header guards 2008/03/31 07:22:53 rt 1.13.20.1: #i87441# Change license header to LPGL v3.