[PATCH] Adding static data member templates.

Larisse Voufo lvoufo at google.com
Wed Aug 21 19:41:16 PDT 2013

Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:2663
@@ +2662,3 @@
+                                     LateAttrs, StartingScope);
+  InstPartialSpec->setInit(PartialSpec->getInit());
Richard Smith wrote:
> I think this won't correctly handle a case like:
>     template<typename A> struct S { template<typename B> static int V; };
>     template struct S<int>;
>     template<typename A> template<typename B> int S<A>::V<B> = 123;
>     int k = S<int>::V<void>;
> ... because we don't have the initializer yet at the point where we instantiate the variable template's declaration. You'll need to go back to the original template and look for an initializer there.
Case noted. Will be fixing this in future revisions. 


More information about the cfe-commits mailing list