This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Fix 7718
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 Sep 2002 20:54:49 +0100
- Subject: [C++ PATCH] Fix 7718
- Organization: Codesourcery LLC
Hi,
Another obvious patch. I put this assert in when doing tf_warning.
It triggers because decl substing can be speculative.
built & tested on i686-pc-linux-gnu.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7718
* pt.c (tsubst_decl): Remove assert.
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.615
diff -c -3 -p -r1.615 pt.c
*** cp/pt.c 16 Sep 2002 19:09:03 -0000 1.615
--- cp/pt.c 16 Sep 2002 19:46:50 -0000
*************** tsubst_decl (t, args, type, complain)
*** 5694,5701 ****
tree r = NULL_TREE;
tree in_decl = t;
- my_friendly_assert (complain & tf_error, 20011214);
-
/* Set the filename and linenumber to improve error-reporting. */
saved_lineno = lineno;
saved_filename = input_filename;
--- 5694,5699 ----
// { dg-do compile }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 16 Sep 2002 <nathan@codesourcery.com>
// PR 7718. ICE.
template <typename OBJECT>
void default_initializer(const OBJECT &) { }
template <typename OBJECT, void init_function(const OBJECT &)>
class cContainer {
public:
template <typename INITIALIZER>
void Add(const INITIALIZER &initializer) {
init_function(initializer);
}
};
int main() {
cContainer<int, default_initializer<int> > c;
c.Add<int>(42);
return 0;
}