Bug 50371 - [C++0x] std::nullptr_t rejected as non-type template-parameter
Summary: [C++0x] std::nullptr_t rejected as non-type template-parameter
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Paolo Carlini
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-09-12 22:37 UTC by Daniel Krügler
Modified: 2011-09-22 18:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-09-22 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Krügler 2011-09-12 22:37:53 UTC
This is a placeholder entry to add support for std::nullptr_t as non-type template-parameter (14.1 p4).

gcc 4.7.0 20110903 (experimental) in C++0x mode rejects the following code:

template<decltype(nullptr)>
struct nt;

"error: 'std::nullptr_t' is not a valid type for a template constant parameter"

The code should be accepted.
Comment 1 paolo@gcc.gnu.org 2011-09-22 18:20:58 UTC
Author: paolo
Date: Thu Sep 22 18:20:53 2011
New Revision: 179096

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179096
Log:
/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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/nullptr24.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
Comment 2 Paolo Carlini 2011-09-22 18:22:44 UTC
Done.