* pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
nullptr_node.
From-SVN: r249080
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.
/* 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
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+using nullptr_t = decltype(nullptr);
+
+constexpr nullptr_t n = nullptr;
+
+template <void *> struct A { };
+
+A<n> a;