Commit 088d4f95 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/38640 (ICE with decltype of template value parameter)

	PR c++/38640
	* semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX.

	* g++.dg/cpp0x/decltype15.C: New test.

From-SVN: r142973
parent 03375368
2008-12-31 Jakub Jelinek <jakub@redhat.com>
PR c++/38640
* semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX.
2008-12-29 Jakub Jelinek <jakub@redhat.com> 2008-12-29 Jakub Jelinek <jakub@redhat.com>
PR c++/38635 PR c++/38635
......
...@@ -4640,6 +4640,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p) ...@@ -4640,6 +4640,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
case CONST_DECL: case CONST_DECL:
case PARM_DECL: case PARM_DECL:
case RESULT_DECL: case RESULT_DECL:
case TEMPLATE_PARM_INDEX:
type = TREE_TYPE (expr); type = TREE_TYPE (expr);
break; break;
......
2008-12-31 Jakub Jelinek <jakub@redhat.com> 2008-12-31 Jakub Jelinek <jakub@redhat.com>
PR c++/38640
* g++.dg/cpp0x/decltype15.C: New test.
PR middle-end/38676 PR middle-end/38676
* gcc.dg/gomp/pr38676.c: New test. * gcc.dg/gomp/pr38676.c: New test.
......
// PR c++/38640
// { dg-do compile }
// { dg-options "-std=c++0x" }
template<int N> void foo (decltype (N));
template<long int N> void foo (decltype (N));
void
bar (void)
{
foo<5> (6);
foo<5L> (6L);
}
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