-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[CPP23][FW] Fix for non-const lvalue reference of type E #49626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
cms-bot internal usage |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-49626/47164 |
|
A new Pull Request was created by @smuzaffar for master. It involves the following packages:
@Dr15Jones, @cmsbuild, @makortel, @smuzaffar can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
|
please test for CMSSW_16_0_CPP23_X |
|
please test |
|
-1 Failed Tests: Build HeaderConsistency Failed BuildI found compilation error when building: /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/gcc/14.3.1-724da22786638848892aa9ded8fcd995/bin/c++ -c -DCMS_MICRO_ARCH='x86-64-v3' -DGNU_GCC -D_GNU_SOURCE -DTBB_USE_GLIBCXX_VERSION=140301 -DTBB_SUPPRESS_DEPRECATED_MESSAGES -DTBB_PREVIEW_RESUMABLE_TASKS=1 -DTBB_PREVIEW_TASK_GROUP_EXTENSIONS=1 -DBOOST_SPIRIT_THREADSAFE -DPHOENIX_THREADSAFE -DBOOST_MATH_DISABLE_STD_FPCLASSIFY -DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX -DBOOST_MPL_IGNORE_PARENTHESES_WARNING -DCMSSW_GIT_HASH='CMSSW_16_0_CPP23_X_2025-12-12-1100' -DPROJECT_NAME='CMSSW' -DPROJECT_VERSION='CMSSW_16_0_CPP23_X_2025-12-12-1100' -Isrc -Ipoison -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/cms/cmssw/CMSSW_16_0_CPP23_X_2025-12-12-1100/src -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/onnxruntime/1.20.1-e8c22c550be936056ecc6fb7037d5db8/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/pcre/8.43-dd87967f31bc038bf6a8abe2be06d878/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/boost/1.80.0-8a64405f8ffec5e0aed411e7e9db26fe/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/bz2lib/1.0.6-a45a4a64bd925bd0ba8954d249304f19/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/cppunit/1.15.x-cab1f5c16961d3146ed5b5b58dbaf0f2/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/libuuid/2.34-767b094004db7bc5bb18e2c4125785ec/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/protobuf/3.21.9-a596ab8f795bc24a6d33407d76b5f949/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/lcg/root/6.36.07-93a76a9d7334f41e96e83c8ce0904e5e/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/tbb/v2022.3.0-59c3435ec417bb8fae66d50fede7459e/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/xz/5.6.4-d44dfda29fc121dff35f6cb17845463b/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/zlib/1.2.13-8abc0804c1703682302a8801f051fa9d/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/md5/1.0.0-4c04fac6c42256d53fbdabb58aa703f3/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/re2/2021-06-01-ce65e95e12e2879f99e3522b2e14de6b/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/tinyxml2/6.2.0-776d06aaa678176c86223e685b2807b3/include -O3 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++23 -ftree-vectorize -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -Wno-error=array-bounds -Warray-bounds -fuse-ld=bfd -march=x86-64-v3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-unused-parameter -Wunused -Wparentheses -Werror=return-type -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto=auto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -fPIC -MMD -MF tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testRunner.cpp.d src/PhysicsTools/ONNXRuntime/test/testRunner.cpp -o tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testRunner.cpp.o >> Building binary testONNXRuntime /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/gcc/14.3.1-724da22786638848892aa9ded8fcd995/bin/c++ -O3 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++23 -ftree-vectorize -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -Wno-error=array-bounds -Warray-bounds -fuse-ld=bfd -march=x86-64-v3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-unused-parameter -Wunused -Wparentheses -Werror=return-type -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto=auto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -fPIC tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testONNXRuntime.cc.o tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testRunner.cpp.o -Wl,-E -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,noexecstack -L/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_16_0_CPP23_X_2025-12-12-1100/biglib/el8_amd64_gcc14 -L/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_16_0_CPP23_X_2025-12-12-1100/lib/el8_amd64_gcc14 -L/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/cms/cmssw/CMSSW_16_0_CPP23_X_2025-12-12-1100/biglib/el8_amd64_gcc14 -L/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/cms/cmssw/CMSSW_16_0_CPP23_X_2025-12-12-1100/lib/el8_amd64_gcc14 -L/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/cms/cmssw/CMSSW_16_0_CPP23_X_2025-12-12-1100/external/el8_amd64_gcc14/lib -L/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_16_0_CPP23_X_2025-12-12-1100/static/el8_amd64_gcc14 -L/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/cms/cmssw/CMSSW_16_0_CPP23_X_2025-12-12-1100/static/el8_amd64_gcc14 -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lFWCorePluginManager -lFWCoreReflection -lPhysicsToolsONNXRuntime -lFWCoreUtilities -lTree -lNet -lThread -lMathCore -lRIO -lCore -lboost_thread -lboost_date_time -lonnxruntime -lpcre -lbz2 -lcppunit -luuid -lprotobuf -ltbb -llzma -lz -lcms-md5 -lre2 -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2 -o tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testONNXRuntime /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc14/external/gcc/14.3.1-724da22786638848892aa9ded8fcd995/bin/../lib/gcc/x86_64-redhat-linux-gnu/14.3.1/../../../../x86_64-redhat-linux-gnu/bin/ld.bfd: tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/ccrvAjWF.ltrans0.ltrans.o: in function `testONNXRuntime::checkGPU()': :(.text+0x1b4d): undefined reference to `cms::cudatest::testDevices()' collect2: error: ld returned 1 exit status >> Deleted: tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testONNXRuntime gmake: *** [tmp/el8_amd64_gcc14/src/PhysicsTools/ONNXRuntime/test/testONNXRuntime/testONNXRuntime] Error 1 >> Leaving Package PhysicsTools/ONNXRuntime >> Package PhysicsTools/ONNXRuntime built >> Entering Package SimDataFormats/Forward |
|
-1 Failed Tests: Build Failed BuildI found compilation error when building: from src/DataFormats/Common/interface/ConvertHandle.h:6,
from src/FWCore/Framework/interface/Event.h:21,
from src/FWCore/TestModules/plugins/GlobalVectorAnalyzer.cc:3:
src/FWCore/Utilities/interface/Exception.h: In instantiation of 'E&& cms::operator<<(E&&, const T&) [with E = Exception; T = std::vector]':
src/FWCore/TestModules/plugins/GlobalVectorAnalyzer.cc:56:69: required from here
src/FWCore/Utilities/interface/Exception.h:166:12: error: no match for 'operator<<' (operand types are 'std::ostringstream' {aka 'std::__cxx11::basic_ostringstream'} and 'const std::vector')
166 | e.ost_ << stuff;
| ~~~~~~~^~~~~~~~
In file included from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc13/external/gcc/13.4.0-6908cfdf803923e783448096ca4f0923/include/c++/13.4.0/bits/unique_ptr.h:42,
from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc13/external/gcc/13.4.0-6908cfdf803923e783448096ca4f0923/include/c++/13.4.0/memory:78,
from /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02919/el8_amd64_gcc13/lcg/root/6.36.07-0490e78b33943d48f9af1c19441a9d2e/include/ROOT/TypeTraits.hxx:15,
|
|
By quick thought returning an argument captured via universal reference as lvalue reference (i.e. present code) smells, but I'm not sure if the return type is now the universal reference or an rvalue reference. I'm tempted to argue the way the universal references were introduced here in #23801 was subtly flawed, but I need more time to digest. |
|
It looks like changing the first line cmssw/FWCore/TestModules/plugins/GlobalVectorAnalyzer.cc Lines 12 to 32 in 712e925
to |
|
Apparently there was a wording change in this specific situation in C++23, see "Simpler implicit move" in https://developers.redhat.com/articles/2023/06/21/new-c-features-gcc-13 GCC13 porting guide https://gcc.gnu.org/gcc-13/porting_to.html suggest to use inline decltype(auto) operator<<(E&& e, std::ostream& (*f)(std::ostream&)) {
f(e.ost_);
return std::forward<E>(e);
}(I don't know if decltype(auto) works in function declarations) The overload in At least on a simple compiler explorer test https://godbolt.org/z/3fbhT7j8x that approach seems to work in C++20 as well. |
In CPP23_X, there are many build errors like [a]. This change should fix all these error.
[a]