http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56095

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 
2013-01-24 11:56:31 UTC ---
While I agree that the ICE needs to be fixed, let me add in here that any
conversion that requires the equivalent of a reinterpret_cast is not valid in a
constant expression in C++11. Furthermore, there are even more fundamental
restrictions on the form of the non-type template arguments as described in
[temp.arg.nontype] p1, which exclude *any* form of a cast expression at that
place. These rules also exclude the case that you tried in your second example
where you are attempting to use a constexpr variable.

The essential wording here is:

"a constant expression (5.19) that designates the address of [..] a function
with external or internal linkage, including function templates and function
template-ids [..], expressed (ignoring parentheses) as &id-expression, except
that the & may be omitted if the name refers to a function [..]"

Basically this means you can only directly name a function here such as

z<a>();

which of course won't work in your case because of the incompatible signature.

Reply via email to