http://llvm.org/bugs/show_bug.cgi?id=20512
Bug ID: 20512
Summary: clang drops dllimport attribute from qualified friend
declaration of imported function
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Consider this example:
__declspec(dllimport) void f();
struct S {
friend void ::f();
S() { f(); };
};
S s;
Clang warns about the redeclaration of 'f' and drops the dllimport attribute
(MinGW does the same). MSVC on the other hand accepts this code, and treats 'f'
as an imported function.
It is interesting to note that the qualifier in the friend declaration is
significant. In the same example without qualifier:
__declspec(dllimport) void f();
struct S {
friend void f();
S() { f(); };
};
S s;
MSVC warns about the inconsistent dll linkage, and does not treat 'f' as
imported.
The latter example suggests that it is sensible to warn here, and MSVC not
warning in the qualified case might be a glitch. If that's the case, I'm not
sure we want to replicate that behaviour.
--
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