Commit c5d6c6d9 by Jason Merrill Committed by Jason Merrill

Fix template argument of nullptr_t type.

	* pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
	nullptr_node.

From-SVN: r249080
parent 3d2e25a2
2017-06-09 Jason Merrill <jason@redhat.com>
* pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
nullptr_node.
* parser.c (cp_parser_constant_expression): Check
potential_rvalue_constant_expression after decay_conversion.
* pt.c (convert_nontype_argument): Don't require linkage in C++17.
......
......@@ -6480,7 +6480,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
/* 14.3.2/5: The null pointer{,-to-member} conversion is applied
to a non-type argument of "nullptr". */
if (expr == nullptr_node && TYPE_PTR_OR_PTRMEM_P (type))
if (NULLPTR_TYPE_P (expr_type) && TYPE_PTR_OR_PTRMEM_P (type))
expr = fold_simple (convert (type, expr));
/* In C++11, integral or enumeration non-type template arguments can be
......
// { dg-do compile { target c++11 } }
using nullptr_t = decltype(nullptr);
constexpr nullptr_t n = nullptr;
template <void *> struct A { };
A<n> a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment