re PR c++/13289 (ICE in regenerate_decl_from_template on recursive template)
PR c++/13289 * semantics.c (finish_id_expression): Only check if the type of a template argument is integral or enumeration when it is not dependent. * g++.dg/parse/nontype1.C: New test. From-SVN: r75200
This commit is contained in:
parent
2f9afd51aa
commit
68deab91f2
@ -1,3 +1,10 @@
|
|||||||
|
2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/13289
|
||||||
|
* semantics.c (finish_id_expression): Only check if the type of
|
||||||
|
a template argument is integral or enumeration when it is not
|
||||||
|
dependent.
|
||||||
|
|
||||||
2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
PR c++/12403
|
PR c++/12403
|
||||||
|
@ -2400,6 +2400,7 @@ finish_id_expression (tree id_expression,
|
|||||||
if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX)
|
if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX)
|
||||||
decl = TEMPLATE_PARM_DECL (decl);
|
decl = TEMPLATE_PARM_DECL (decl);
|
||||||
if (integral_constant_expression_p
|
if (integral_constant_expression_p
|
||||||
|
&& !dependent_type_p (TREE_TYPE (decl))
|
||||||
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
|
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
|
||||||
{
|
{
|
||||||
if (!allow_non_integral_constant_expression_p)
|
if (!allow_non_integral_constant_expression_p)
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
|
PR c++/13289
|
||||||
|
* g++.dg/parse/nontype1.C: New test.
|
||||||
|
|
||||||
2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
|
||||||
PR c++/12403
|
PR c++/12403
|
||||||
|
9
gcc/testsuite/g++.dg/parse/nontype1.C
Normal file
9
gcc/testsuite/g++.dg/parse/nontype1.C
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright (C) 2003 Free Software Foundation
|
||||||
|
// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// PR c++/13289: Incorrectly reject non-type template argument that has
|
||||||
|
// dependent type
|
||||||
|
|
||||||
|
template <class T, T t> class C {};
|
||||||
|
template <class T, T t> class D { C<T, t-1> c; };
|
Loading…
Reference in New Issue
Block a user