aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/match-slicepattern-array.rs
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2025-08-09 09:15:04 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2025-08-09 09:15:04 -0400
commit7c02f011502ea65bb03891239a7317a95c6a00dd (patch)
treea797f40ceaaa02aa065b2473fda2cd9e440c23c3 /gcc/testsuite/rust/compile/match-slicepattern-array.rs
parent8ad36426c78903953bbd2c248a3096d307013e4a (diff)
downloadgcc-7c02f011502ea65bb03891239a7317a95c6a00dd.zip
gcc-7c02f011502ea65bb03891239a7317a95c6a00dd.tar.gz
gcc-7c02f011502ea65bb03891239a7317a95c6a00dd.tar.bz2
diagnostics: fix build on hosts where unsigned == size_t
Looks like I broke the build with r16-3091-gac4e7455a33237 on hosts where unsigned == size_t. ../../gcc/gcc/diagnostics/dumping.cc:98:1: error: redefinition of ‘void diagnostics::dumping::emit_field(FILE*, int, const char*, T) [with T = unsigned int; FILE = FILE]’ 98 | emit_field<unsigned> (FILE *outfile, int indent, | ^~~~~~~~~~~~~~~~~~~~ ../../gcc/gcc/diagnostics/dumping.cc:80:1: note: ‘void diagnostics::dumping::emit_field(FILE*, int, const char*, T) [with T = unsigned int; FILE = FILE]’ previously declared here 80 | emit_field<size_t> (FILE *outfile, int indent, | ^~~~~~~~~~~~~~~~~~ Sorry about this. Should be fixed by the following patch, which avoids templates here in favor of being explicit about types, avoids the use of "%zi" with fprintf in various places, and fixes some other minor issues in the dumping logic that I noticed whilst testing the patch. gcc/ChangeLog: * diagnostics/context.cc (context::dump): Bulletproof against m_reference_printer being null. * diagnostics/dumping.cc (emit_field<const char *>): Replace with... (emit_string_field): ...this. (emit_field<char *>): Eliminate. (emit_field<bool>): Replace with... (emit_bool_field): ...this. (emit_field<size_t>): Replace with... (emit_size_t_field): ...this, and use HOST_SIZE_T_PRINT_DEC rather than %zi in fprintf call. (emit_field<int>): Replace with... (emit_int_field): ...this. (emit_field<unsigned>): Replace with... (emit_unsigned_field): ...this. * diagnostics/dumping.h (emit_field): Replace this template decl with... (emit_string_field): ...this, (emit_bool_field): ...this, (emit_size_t_field): ...this, (emit_int_field): ...this, (emit_unsigned_field): ... and this. (DIAGNOSTICS_DUMPING_EMIT_FIELD): Rename to... (DIAGNOSTICS_DUMPING_EMIT_BOOL_FIELD): ...this and update for above change. * diagnostics/file-cache.cc (file_cache_slot::dump): Replace emit_field calls with calls that explicitly state the type. Fix type of dump of m_missing_trailing_newline to use bool. (file_cache_slot::dump): Use HOST_SIZE_T_PRINT_DEC rather than %zi in fprintf call. * diagnostics/html-sink.cc (html_generation_options::dump): Update for macro renaming. * diagnostics/sarif-sink.cc (sarif_serialization_format_json::dump): Likewise. (sarif_generation_options::dump): Likewise, and for function renaming. * diagnostics/text-sink.cc (text_sink::dump): Update for macro renaming. * libgdiagnostics.cc (diagnostic_manager_debug_dump_file): Use HOST_SIZE_T_PRINT_DEC rather than %zi in fprintf call. * pretty-print.cc: Include "diagnostics/dumping.h". (pp_formatted_chunks::dump): Use it. (get_url_format_as_string): New. (pretty_printer::dump): Use diagnostics::dumping. Bulletproof against m_buffer being null. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/testsuite/rust/compile/match-slicepattern-array.rs')
0 files changed, 0 insertions, 0 deletions