http://llvm.org/bugs/show_bug.cgi?id=18741

            Bug ID: 18741
           Summary: Incorrect error message when attempting to overload
                    within extern "C" block
           Product: clang
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to