<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Usage of "-fsyntax-only" in lib Tooling not compatible with cl driver mode"
   href="https://llvm.org/bugs/show_bug.cgi?id=23197">23197</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Usage of "-fsyntax-only" in lib Tooling not compatible with cl driver mode
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bugs.brainlab.eiband@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The string literal "-fsyntax-only" is used in several places of the clang code.
However this option is not a valid option in cl mode. Code which uses this
literal must be sure that the cl mode is not set. In cl mode the corresponding
option is "/Zs".

I am using clang tooling on windows in cl mode. The method
getClangSyntaxOnlyAdjuster() adds the option "-fsyntax-only" to clang tools
without checking for cl mode.

Result: A warning is shown that the option "-fsyntax-only" is not supported.

Expected result: No warning issued for options which were not specified on the
command line.

Two alternative changes fixed this issue for me:

A) Use "/Zs" instead of "-fsyntax-only" in function
getClangSyntaxOnlyAdjuster() when in cl mode.

B) Make -fsyntax-only a CoreOption in Options.td. Reading the sources, only
options with flags CLOption or CoreOption are valid in cl mode.

I am quite new to the LLVM/Clang code so I cannot say how an appropriate fix
would look like.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>