Commit 49e04385 by Mark Mitchell Committed by Mark Mitchell

pt.c (print_template_context): Don't abort when instantiating a synthesized method.

	* pt.c (print_template_context): Don't abort when instantiating a
	synthesized method.

From-SVN: r21685
parent 05008fb9
1998-08-12 Mark Mitchell <mark@markmitchell.com>
* pt.c (print_template_context): Don't abort when instantiating a
synthesized method.
* decl.c (grokdeclarator): Issue errors on namespace qualified
declarators in parameter lists or in class scope.
......
......@@ -3699,25 +3699,28 @@ print_template_context (err)
int line = lineno;
char *file = input_filename;
if (err)
if (err && p)
{
if (current_function_decl == p->decl)
/* Avoid redundancy with the the "In function" line. */;
else if (current_function_decl == NULL_TREE)
fprintf (stderr, "%s: In instantiation of `%s':\n",
file, decl_as_string (p->decl, 0));
if (current_function_decl != p->decl
&& current_function_decl != NULL_TREE)
/* We can get here during the processing of some synthesized
method. Then, p->decl will be the function that's causing
the synthesis. */
;
else
my_friendly_abort (980521);
if (p)
{
if (current_function_decl == p->decl)
/* Avoid redundancy with the the "In function" line. */;
else
fprintf (stderr, "%s: In instantiation of `%s':\n",
file, decl_as_string (p->decl, 0));
line = p->line;
file = p->file;
p = p->next;
}
}
next:
for (; p; p = p->next)
{
fprintf (stderr, "%s:%d: instantiated from `%s'\n", file, line,
......
// Build don't link:
template <class T = int>
struct A { const T x; A() : x(0) { } A(T x) : x(x) { } };
template <class B>
void func () { B y; y = B(); } // ERROR - can't use default assignment
int main (void) { func< A<> >(); } // ERROR - instantiated from here
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