[PATCH] Adding static data member templates.

Richard Smith richard at metafoo.co.uk
Wed Aug 21 17:00:44 PDT 2013

Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:2663
@@ +2662,3 @@
+                                     LateAttrs, StartingScope);
+  InstPartialSpec->setInit(PartialSpec->getInit());
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.


More information about the cfe-commits mailing list