Re: [var-template] Accept variable template declaration

2013-04-01 Thread Gabriel Dos Reis
On Mon, Apr 1, 2013 at 3:58 PM, Jason Merrill wrote: > On 04/01/2013 04:53 PM, Gabriel Dos Reis wrote: >> >> On Sun, Mar 31, 2013 at 12:13 AM, Jason Merrill wrote: >>> >>> >>> On 03/29/2013 10:56 PM, Gabriel Dos Reis wrote: int wanted = num_template_headers_for_class (ctx); >>>

Re: [var-template] Accept variable template declaration

2013-04-01 Thread Jason Merrill
On 04/01/2013 04:53 PM, Gabriel Dos Reis wrote: On Sun, Mar 31, 2013 at 12:13 AM, Jason Merrill wrote: On 03/29/2013 10:56 PM, Gabriel Dos Reis wrote: int wanted = num_template_headers_for_class (ctx); I think you want to add one to wanted if decl is a primary template. OK but I am a

Re: [var-template] Accept variable template declaration

2013-04-01 Thread Gabriel Dos Reis
On Sun, Mar 31, 2013 at 12:13 AM, Jason Merrill wrote: > > On 03/29/2013 10:56 PM, Gabriel Dos Reis wrote: >> >>int wanted = num_template_headers_for_class (ctx); > > > I think you want to add one to wanted if decl is a primary template. OK but I am a little bit dense here: why is that necess

Re: [var-template] Accept variable template declaration

2013-03-30 Thread Jason Merrill
On 03/29/2013 10:56 PM, Gabriel Dos Reis wrote: int wanted = num_template_headers_for_class (ctx); I think you want to add one to wanted if decl is a primary template. Jason

Re: [var-template] Accept variable template declaration

2013-03-29 Thread Gabriel Dos Reis
Jason Merrill writes: | On 03/29/2013 06:29 PM, Gabriel Dos Reis wrote: | > + if (TREE_CODE (t) != TEMPLATE_DECL | > + || !(DECL_NAMESPACE_SCOPE_P (t) || DECL_MEMBER_TEMPLATE_P (t))) | | Why check the scope? ah right, if it is a template the scope was already checked. | > - if (!TYPE_P

Re: [var-template] Accept variable template declaration

2013-03-29 Thread Jason Merrill
On 03/29/2013 06:29 PM, Gabriel Dos Reis wrote: + if (TREE_CODE (t) != TEMPLATE_DECL + || !(DECL_NAMESPACE_SCOPE_P (t) || DECL_MEMBER_TEMPLATE_P (t))) Why check the scope? - if (!TYPE_P (ctx) || !CLASSTYPE_TEMPLATE_INFO (ctx)) -permerror (DECL_SOURCE_LOCATION (decl), -