-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix hash_template_argument_from_pretty_func for GCC 9 #13449
Fix hash_template_argument_from_pretty_func for GCC 9 #13449
Conversation
@drake-jenkins-bot linux-focal-unprovisioned-gcc-bazel-experimental-release please |
+@jwnimmer-tri for feature review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+@sherm1 for platform review per schedule, please.
Reviewed 2 of 2 files at r1.
Reviewable status: LGTM missing from assignee sherm1(platform) (waiting on @sherm1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: 1 unresolved discussion (waiting on @jamiesnape)
common/value.h, line 344 at r1 (raw file):
} } if (*unnamed_iter == 0) {
minor: does this comparison have to be written bytewise? Consider instead:
if (strcmp(p, unnamed_spelling) == 0) {
// ... output {anonymous} ...
p += 9; // Length of "<unnamed>".
}
That would be easier to read (assuming it works).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all discussions resolved, LGTM from assignees jwnimmer-tri(platform),sherm1(platform)
common/value.h, line 344 at r1 (raw file):
Previously, sherm1 (Michael Sherman) wrote…
minor: does this comparison have to be written bytewise? Consider instead:
if (strcmp(p, unnamed_spelling) == 0) { // ... output {anonymous} ... p += 9; // Length of "<unnamed>". }
That would be easier to read (assuming it works).
strcmp is not constexpr
https://en.cppreference.com/w/c/string/byte/strcmp
Relates #13102.
__PRETTY_FUNCTION__
changed between GCC 7 and 9 as follows:drake::test::{anonymous}::NiceAnonEnumTemplate<(drake::test::<unnamed>::AnonEnum)0>
So it similar to Clang modulo
{anonymous}
and<unnamed>
both mapping to(anonymous namespace)
:This therefore means that the
drake::test::<unnamed>::AnonEnum
is no longer discarded since it is not parenthesized and the difference between<unnamed>
and{anonymous}
matters, not least because the (unexpected)<>
causeshash_template_argument_from_pretty_func
to fail.This change is