[LLVMbugs] [Bug 17540] New: Language linkage bleeding to between proper overloads when using long type

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 10 13:38:44 PDT 2013


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

            Bug ID: 17540
           Summary: Language linkage bleeding to between proper overloads
                    when using long type
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: whunt at google.com
                CC: llvmbugs at cs.uiuc.edu, richard-llvm at metafoo.co.uk
    Classification: Unclassified

Clang erroneously associates extern "C++" to a function previously declared
extern "C".

file.cpp:
extern "C" long _InterlockedIncrement(long volatile *_Addend);
extern "C++" unsigned long _InterlockedIncrement(unsigned long volatile
*Addend);
extern "C" long _InterlockedIncrement(long volatile *_Addend);



Should not issue any diagnostics but gives the following instead:

file.cpp:3:17: error: declaration of '_InterlockedIncrement' has a different
language linkage
extern "C" long _InterlockedIncrement(long volatile *_Addend);
                ^
file.cpp:1:17: note: previous declaration is here
extern "C" long _InterlockedIncrement(long volatile *_Addend);


Clearly the diagnostic is misleading at best.  It appears that the extern "C++"
line is actually stomping the linkage of the previous extern "C" line, despite
the "C++" line being a proper overload.

I believe the bug is specific to "long"/"unsigned long" and does not occur with
other tested types(int, short, __int64).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131010/61467a08/attachment.html>


More information about the llvm-bugs mailing list