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
d18c6ec2
Commit
d18c6ec2
authored
May 21, 2016
by
Kenton Varda
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #329 from katreniak/bka-unionInGenericStruct
Bka fix union with group in generic struct
parents
60145838
a435d363
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
capnpc-c++.c++
c++/src/capnp/compiler/capnpc-c++.c++
+8
-8
test.capnp
c++/src/capnp/test.capnp
+7
-0
No files found.
c++/src/capnp/compiler/capnpc-c++.c++
View file @
d18c6ec2
...
...
@@ -1117,39 +1117,39 @@ private:
return
FieldText
{
kj
::
strTree
(
kj
::
mv
(
unionDiscrim
.
readerIsDecl
),
" inline "
,
titleCase
,
"::Reader get"
,
titleCase
,
"() const;
\n
"
" inline
typename
"
,
titleCase
,
"::Reader get"
,
titleCase
,
"() const;
\n
"
"
\n
"
),
kj
::
strTree
(
kj
::
mv
(
unionDiscrim
.
builderIsDecl
),
" inline "
,
titleCase
,
"::Builder get"
,
titleCase
,
"();
\n
"
" inline "
,
titleCase
,
"::Builder init"
,
titleCase
,
"();
\n
"
" inline
typename
"
,
titleCase
,
"::Builder get"
,
titleCase
,
"();
\n
"
" inline
typename
"
,
titleCase
,
"::Builder init"
,
titleCase
,
"();
\n
"
"
\n
"
),
hasDiscriminantValue
(
proto
)
?
kj
::
strTree
()
:
kj
::
strTree
(
" inline "
,
titleCase
,
"::Pipeline get"
,
titleCase
,
"();
\n
"
),
kj
::
strTree
(
" inline
typename
"
,
titleCase
,
"::Pipeline get"
,
titleCase
,
"();
\n
"
),
kj
::
strTree
(
kj
::
mv
(
unionDiscrim
.
isDefs
),
templateContext
.
allDecls
(),
"inline "
,
scope
,
titleCase
,
"::Reader "
,
scope
,
"Reader::get"
,
titleCase
,
"() const {
\n
"
,
"inline
typename
"
,
scope
,
titleCase
,
"::Reader "
,
scope
,
"Reader::get"
,
titleCase
,
"() const {
\n
"
,
unionDiscrim
.
check
,
" return "
,
scope
,
titleCase
,
"::Reader(_reader);
\n
"
"}
\n
"
,
templateContext
.
allDecls
(),
"inline "
,
scope
,
titleCase
,
"::Builder "
,
scope
,
"Builder::get"
,
titleCase
,
"() {
\n
"
,
"inline
typename
"
,
scope
,
titleCase
,
"::Builder "
,
scope
,
"Builder::get"
,
titleCase
,
"() {
\n
"
,
unionDiscrim
.
check
,
" return "
,
scope
,
titleCase
,
"::Builder(_builder);
\n
"
"}
\n
"
,
hasDiscriminantValue
(
proto
)
?
kj
::
strTree
()
:
kj
::
strTree
(
"#if !CAPNP_LITE
\n
"
,
templateContext
.
allDecls
(),
"inline "
,
scope
,
titleCase
,
"::Pipeline "
,
scope
,
"Pipeline::get"
,
titleCase
,
"() {
\n
"
,
"inline
typename
"
,
scope
,
titleCase
,
"::Pipeline "
,
scope
,
"Pipeline::get"
,
titleCase
,
"() {
\n
"
,
" return "
,
scope
,
titleCase
,
"::Pipeline(_typeless.noop());
\n
"
"}
\n
"
"#endif // !CAPNP_LITE
\n
"
),
templateContext
.
allDecls
(),
"inline "
,
scope
,
titleCase
,
"::Builder "
,
scope
,
"Builder::init"
,
titleCase
,
"() {
\n
"
,
"inline
typename
"
,
scope
,
titleCase
,
"::Builder "
,
scope
,
"Builder::init"
,
titleCase
,
"() {
\n
"
,
unionDiscrim
.
set
,
KJ_MAP
(
slot
,
slots
)
{
switch
(
sectionFor
(
slot
.
whichType
))
{
...
...
c++/src/capnp/test.capnp
View file @
d18c6ec2
...
...
@@ -530,6 +530,13 @@ struct TestGenerics(Foo, Bar) {
foo @0 :Foo;
rev @1 :TestGenerics(Bar, Foo);
union {
uv @2:Void;
ug :group {
ugfoo @3:Int32;
}
}
struct Inner {
foo @0 :Foo;
bar @1 :Bar;
...
...
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