Of course, a static variable declared in a function (regardless of whether it is a template function) has no binding.
& sect; 3.5 para. 8: "except as indicated, the name declared in the block area (3.3.3) has no relationship"
The only exceptions listed in this paragraph, as far as I see, are given in the paragraph. 6: "The name of the function declared in the block scope and the name of the variable declared by the extern declaration of the block have a binding."
However, it is possible that 14.3.2 may be weakened at some point.
Daniel Krugler introduced DR 1451 on 2012-02-01:
According to 14.3.2 [temp.arg.nontype] of paragraph 1 of paragraph 3, only objects with a binding can be used to form arguments of a non-type type template. Is this restriction still necessary? It would be convenient to use block area objects as arguments to the template.
The DR was closed on the grounds that it was an extension request and should be decided by the Evolution Working Group. It seems to have been included in n3413 , "Allow arbitrary literals for non-piggy type template parameters."
Thus, of course, it is possible that one or more C ++ compilers can choose a restriction on fuzzy template parameters.
source share