Print namespace-scope typedefs of builtins by their typedef name#28
Open
Wentzell wants to merge 1 commit into
Open
Print namespace-scope typedefs of builtins by their typedef name#28Wentzell wants to merge 1 commit into
Wentzell wants to merge 1 commit into
Conversation
gfqn_impl1 checked getAs<BuiltinType>() before getAs<TypedefType>(). Since getAs<> looks through sugar, a typedef of a builtin such as std::uint64_t matched the builtin branch first and was printed with its canonical spelling, which is platform dependent (unsigned long long on macOS vs unsigned long on Linux LP64). Inside composite types this changes the type, e.g. std::vector<unsigned long long> does not convert to std::vector<std::uint64_t> on Linux, so committed wrap files generated on macOS failed to compile there. Prefer the typedef spelling only for typedefs declared at namespace or translation-unit scope: member typedefs (e.g. of a class template) keep the canonical builtin print, as their qualified name can lose the template arguments (detail::linear::index_t). Assisted-by: Claude <noreply@anthropic.com>
5e4dfe2 to
b8befbb
Compare
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.
Avoid replacing typedef aliases to built-in types, such as
size_torstd::uint64_t.