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),
-              "%qD is not a static data member of a class template", decl);
+  if (!TYPE_P (ctx) || !CLASSTYPE_TEMPLATE_INFO (ctx)) {
+    if (cxx_dialect < cxx1y)
+      permerror (DECL_SOURCE_LOCATION (decl),
+                 "%qD is not a static data member of a class template", decl);
+  }
   else if (template_header_count > wanted)

I think we still want to check for excess template headers.

+      else if (VAR_P (decl)) {
+        if (!DECL_DECLARED_CONSTEXPR_P (decl))
+          error ("template declaration of non-constexpr variable %qD", decl);
+      }

Open brace should be on a line by itself.

Jason

Reply via email to