Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
cfd26881
Commit
cfd26881
authored
Apr 28, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ParserRef null constexpr vtable crash in MSVC.
parent
2e7ece6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
common.h
c++/src/kj/parse/common.h
+11
-0
No files found.
c++/src/kj/parse/common.h
View file @
cfd26881
...
...
@@ -162,7 +162,13 @@ private:
};
template
<
typename
ParserImpl
>
struct
WrapperImplInstance
{
#if _MSC_VER
// TODO(msvc): MSVC currently fails to initialize vtable pointers for constexpr values so
// we have to make this just const instead.
static
const
WrapperImpl
<
ParserImpl
>
instance
;
#else
static
constexpr
WrapperImpl
<
ParserImpl
>
instance
=
WrapperImpl
<
ParserImpl
>
();
#endif
};
const
void
*
parser
;
...
...
@@ -171,8 +177,13 @@ private:
template
<
typename
Input
,
typename
Output
>
template
<
typename
ParserImpl
>
#if _MSC_VER
const
typename
ParserRef
<
Input
,
Output
>::
template
WrapperImpl
<
ParserImpl
>
ParserRef
<
Input
,
Output
>::
WrapperImplInstance
<
ParserImpl
>::
instance
=
WrapperImpl
<
ParserImpl
>
();
#else
constexpr
typename
ParserRef
<
Input
,
Output
>::
template
WrapperImpl
<
ParserImpl
>
ParserRef
<
Input
,
Output
>::
WrapperImplInstance
<
ParserImpl
>::
instance
;
#endif
template
<
typename
Input
,
typename
ParserImpl
>
constexpr
ParserRef
<
Input
,
OutputType
<
ParserImpl
,
Input
>>
ref
(
ParserImpl
&
impl
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment