Fix -Wdeprecated-builtins warnings about __has_trivial_destructor#11
Open
cpeterso wants to merge 1 commit intojamienicol:masterfrom
Open
Fix -Wdeprecated-builtins warnings about __has_trivial_destructor#11cpeterso wants to merge 1 commit intojamienicol:masterfrom
cpeterso wants to merge 1 commit intojamienicol:masterfrom
Conversation
warning: glsl-optimizer/src/compiler/glsl/list.h:58:4: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins] ... warning: glsl-optimizer/src/util/macros.h:195:44: note: expanded from macro 'HAS_TRIVIAL_DESTRUCTOR' warning: 195 | # define HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) warning: | ^ clang recommends replacing __has_trivial_destructor with __is_trivially_destructible, but we can use C++11's standard std::is_trivially_destructible directly; it's been available in clang and gcc since 2013 (clang 3.3 and gcc 4.8) and at least MSVC 2019. https://en.cppreference.com/w/cpp/types/is_destructible
Author
|
This change isn't necessary for C++23 support, but it silences literally thousands of lines of warning spam when building Firefox. |
Owner
|
Again like in #10, let's strive to use the same fix upstream did: https://gitlab.freedesktop.org/mesa/mesa/-/commit/1980827aeb40725a57db6c2d79cc5323898631b9 Does that solve the warnings for us? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clang recommends replacing __has_trivial_destructor with __is_trivially_destructible, but we can use C++11's standard
std::is_trivially_destructibledirectly; it's been available in clang and gcc since 2013 (clang 3.3 and gcc 4.8) and at least MSVC 2019.https://en.cppreference.com/w/cpp/types/is_destructible