r237787 - [MSVC] Handle out-of-line definition of static data member correctly (fix for http://llvm.org/PR21164), by Alexey Frolov
hans at chromium.org
Wed May 20 09:26:13 PDT 2015
On Wed, May 20, 2015 at 4:57 AM, Alexey Bataev <a.bataev at hotmail.com> wrote:
> Author: abataev
> Date: Wed May 20 06:57:02 2015
> New Revision: 237787
> URL: http://llvm.org/viewvc/llvm-project?rev=237787&view=rev
> [MSVC] Handle out-of-line definition of static data member correctly (fix for http://llvm.org/PR21164), by Alexey Frolov
> There are 3 cases of defining static const member:
> initialized inside the class, not defined outside the class.
> initialized inside the class, defined outside the class.
> not initialized inside the class, defined outside the class.
Chromium always has another case :-) See .
It seems  is both initialized inside the class and defined outside
the class, but with __declspec(selectany) to appease MSVC as suggested
by . When compiled with clang-cl, we now get a multiple definition
error during linking. We can fix the code in Chromium of course, but
maybe others will run into the same problem?
More information about the cfe-commits