Commit 8b6a662e by Jeffrey D. Oldham Committed by Jeffrey D. Oldham

re PR c++/9778 (ICE with sizeof(expr) in non-type template arg)

2003-02-24  Jeffrey D. Oldham  <oldham@codesourcery.com>

	PR c++/9778
	* cp/pt.c (tsubst_copy_and_build): For a templated function inside a
	scope, process template arguments.
	* testsuite/g++.dg/parse/template6.C: New test case.

From-SVN: r63379
parent 57df94c8
2003-02-24 Jeffrey D. Oldham <oldham@codesourcery.com>
PR c++/9778
* pt.c (tsubst_copy_and_build): For a templated function inside a
scope, process template arguments.
2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9602 PR c++/9602
......
...@@ -8137,7 +8137,7 @@ tsubst_copy_and_build (t, args, complain, in_decl) ...@@ -8137,7 +8137,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
if (TREE_CODE (name) == TEMPLATE_ID_EXPR) if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
name = build_nt (TEMPLATE_ID_EXPR, name = build_nt (TEMPLATE_ID_EXPR,
TREE_OPERAND (name, 0), TREE_OPERAND (name, 0),
TREE_OPERAND (name, 1)); build_expr_from_tree (TREE_OPERAND (name, 1)));
function = resolve_scoped_fn_name (TREE_OPERAND (function, 0), function = resolve_scoped_fn_name (TREE_OPERAND (function, 0),
name); name);
......
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Wolfgang Bangerth <bangerth@ticam.utexas.edu> 20 Feb 2003.
// PR c++/9778. Ensure templated functions in other namespaces are
// correctly instantiated.
namespace NS {
template <int N> void foo ();
}
template <int N> struct X {
int m;
void g () {
NS::foo<sizeof(m)>();
}
};
template class X<2>;
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