You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2021/03/29 06:58:00 UTC
[jira] [Commented] (THRIFT-5342) Apply 'noexcept' attribute to
Init/Copy/Move Constructors and Assignments
[ https://issues.apache.org/jira/browse/THRIFT-5342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17310455#comment-17310455 ]
Jens Geyer commented on THRIFT-5342:
------------------------------------
> label pull-request-available
Would be more helpful to know the number.
> Apply 'noexcept' attribute to Init/Copy/Move Constructors and Assignments
> -------------------------------------------------------------------------
>
> Key: THRIFT-5342
> URL: https://issues.apache.org/jira/browse/THRIFT-5342
> Project: Thrift
> Issue Type: Sub-task
> Components: C++ - Compiler
> Reporter: Kashirin Alex
> Assignee: Kashirin Alex
> Priority: Major
> Labels: pull-request-available
>
> The 'noexcept' attribute should be applied to the ctor & operator= for Copy & Move in cases when all fields of t_struct's storage do not throw and the Initializer ctor when no default values used.
>
> The cases of possible use of 'noexcept' can be seen with using the compiler-flag `-Wnoexcept`, these are some of the gcc warnings:
>
> {code:java}
> swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service_types.h:2436:3: warning: but ‘SWC::Thrift::FCellSerial::FCellSerial()’ does not throw; perhaps it should be declared ‘noexcept’$
> 2436 | FCellSerial() : c(), ts(0) {
> swc-db/src/cc/include/swcdb/thrift/gen-cpp/Service_types.cpp:2508:1: warning: but ‘SWC::Thrift::SpecValueSerial_INT64::SpecValueSerial_INT64(const SWC::Thrift::SpecValueSerial_INT64&)’ does not throw; perhaps it should be declared ‘noexcept’ [-Wnoexcept] 2508 | SpecValueSerial_INT64::SpecValueSerial_INT64(const SpecValueSerial_INT64& other102) { | ^~~~~~~~~~~~~~~~~~~~~
> swc-db/src/cc/include/swcdb/thrift/gen-cpp/Broker.h:89:3: warning: but ‘SWC::Thrift::BrokerProcessorFactory::BrokerProcessorFactory(const std::shared_ptr<SWC::Thrift::BrokerIfFactory>&)’ does not throw; perhaps it should be declared ‘noexcept’ [-Wnoexcept] 89 | BrokerProcessorFactory(const ::std::shared_ptr< BrokerIfFactory >& handlerFactory) : | ^~~~~~~~~~~~~~~~~~~~~~
> {code}
>
> * _The option "moveable_types" of the CPP-generator can be a suggestion for a default_
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)