<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 8/28/2018 12:51 PM, Geoff Levner via
      cfe-dev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAHMBa1sFuV=WFsTbkVtmBK7J+EZYxgULa25jkQUJNyprRcQR+g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div class="gmail_quote">
          <div dir="ltr">
            <div>Greetings, clangspeople,</div>
            <div><br>
            </div>
            <div>We are using Clang and LLVM in an application to
              compile and execute C++ code on the fly. If the code fails
              to compile, I would like to be able to pop up a dialog box
              telling the user why. But warnings and error messages go
              straight to standard error.</div>
            <div><br>
            </div>
            <div>I have tried passing a raw_string_ostream to
              TextDiagnosticPrinter instead of errs(), but that seems to
              have no effect. What is that stream actually used for? Am
              I doing something wrong? I have attached the code we use
              to compile (simplified a bit).</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    The DiagnosticsEngine you pass to the Driver is only used for
    diagnostics from the driver itself, not the resulting compilation.<br>
    <br>
    createDiagnostics() takes a DiagnosticsEngine as a parameter.  (If
    you don't explicitly pass one, it will create one for you, which
    prints diagnostics to stderr.)<br>
    <br>
    -Eli<br>
    <pre class="moz-signature" cols="72">-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
  </body>
</html>