New issue
Advanced search Search tips

Issue 879902 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 878202
Owner: ----
Closed: Sep 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

blink/renderer/core/animation/animation_time_delta.h: constexpr functions call non-constexpr function

Reported by haraldvd...@gmail.com, Sep 2

Issue description

Chrome Version       : 70.0.3534.4
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari:
    Firefox:
       Edge:

What steps will reproduce the problem?
(1) Build Chromium with GCC 8.2.0.
(2)
(3)

What is the expected result?
Successful build.

What happens instead?
Failed build.

Please provide any additional information below. Attach a screenshot if
possible.

blink/renderer/core/animation/animation_time_delta.h defines operator==, !=, >, >=, <= (but no < ?) as constexpr. They all call the non-constexpr member function AnimationTimeDelta::InSecondsF. GCC 8.2.0 rejects this even if they are never used in a context requiring a constant expression. Aside from one unrelated problem which I reported separately, the build with the attached patch succeeded. The patch is conservative in that it simply preserves the existing behaviour of leaving the operators unusable in constant expressions. It could be desirable to instead mark InSecondsF constexpr.

I checked <https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/core/animation/animation_time_delta.h> to see if this was already known and fixed. Although it is in a third_party directory, it is my understanding that this is the latest version.

From my build log:
[...]
FAILED: obj/third_party/blink/renderer/core/animation/animation_0/animation_time_delta.o 
g++-8.2.0 -MMD -MF obj/third_party/blink/renderer/core/animation/animation_0/animation_time_delta.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_
BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLE
D=0 -DBLINK_CORE_IMPLEMENTATION=1 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -DWEBP_EXTERN=extern -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DVK_NO_PROTOTYPES -DBLINK_IMPLEMENTATION=1 -DINS
IDE_BLINK -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DWEBRTC_NON
_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DNO_MAIN_THREAD_WRAPPING -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_L
IBRARY -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DWTF_USE_WEBAUDIO_FFMPEG=1 -DSUPPORT_WEB
GL2_COMPUTE_CONTEXT=1 -DWTF_USE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DV8_DEPRECATION_WARNINGS -DV8_DEPRECATION_WARNINGS -DLIBXSLT_STATIC -I../.. -Igen -I../../third_party/libyuv/include -I../../third_party/libwebp/src -I../../th
ird_party/khronos -I../../gpu -I../../third_party/vulkan/include -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -I../../third_party/protobuf/src -Ige
n/protoc_out -I../../third_party/boringssl/src/include -I../../third_party/webrtc_overrides -I../../third_party/webrtc -I../../third_party/abseil-cpp -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_p
arty/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/gpu -I../../third_party/skia/include/images -I../../third_pa
rty/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/v
ulkan/include -I../../third_party/skia/third_party/vulkanmemoryallocator -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/skia/modules/skottie/include -I../../third_party/vulkan/include -I../../third
_party/angle/include -I../../third_party/angle/src/common/third_party/base -Igen/angle -I../../third_party/libjpeg_turbo -I../../v8/include -Igen/v8/include -I../../third_party/iccjpeg -I../../third_party/libpng -I../../third_party/zlib 
-I../../third_party/ots/include -I../../v8/include -Igen/v8/include -I../../third_party/libxml/src/include -I../../third_party/libxml/linux/include -I../../third_party/libxslt/src -I../../third_party/snappy/src -I../../third_party/snappy
/linux -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -pthread -m64 -march=x86-64 -Wall -Wno-unused-local-typedefs -Wno-m
aybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -fvisibility=h
idden -g0 -I/usr/lib64/libffi-3.2.1/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/nss -I/usr/include/nspr -DLIBXML_STATIC= -std=gnu++14 -Wno-narrowing -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -
mtune=generic -O2 -c ../../third_party/blink/renderer/core/animation/animation_time_delta.cc -o obj/third_party/blink/renderer/core/animation/animation_0/animation_time_delta.o
In file included from ../../third_party/blink/renderer/core/animation/animation_time_delta.cc:5:
../../third_party/blink/renderer/core/animation/animation_time_delta.h: In function 'constexpr bool blink::operator==(const blink::AnimationTimeDelta&, const blink::AnimationTimeDelta&)':
../../third_party/blink/renderer/core/animation/animation_time_delta.h:95:24: error: call to non-'constexpr' function 'double blink::AnimationTimeDelta::InSecondsF() const'
   return lhs.InSecondsF() == rhs.InSecondsF();
          ~~~~~~~~~~~~~~^~
../../third_party/blink/renderer/core/animation/animation_time_delta.h: In function 'constexpr bool blink::operator!=(const blink::AnimationTimeDelta&, const blink::AnimationTimeDelta&)':
../../third_party/blink/renderer/core/animation/animation_time_delta.h:99:24: error: call to non-'constexpr' function 'double blink::AnimationTimeDelta::InSecondsF() const'
   return lhs.InSecondsF() != rhs.InSecondsF();
          ~~~~~~~~~~~~~~^~
../../third_party/blink/renderer/core/animation/animation_time_delta.h: In function 'constexpr bool blink::operator>(const blink::AnimationTimeDelta&, const blink::AnimationTimeDelta&)':
../../third_party/blink/renderer/core/animation/animation_time_delta.h:103:24: error: call to non-'constexpr' function 'double blink::AnimationTimeDelta::InSecondsF() const'
   return lhs.InSecondsF() > rhs.InSecondsF();
          ~~~~~~~~~~~~~~^~
../../third_party/blink/renderer/core/animation/animation_time_delta.h: In function 'constexpr bool blink::operator>=(const blink::AnimationTimeDelta&, const blink::AnimationTimeDelta&)':
../../third_party/blink/renderer/core/animation/animation_time_delta.h:107:24: error: call to non-'constexpr' function 'double blink::AnimationTimeDelta::InSecondsF() const'
   return lhs.InSecondsF() >= rhs.InSecondsF();
          ~~~~~~~~~~~~~~^~
../../third_party/blink/renderer/core/animation/animation_time_delta.h: In function 'constexpr bool blink::operator<=(const blink::AnimationTimeDelta&, const blink::AnimationTimeDelta&)':
../../third_party/blink/renderer/core/animation/animation_time_delta.h:111:24: error: call to non-'constexpr' function 'double blink::AnimationTimeDelta::InSecondsF() const'
   return lhs.InSecondsF() <= rhs.InSecondsF();
          ~~~~~~~~~~~~~~^~
[...]
 
chromium-blink-constexpr.patch
1.8 KB Download
Labels: Needs-Triage-M70
Cc: vamshi.kommuri@chromium.org
Components: Build
Labels: Triaged-ET TE-NeedsTriageHelp
Thanks for filing the issue!

As the issue seems to be related to building of chromium, which is out of scope for us to triage further hence adding appropriate component and label "TE-NeedsTriageHelp", requesting the respective team to have a look into this and help in further triaging it.
This is a duplicate of  bug 878202  (which I hadn't found before) and has since been fixed.
Mergedinto: 878202
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment