<html>
    <head>
      <base href="http://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 --- - Incorrect error message when attempting to overload within extern "C" block"
   href="http://llvm.org/bugs/show_bug.cgi?id=18741">18741</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect error message when attempting to overload within extern "C" block
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>continuation@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>Compiling the following program with clang 3.3 (and 3.5 somebody told me):

extern "C" {
  void Foo(void *arg1) {
  }
  bool Foo(void *arg1, void *arg2) {
    return true;
  }
}

...produces the error message "error: functions that differ only in their
return type cannot be overloaded".  This is confusing, because of course they
do not differ only in their return type.  I think the actual reason the
overloading is not allowed is that it is within an extern "C" block. (I
originally hit this in a large header file where I didn't realize the function
was in an extern "C" block.)

If the second Foo is changed to have a return type void, then you get the error
message "error: conflicting types for 'Foo'", which still doesn't mention that
types only conflict because of the extern "C" block, but at least it isn't
wrong.</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>