re PR c++/17155 (Another link problem with function-local classes)
PR c++/17155 * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++ functions. PR c++/17155 * g++.dg/inherit/local2.C: New test. From-SVN: r86571
This commit is contained in:
parent
8e8d51622f
commit
6dc36fed57
@ -1,5 +1,9 @@
|
||||
2004-08-25 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/17155
|
||||
* lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
|
||||
functions.
|
||||
|
||||
* mangle.c (get_identifier_nocopy): Add cast.
|
||||
|
||||
* cp-tree.h (mangle_type): Remove.
|
||||
|
@ -649,6 +649,11 @@ build_lang_decl (enum tree_code code, tree name, tree type)
|
||||
t = build_decl (code, name, type);
|
||||
retrofit_lang_decl (t);
|
||||
|
||||
/* All nesting of C++ functions is lexical; there is never a "static
|
||||
chain" in the sense of GNU C nested functions. */
|
||||
if (code == FUNCTION_DECL)
|
||||
DECL_NO_STATIC_CHAIN (t) = 1;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-08-25 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/17155
|
||||
* g++.dg/inherit/local2.C: New test.
|
||||
|
||||
2004-08-25 Paul Brook <paul@codesourcery.com>
|
||||
|
||||
PR fortran/17144
|
||||
|
16
gcc/testsuite/g++.dg/inherit/local2.C
Normal file
16
gcc/testsuite/g++.dg/inherit/local2.C
Normal file
@ -0,0 +1,16 @@
|
||||
// PR c++/17155
|
||||
// { dg-do link }
|
||||
|
||||
struct A {
|
||||
virtual ~A() {}
|
||||
};
|
||||
|
||||
|
||||
void tsk_tsk(void)
|
||||
{
|
||||
struct B : public A {
|
||||
B(int) {}
|
||||
};
|
||||
}
|
||||
|
||||
int main () {}
|
Loading…
Reference in New Issue
Block a user