Commit 08dc4c3d by Jason Merrill Committed by Jason Merrill

re PR c++/48617 ([C++0x] Problem with non-type template parameters and decltype)

	PR c++/48617
	* pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE.

From-SVN: r174070
parent 8bdfec38
2011-05-23 Jason Merrill <jason@redhat.com>
PR c++/48617
* pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE.
2011-05-23 Nathan Froyd <froydnj@codesourcery.com> 2011-05-23 Nathan Froyd <froydnj@codesourcery.com>
* call.c (build_over_call): Tweak call to check_function_arguments. * call.c (build_over_call): Tweak call to check_function_arguments.
......
...@@ -18089,6 +18089,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) ...@@ -18089,6 +18089,8 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return 0; return 0;
else if (TREE_CODE (type) == TYPENAME_TYPE) else if (TREE_CODE (type) == TYPENAME_TYPE)
return 0; return 0;
else if (TREE_CODE (type) == DECLTYPE_TYPE)
return 0;
if (complain & tf_error) if (complain & tf_error)
error ("%q#T is not a valid type for a template constant parameter", type); error ("%q#T is not a valid type for a template constant parameter", type);
......
2011-05-23 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/decltype27.C: New.
2011-05-23 Richard Guenther <rguenther@suse.de> 2011-05-23 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/forwprop-11.c: Adjust and un-XFAIL. * gcc.dg/tree-ssa/forwprop-11.c: Adjust and un-XFAIL.
......
// PR c++/48617
// { dg-options -std=c++0x }
template<class T, decltype(T())> // #
struct A {};
A<int, 0> a;
int main() {}
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