Skip to content

Conversation

@idubinov
Copy link
Contributor

@idubinov idubinov commented Aug 6, 2019

During the generation of the integration header, the forward declaration of the template template parameter did not printed.

In case of template template argument it is not necessary to call emitForwardClassDecls function recursively because of the maximum nesting level of template argument is equals two.

For example:

template <typename T> class Bar;
template <template <typename> class> class Baz;
template <template <template <typename> class> class T> class Foo;

The Baz is a template class.
The Baz<Bar> is a class.
The class Foo should be specialized with template class, not a class.
The correct specialization of template class Foo is Foo<Baz>.
The incorrect specialization of template class Foo is Foo<Baz<Bar>>. In this case template class Foo specialized by class Baz<Bar>, not a template class template <template <typename> class> class T as it should.
The maximum level of template nesting in specialization is 2.

The proposed fix prints forward declaration of Foo and Baz template classes into integration header. It's enough to prints declaration of template argument inside switch block.

Signed-off-by: idubinov [email protected]

@alexbatashev
Copy link
Contributor

@idubinov should your PR address issues like #469?

@idubinov
Copy link
Contributor Author

idubinov commented Aug 8, 2019

@alexbatashev ,
This PR does not solve issue #469.

@idubinov idubinov force-pushed the private/idubinov/template branch 2 times, most recently from 9edeab5 to 60f0337 Compare August 8, 2019 11:14
romanovvlad
romanovvlad previously approved these changes Aug 8, 2019
romanovvlad
romanovvlad previously approved these changes Aug 8, 2019
@bader
Copy link
Contributor

bader commented Aug 9, 2019

@idubinov, I'd like to make sure this change do not break SYCL implementation on Windows.
To do this, we need to pull #463.
Could you rebase your PR?

@idubinov idubinov force-pushed the private/idubinov/template branch from 31b7a98 to eedf95c Compare August 12, 2019 12:32
@idubinov
Copy link
Contributor Author

@bader , @romanovvlad ,
PR rebased

@bader bader merged commit 45194f7 into sycl Aug 12, 2019
@bader bader deleted the private/idubinov/template branch September 5, 2019 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants