https://bugs.llvm.org/show_bug.cgi?id=35971
Richard Smith <richard-l...@metafoo.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
CC| |richard-l...@metafoo.co.uk
Status|NEW |RESOLVED
--- Comment #1 from Richard Smith <richard-l...@metafoo.co.uk> ---
(In reply to Borislav Stanimirov from comment #0)
> Both examples compile fine on gcc and msvc
That is a bug in those compilers. The C++11 and C++14 rules are quite clear
about the permitted syntactic forms of non-type template arguments.
[temp.arg.nontype]/1.3 says the argument shall be:
"[...] a pointer to member expressed as described in [expr.unary.op]"
GCC does correctly implement the rule for the non-pointer-to-member case:
https://godbolt.org/g/jb6gwU
... strongly suggesting that this is just an oversight on their part. (MSVC has
apparently never followed the rules here.)
The rule in question was changed in C++17 to allow arbitrary constant
expressions of the right type as non-type template arguments:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4198.html
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs