re PR c++/57092 (Using decltype of function pointer type to define a data member causes compiler crash)

/cp
2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57092
	* semantics.c (finish_decltype_type): Handle instantiated template
	non-type arguments.

/testsuite
2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57092
	* g++.dg/cpp0x/decltype53.C: New.

From-SVN: r198487
This commit is contained in:
Paolo Carlini 2013-05-01 09:21:30 +00:00 committed by Paolo Carlini
parent e1e14947cf
commit 57c16a5eb6
4 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57092
* semantics.c (finish_decltype_type): Handle instantiated template
non-type arguments.
2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56450

View File

@ -5416,8 +5416,9 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
break;
default:
gcc_unreachable ();
return error_mark_node;
/* Handle instantiated template non-type arguments. */
type = TREE_TYPE (expr);
break;
}
}
else

View File

@ -1,3 +1,8 @@
2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57092
* g++.dg/cpp0x/decltype53.C: New.
2013-04-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/57071

View File

@ -0,0 +1,11 @@
// PR c++/57092
// { dg-do compile { target c++11 } }
template <void (*F)(int)>
class B {
decltype(F) v;
};
void foo(int) {}
B<foo> o;