[LLVMbugs] [Bug 14619] Including stdlib.h in an extern "C" block causes a "declaration conflicts with target of using declaration already in scope"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 17 15:37:36 PST 2012


Bas Vodde <basv at odd-e.com> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #2 from Bas Vodde <basv at odd-e.com> 2012-12-17 17:37:36 CST ---

I'm sorry, but I think that's a bit too easy. I don't have the C++ standard
with me at the moment, but as far as I know, the extern "C" should impact the
linking behavior but *not* the compilation behavior.

When I do not use the extern "C" around the #include, there will be no compile
error whatsoever, but when I add the extern "C" to *change the behavior of the
linker* then the compiler fails.

To me, this definitively seems to go against the C++ standard (or at least its
intent) and also it does go against what other compilers accept.

If you still feel it is undefined behavior, please tell me where that is so in
the C++ standard.

If it still is decided not to fix, it might be good to change the compiler
error to explain this is because of the extern "C" declaration.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list