re PR c++/50371 ([C++0x] std::nullptr_t rejected as non-type template-parameter)

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

	PR c++/50371
	* pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.

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

	PR c++/50371
	* g++.dg/cpp0x/nullptr24.C: New.

From-SVN: r179096
This commit is contained in:
Paolo Carlini 2011-09-22 18:20:53 +00:00 committed by Paolo Carlini
parent 63d045e14e
commit 3acb1e03c4
4 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50371
* pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.
2011-09-22 Jonathan Wakely <jwakely.gcc@gmail.com>
Paolo Carlini <paolo.carlini@oracle.com>

View File

@ -18717,6 +18717,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return 0;
else if (TREE_CODE (type) == DECLTYPE_TYPE)
return 0;
else if (TREE_CODE (type) == NULLPTR_TYPE)
return 0;
if (complain & tf_error)
error ("%q#T is not a valid type for a template constant parameter", type);

View File

@ -1,3 +1,8 @@
2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50371
* g++.dg/cpp0x/nullptr24.C: New.
2011-09-22 Uros Bizjak <ubizjak@gmail.com>
PR target/50482

View File

@ -0,0 +1,5 @@
// PR c++/50371
// { dg-options -std=c++0x }
template<decltype(nullptr)>
struct nt;