Skip to content

dmd.error: expose ErrorSink to C++ compiler interface - #23773

Merged
thewilsonator merged 1 commit into
dlang:masterfrom
ibuclaw:error_sink_cpp
Sep 3, 2026
Merged

dmd.error: expose ErrorSink to C++ compiler interface#23773
thewilsonator merged 1 commit into
dlang:masterfrom
ibuclaw:error_sink_cpp

Conversation

@ibuclaw

@ibuclaw ibuclaw commented Sep 3, 2026

Copy link
Copy Markdown
Member

So that gdc/ldc can override the ErrorSinkCompiler class to send errors to their backend diagnostics engine.

e.g:

class ErrorSinkGccCompiler : public ErrorSinkCompiler
{
public:
  static ErrorSinkGccCompiler *create();
  void verror(Loc, const char *, va_list) override final;
  void verrorSupplemental(Loc, const char *, va_list) override final;
  void vwarning(Loc, const char *, va_list) override final;
  void vwarningSupplemental(Loc, const char *, va_list) override final;
  void vdeprecation(Loc, const char *, va_list) override final;
  void vmessage(Loc, const char *, va_list) override final;
  void vdeprecationSupplemental(Loc, const char *, va_list) override final;
};

///

global.errorSink = ErrorSinkGccCompiler::create();

@ibuclaw ibuclaw added the Compiler:C++ Interface C++ interface used by LDC/GDC label Sep 3, 2026
uint32_t errorLimit;
Diagnostic useWarnings;
Diagnostic useDeprecated;
d_bool showGaggedErrors;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkorpel the cpp layout checker can't handle overload sets, but it's not a big deal if they're missing here. :-(

}
}
else if (!cast(ErrorSinkNull)eSink)
else

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shakes-head:

@thewilsonator
thewilsonator merged commit ff1bdd4 into dlang:master Sep 3, 2026
39 of 42 checks passed
@ibuclaw
ibuclaw deleted the error_sink_cpp branch September 3, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compiler:C++ Interface C++ interface used by LDC/GDC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants