Commit b3f738da by Mark Mitchell Committed by Mark Mitchell

decl2.c (start_objects): Don't let static constructors and destructors get inlined.

	* decl2.c (start_objects): Don't let static constructors and
	destructors get inlined.
	* parse.y (nested_name_specifier): Make sure ordinary types are
	complete, just like template types.
	* parse.c: Regenerated.
	* pt.c (check_explicit_specialization): Improve error messages.

From-SVN: r26780
parent 14caa62f
1999-05-05 Mark Mitchell <mark@codesourcery.com>
* decl2.c (start_objects): Don't let static constructors and
destructors get inlined.
* parse.y (nested_name_specifier): Make sure ordinary types are
complete, just like template types.
* parse.c: Regenerated.
* pt.c (check_explicit_specialization): Improve error messages.
1999-05-04 Martin von Lwis <loewis@informatik.hu-berlin.de> 1999-05-04 Martin von Lwis <loewis@informatik.hu-berlin.de>
* typeck.c (string_conv_p): Use same_type_p to check whether we * typeck.c (string_conv_p): Use same_type_p to check whether we
......
...@@ -2918,6 +2918,13 @@ start_objects (method_type, initp) ...@@ -2918,6 +2918,13 @@ start_objects (method_type, initp)
clear_last_expr (); clear_last_expr ();
push_momentary (); push_momentary ();
expand_start_bindings (0); expand_start_bindings (0);
/* We cannot allow these functions to be elided, even if they do not
have external linkage. And, there's no point in deferring
copmilation of thes functions; they're all going to have to be
out anyhow. */
current_function_cannot_inline
= "static constructors and destructors cannot be inlined";
} }
/* Finish the process of running a particular set of global constructors /* Finish the process of running a particular set of global constructors
......
...@@ -2954,7 +2954,8 @@ nested_name_specifier_1: ...@@ -2954,7 +2954,8 @@ nested_name_specifier_1:
$$ = lastiddecl; $$ = lastiddecl;
maybe_note_name_used_in_class ($1, $$); maybe_note_name_used_in_class ($1, $$);
} }
got_scope = $$ = TYPE_MAIN_VARIANT (TREE_TYPE ($$)); got_scope = $$ =
complete_type (TYPE_MAIN_VARIANT (TREE_TYPE ($$)));
} }
| SELFNAME SCOPE | SELFNAME SCOPE
{ {
......
...@@ -1429,9 +1429,8 @@ check_explicit_specialization (declarator, decl, template_count, flags) ...@@ -1429,9 +1429,8 @@ check_explicit_specialization (declarator, decl, template_count, flags)
if (fns == NULL_TREE) if (fns == NULL_TREE)
{ {
cp_error ("no member function `%s' declared in `%T'", cp_error ("no member function `%D' declared in `%T'",
IDENTIFIER_POINTER (name), name, ctype);
ctype);
return error_mark_node; return error_mark_node;
} }
else else
......
// Build don't run:
// Special g++ Options: -O3
// Origin: Gabriel Dos_Reis <Gabriel.Dos_Reis@sophia.inria.fr>
void f() {}
struct X {
~X() { f (); }
};
X x;
int main () {}
// Build don't link:
// Origin: Mathias Doreille <Mathias.Doreille@imag.fr>
template<class T>
struct a {
struct b {
T operator()();
};
};
template<class T>
T a<T>::b::operator()() { return T(0); }
template<> int a<int>::b::operator()() { return 1; }
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