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:
parent
14caa62fcb
commit
b3f738dacc
@ -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
|
||||
|
@ -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
|
||||
|
447
gcc/cp/parse.c
447
gcc/cp/parse.c
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
13
gcc/testsuite/g++.old-deja/g++.other/init13.C
Normal file
13
gcc/testsuite/g++.old-deja/g++.other/init13.C
Normal 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 () {}
|
15
gcc/testsuite/g++.old-deja/g++.pt/nested2.C
Normal file
15
gcc/testsuite/g++.old-deja/g++.pt/nested2.C
Normal 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; }
|
Loading…
Reference in New Issue
Block a user