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
7aca59a9
Commit
7aca59a9
authored
Apr 25, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report compile errors in 'using' declarations that aren't ever referenced.
Fixes #403
parent
5de5e5cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
compiler.c++
c++/src/capnp/compiler/compiler.c++
+5
-0
errors.capnp.nobuild
c++/src/capnp/testdata/errors.capnp.nobuild
+3
-0
errors.txt
c++/src/capnp/testdata/errors.txt
+1
-0
No files found.
c++/src/capnp/compiler/compiler.c++
View file @
7aca59a9
...
...
@@ -681,6 +681,11 @@ void Compiler::Node::traverse(uint eagerness, std::unordered_map<Node*, uint>& s
for
(
auto
&
child
:
content
->
orderedNestedNodes
)
{
child
->
traverse
(
eagerness
,
seen
,
finalLoader
);
}
// Also traverse `using` declarations.
for
(
auto
&
child
:
content
->
aliases
)
{
child
.
second
->
compile
();
}
}
}
}
...
...
c++/src/capnp/testdata/errors.capnp.nobuild
View file @
7aca59a9
...
...
@@ -152,3 +152,6 @@ struct UseGeneric {
const embedBadType :UInt32 = embed "binary";
const embedNoSuchFile :Data = embed "no-such-file";
using Baz = import "nosuchfile-unused.capnp".Baz;
# Check that an import in an unused `using` still reports error.
c++/src/capnp/testdata/errors.txt
View file @
7aca59a9
...
...
@@ -56,3 +56,4 @@ file:149:18-49: error: Double-application of generic parameters.
file:150:38-43: error: Sorry, only pointer types can be used as generic parameters.
file:153:30-44: error: Embeds can only be used when Text, Data, or a struct is expected.
file:154:37-51: error: Couldn't read file for embed: no-such-file
file:156:20-45: error: Import failed: nosuchfile-unused.capnp
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