]> granicus.if.org Git - clang/commit
Merging r370850:
authorHans Wennborg <hans@hanshq.net>
Thu, 5 Sep 2019 09:48:06 +0000 (09:48 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 5 Sep 2019 09:48:06 +0000 (09:48 +0000)
commit5fc381cf3e9fae6ada0e575f31eb96f35f43d6e4
tree3b959d715f50b07dec16f625851148589a4ea509
parentff5fb5ee534a281bc0a4cc3a81a59d1733fcec31
Merging r370850:
------------------------------------------------------------------------
r370850 | hans | 2019-09-04 10:19:30 +0200 (Wed, 04 Sep 2019) | 20 lines

Re-commit r363191 "[MS] Pretend constexpr variable template specializations are inline"

While the next Visual Studio update (16.3) will fix this issue, that hasn't
shipped yet. Until then Clang wouldn't work with MSVC's headers which seems
unfortunate. Let's keep this in until VS 16.3 ships. (See also PR42843.)

> Fixes link errors with clang and the latest Visual C++ 14.21.27702
> headers, which was reported as PR42027.
>
> I chose to intentionally make these things linkonce_odr, i.e.
> discardable, so that we don't emit definitions of these things in every
> translation unit that includes STL headers.
>
> Note that this is *not* what MSVC does: MSVC has not yet implemented C++
> DR2387, so they emit fully specialized constexpr variable templates with
> static / internal linkage.
>
> Reviewers: rsmith
>
> Differential Revision: https://reviews.llvm.org/D63175
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_90@371040 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTContext.cpp
test/CodeGenCXX/ms-constexpr-var-template.cpp [new file with mode: 0644]