<div dir="ltr"><div>Reduced testcase:</div><div><br></div><div>template<int A> struct outer {</div><div>  template<int B, int C> struct inner {};</div><div>  template<int C> struct inner<A * 2, C> {};</div>
<div>};</div><div><br></div><div>Yes, this is valid code. Please file a bug!</div><div><br></div><div>You can work around this by hiding the non-type template argument in a type template argument:</div><div><br></div><div>
<div>template<int N> struct Int { static const int value = N; };</div><div><br></div><div>template<int A> struct outer {</div><div>  template<typename B, int C> struct inner {}; </div><div>  template<int C> struct inner<Int<A * 2>, C> {};</div>
<div>};</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 19, 2013 at 8:31 AM, John Owens <span dir="ltr"><<a href="mailto:john_owens@yahoo.com" target="_blank">john_owens@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks John, and thanks to Don Hinton who had an offline suggestion to use default values for template parameters. We’re happy to take any suggestions we can / inspire clang toward handling a few more cases!<br>

<br>
JDO<br>
<div class="HOEnZb"><div class="h5"><br>
On Nov 19, 2013, at 8:25 AM, Fletcher, John P <<a href="mailto:j.p.fletcher@aston.ac.uk">j.p.fletcher@aston.ac.uk</a>> wrote:<br>
<br>
> John<br>
><br>
> I am copying this to the developers list which has a much higher traffic and where they are interested in things wrong with clang.<br>
><br>
> John Fletcher<br>
><br>
> -----Original Message-----<br>
> From: <a href="mailto:cfe-users-bounces@cs.uiuc.edu">cfe-users-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:cfe-users-bounces@cs.uiuc.edu">cfe-users-bounces@cs.uiuc.edu</a>] On Behalf Of John Owens<br>
> Sent: 15 November 2013 22:23<br>
> To: <a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
> Subject: [cfe-users] error: non-type template argument depends on a template parameter of the partial specialization<br>
><br>
> Greetings!<br>
><br>
> We're about to release a graph library for GPUs. The library compiles fine on, well, everything except clang (I'm using OS X), and it's because clang does not support the same template feature set as other compilers. ("error: non-type template argument depends on a template parameter of the partial specialization")<br>

><br>
> Here's the issue and the reply from Duane Merrill at NVIDIA:<br>
><br>
> <a href="https://github.com/gunrock/gunrock/issues/1" target="_blank">https://github.com/gunrock/gunrock/issues/1</a><br>
><br>
> (I'll append a short version of it below.)<br>
><br>
> What I'd love to know is "is this something that clang will support in the near future / is there an easy clang workaround". If neither is true, perhaps we do some refactoring, per Duane's suggestion. But if either is true, that would ease our support issues.<br>

><br>
> JDO<br>
><br>
><br>
> load_tile.cuh:207:<br>
><br>
>        template <int LOAD, int dummy><br>
>        struct Iterate<LOAD, LOAD_VEC_SIZE, dummy><br>
><br>
> The error I'm getting is:<br>
><br>
> ../../gunrock/util/io/load_tile.cuh:207:23: error: non-type template argument<br>
>      depends on a template parameter of the partial specialization _______________________________________________<br>
> cfe-users mailing list<br>
> <a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a><br>
><br>
><br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>