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
This commit is contained in:
Mark Mitchell 1999-05-05 11:50:03 +00:00 committed by Mark Mitchell
parent 14caa62fcb
commit b3f738dacc
7 changed files with 274 additions and 227 deletions

View File

@ -1,3 +1,14 @@
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 Löwis <loewis@informatik.hu-berlin.de>
* typeck.c (string_conv_p): Use same_type_p to check whether we

View File

@ -2918,6 +2918,13 @@ start_objects (method_type, initp)
clear_last_expr ();
push_momentary ();
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

File diff suppressed because it is too large Load Diff

View File

@ -2954,7 +2954,8 @@ nested_name_specifier_1:
$$ = lastiddecl;
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
{

View File

@ -1429,9 +1429,8 @@ check_explicit_specialization (declarator, decl, template_count, flags)
if (fns == NULL_TREE)
{
cp_error ("no member function `%s' declared in `%T'",
IDENTIFIER_POINTER (name),
ctype);
cp_error ("no member function `%D' declared in `%T'",
name, ctype);
return error_mark_node;
}
else

View File

@ -0,0 +1,13 @@
// 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 () {}

View File

@ -0,0 +1,15 @@
// 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; }