Skip to content

Print namespace-scope typedefs of builtins by their typedef name#28

Open
Wentzell wants to merge 1 commit into
unstablefrom
fix_typedef_print_for_builtins
Open

Print namespace-scope typedefs of builtins by their typedef name#28
Wentzell wants to merge 1 commit into
unstablefrom
fix_typedef_print_for_builtins

Conversation

@Wentzell

@Wentzell Wentzell commented Jun 11, 2026

Copy link
Copy Markdown
Member

Avoid replacing typedef aliases to built-in types, such as size_t or std::uint64_t.

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>
@Wentzell Wentzell force-pushed the fix_typedef_print_for_builtins branch from 5e4dfe2 to b8befbb Compare June 11, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant