Commit 682cc0c5 authored by Branislav Katreniak's avatar Branislav Katreniak

capnp/test: add union in generic struct test - compilation error

Adding union into TestGenerics struct leads to compilation error
in generated header:
````cpp
In file included from external/capnproto/c++/src/capnp/test_capnp/capnp/test.capnp.c++:4:0:
external/capnproto/c++/src/capnp/test_capnp/capnp/test.capnp.h:9565:10: error: need ‘typename’ before ‘capnproto_test::capnp::test::TestGenerics<Foo, Bar>::Ug::Reader’ because ‘capnproto_test::capnp::test::TestGenerics<Foo, Bar>::Ug’ is a dependent scope
   inline Ug::Reader getUg() const;
````
Relavant parts in header file:

````cpp
template <typename Foo = ::capnp::AnyPointer, typename Bar = ::capnp::AnyPointer>
struct TestGenerics {
  ...
  struct Ug;
};

template <typename Foo, typename Bar>
class TestGenerics<Foo, Bar>::Reader {
  ...
  inline Ug::Reader getUg() const;
};
````

Compiler misses `typename` keyword before Ug::Reader.
parent 22c1b628
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment