Suppress GCC 16's sfinae-incomplete warning#119445
Open
DeeJayLSP wants to merge 1 commit into
Open
Conversation
akien-mga
reviewed
May 14, 2026
| if cc_version_major >= 11: | ||
| common_warnings += ["-Wenum-conversion"] | ||
| if cc_version_major >= 16: | ||
| # Regression in GCC 16, false positives in type-incompleteness assertions, see GH-119269. |
Member
There was a problem hiding this comment.
It's not a regression, it's a new warning which flags a true positive. We just don't consider this to be a something that should be fixed, as we do it on purpose.
Contributor
Author
There was a problem hiding this comment.
Modified the wording to remove "regression" and "false positive".
c72aca2 to
1ade2b8
Compare
Contributor
Author
Note that the warning is emitted on the class definitions that were checked by the macro, not on the macro itself. For example: STATIC_ASSERT_INCOMPLETE_TYPE(class, RenderingServer);
//...
#include "servers/rendering/rendering_server.h" // Warning will be emitted in class RenderingServer : public Object { |
Repiteo
approved these changes
May 14, 2026
Contributor
This happens because |
akien-mga
approved these changes
May 14, 2026
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.
Addresses part of #119269
sfinae-incompletewas introduced in GCC 16, which is meant to catch definitions of types that failed to be complete in an SFINAE context.At the moment, this happens with the
STATIC_ASSERT_INCOMPLETE_TYPE()macro followed by completing that type, which is a context we do want the type to be incomplete, meaning the warning is a false positive.Note: it has to be done with
env.AppendUniqueinstead of adding tocommon_warningsascc1will spam warnings otherwise.