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
336f6bd7
Commit
336f6bd7
authored
Apr 25, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around ABI incompatibility between GCC and Clang.
Fixes #212
parent
bcd9e553
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
common.h
c++/src/kj/common.h
+14
-0
No files found.
c++/src/kj/common.h
View file @
336f6bd7
...
...
@@ -366,11 +366,22 @@ struct DisallowConstCopy {
// type that contains or inherits from a type that disallows const copies will also automatically
// disallow const copies. Hey, cool, that's exactly what we want.
#if CAPNP_DEBUG_TYPES
// Alas! Declaring a defaulted non-const copy constructor tickles a bug which causes GCC and
// Clang to disagree on ABI, using different calling conventions to pass this type, leading to
// immediate segfaults. See:
// https://bugs.llvm.org/show_bug.cgi?id=23764
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58074
//
// Because of this, we can't use this technique. We guard it by CAPNP_DEBUG_TYPES so that it
// still applies to the Cap'n Proto developers during internal testing.
DisallowConstCopy
()
=
default
;
DisallowConstCopy
(
DisallowConstCopy
&
)
=
default
;
DisallowConstCopy
(
DisallowConstCopy
&&
)
=
default
;
DisallowConstCopy
&
operator
=
(
DisallowConstCopy
&
)
=
default
;
DisallowConstCopy
&
operator
=
(
DisallowConstCopy
&&
)
=
default
;
#endif
};
#if _MSC_VER
...
...
@@ -383,6 +394,9 @@ struct DisallowConstCopy {
// struct Foo: DisallowConstCopy {};
// Foo foo;
// auto lambda = [KJ_CPCAP(foo)] {};
//
// TODO(soon): Can we remove this since DisallowConstCopy no longer does anything except when
// CAPNP_DEBUG_TYPES is defined?
#else
...
...
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