diff options
| author | Hans Wennborg <hans@hanshq.net> | 2017-02-01 18:52:53 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2017-02-01 18:52:53 +0000 |
| commit | 9d17df8b463428c8e3a239accb316cec9bbd8bc0 (patch) | |
| tree | 3958b18fae4b42bdf73c13ff8ba92f01b12bc725 /llvm/lib/Bitcode/Reader/BitstreamReader.cpp | |
| parent | 6849f20d8524c570ece1c24e0af4c0d6889763f4 (diff) | |
| download | llvm-9d17df8b463428c8e3a239accb316cec9bbd8bc0.zip llvm-9d17df8b463428c8e3a239accb316cec9bbd8bc0.tar.gz llvm-9d17df8b463428c8e3a239accb316cec9bbd8bc0.tar.bz2 | |
Drop 'dllimport' when redeclaring inline function template without the attribute (PR31695)
For non-template dllimport functions, MSVC allows providing an inline
definition without spelling out the attribute again. In the example below, f
remains a dllimport function.
__declspec(dllimport) int f();
inline int f() { return 42; }
int useit() {
return f();
}
However, for a function template, not putting dllimport on the redeclaration
causes it to be dropped. In the example below, f is not dllimport.
template <typename> __declspec(dllimport) int f();
template <typename> inline int f() { return 42; }
int useit() {
return f<int>();
}
This patch makes Clang match MSVC for the second example.
MSVC does not warn about the attribute being dropped in the example above, but
I think we should. (MSVC does warn if the inline keyword isn't used.)
Differential Revision: https://reviews.llvm.org/D29152
llvm-svn: 293800
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitstreamReader.cpp')
0 files changed, 0 insertions, 0 deletions
