Commit 8fb3401b by Paolo Carlini Committed by Paolo Carlini

pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.

/cp
2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.

/testsuite
2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp0x/nullptr25.C: New.

From-SVN: r179199
parent 734e01f0
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/26747
* cp-gimplify.c (get_bc_label): Remove obsolete diagnostics.
......
......@@ -5951,6 +5951,16 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
if (expr == error_mark_node)
return expr;
}
else if (NULLPTR_TYPE_P (type))
{
if (expr != nullptr_node)
{
error ("%qE is not a valid template argument for type %qT "
"because it is of type %qT", expr, type, TREE_TYPE (expr));
return NULL_TREE;
}
return expr;
}
/* A template non-type parameter must be one of the above. */
else
gcc_unreachable ();
......
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/nullptr25.C: New.
2011-09-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/50472
......
// { dg-options -std=c++0x }
template<decltype(nullptr)>
struct nt{};
nt<nullptr> x;
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