re PR c++/10471 (SegFault in build_cxx_call)

PR c++/10471
	* call.c (build_cxx_call): Robustify.

	PR c++/10471
	* g++.dg/template/defarg2.C: New test.

From-SVN: r66032
This commit is contained in:
Mark Mitchell 2003-04-24 05:54:46 +00:00 committed by Mark Mitchell
parent 6ff76c365c
commit 374ca7f74e
4 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-04-23 Mark Mitchell <mark@codesourcery.com>
PR c++/10471
* call.c (build_cxx_call): Robustify.
2003-04-23 Neil Booth <neil@daikokuya.co.uk>
* Make-lang.in (lex.o): Remove mbchar.h.

View File

@ -4737,7 +4737,9 @@ build_cxx_call(tree fn, tree args, tree converted_args)
/* If this call might throw an exception, note that fact. */
fndecl = get_callee_fndecl (fn);
if ((!fndecl || !TREE_NOTHROW (fndecl)) && at_function_scope_p ())
if ((!fndecl || !TREE_NOTHROW (fndecl))
&& at_function_scope_p ()
&& cfun)
cp_function_chain->can_throw = 1;
/* Some built-in function calls will be evaluated at compile-time in

View File

@ -1,3 +1,8 @@
2003-04-23 Mark Mitchell <mark@codesourcery.com>
PR c++/10471
* g++.dg/template/defarg2.C: New test.
2003-04-23 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/include2.c: Update.

View File

@ -0,0 +1,10 @@
struct X {
X ();
};
template <int> struct O {
struct I {
I (const X & = X());
};
};
template struct O<2>;