===================================================================
@@ -463,6 +463,7 @@ maybe_begin_member_template_processing (tree decl)
if (nsdmi)
decl = (CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl))
+ && uses_template_parms (DECL_CONTEXT (decl))
? CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (decl))
: NULL_TREE);
===================================================================
@@ -0,0 +1,16 @@
+// PR c++/60999
+// { dg-do compile { target c++11 } }
+
+template <typename A>
+struct foo
+{
+};
+
+template<>
+struct foo<int>
+{
+ static constexpr int code = 42;
+ unsigned int bar = static_cast<unsigned int>(code);
+};
+
+foo<int> a;