From b4ffb2d9498560557821714e2d4651279dd6817c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 14:03:31 +0000 Subject: feat(diagnostics): print source diagnostics in gcc file:line: layout Lexer, parser, driver and codegen diagnostics now read ":: error: " instead of "error: at line N in ". The path is always printed as given on the command line. Call sites pass the bare message to cps::sourceError/sourceWarning, which carry printf format checking; reportError routes through the same helper. The suite iii harness parses the new layout and matches the reason against the message only. iii/template-class-pack-field passed only because its reason regex matched the case path, so it is now case-insensitive. Co-Authored-By: Claude Opus 5.5 --- lib/CodeGen/ConstantGen.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/ConstantGen.cc') diff --git a/lib/CodeGen/ConstantGen.cc b/lib/CodeGen/ConstantGen.cc index 1ac2a28..ca96834 100644 --- a/lib/CodeGen/ConstantGen.cc +++ b/lib/CodeGen/ConstantGen.cc @@ -22,8 +22,8 @@ void CodeGen::warnMemberShadow(const std::string &Name, int Line) const { const TypeInfo *Class = resolveType(CurrentClass); const RecordPayload *Record = Class ? Class->asRecord() : nullptr; if (Record && Record->findField(Name)) { - cps::sourceDiagnostic(Line, "warning: Declaration of %s shadows a field of class %s at line %d\n", - Name.c_str(), CurrentClass.c_str(), Line); + cps::sourceWarning(Line, "Declaration of %s shadows a field of class %s", + Name.c_str(), CurrentClass.c_str()); } } -- cgit v1.3.1-4-g156e