On Mar 13, 2013, at 12:55 PM, "Gao, Yunzhong" <[email protected]> wrote:
> Hi,
> Currently, clang++ accepts the following codes without any error message.
>
> int test(void)
> {
> class A {
> template<class T> class B
> { T t; };
> };
>
> return 0;
> }
>
> However, I believe that an error message is required according to the C++03
> and C++11.
> In particular, section 14.5 clause 2 (of both specs) says "A local class
> shall not have member templates."
>
> The following patch adds a diagnostic for member templates declared inside a
> local class.
Generally, this looks good. However, I'd like to see it diagnosed in Sema,
rather than in the parser, which we do for static data members and friends in
local classes.
- Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits