mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-19 11:00:48 +08:00
re PR c++/26195 (pragma interface no longer handles explicit names)
PR c++/26195 * decl.c (make_rtl_for_nonlocal_decl), (start_preparsed_function): Don't use lbasename on input_filename when calling get_fileinfo. * semantics.c (begin_class_definition): Likewise. * lex.c (cxx_make_type): Likewise. (handle_pragma_interface): Call get_fileinfo on input_filename, not on the parameter to the directive. From-SVN: r116740
This commit is contained in:
parent
b5b84a7f46
commit
c533e34d79
@ -1,3 +1,14 @@
|
||||
2006-09-06 Zak Kipling <zak@transversal.com>
|
||||
|
||||
PR c++/26195
|
||||
* decl.c (make_rtl_for_nonlocal_decl),
|
||||
(start_preparsed_function): Don't use lbasename on
|
||||
input_filename when calling get_fileinfo.
|
||||
* semantics.c (begin_class_definition): Likewise.
|
||||
* lex.c (cxx_make_type): Likewise.
|
||||
(handle_pragma_interface): Call get_fileinfo on input_filename,
|
||||
not on the parameter to the directive.
|
||||
|
||||
2006-09-06 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/28903
|
||||
|
@ -4908,7 +4908,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
|
||||
{
|
||||
/* Fool with the linkage of static consts according to #pragma
|
||||
interface. */
|
||||
struct c_fileinfo *finfo = get_fileinfo (lbasename (filename));
|
||||
struct c_fileinfo *finfo = get_fileinfo (filename);
|
||||
if (!finfo->interface_unknown && !TREE_PUBLIC (decl))
|
||||
{
|
||||
TREE_PUBLIC (decl) = 1;
|
||||
@ -10357,7 +10357,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
|
||||
struct cp_binding_level *bl;
|
||||
tree current_function_parms;
|
||||
struct c_fileinfo *finfo
|
||||
= get_fileinfo (lbasename (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1))));
|
||||
= get_fileinfo (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1)));
|
||||
bool honor_interface;
|
||||
|
||||
/* Sanity check. */
|
||||
|
@ -503,7 +503,7 @@ handle_pragma_interface (cpp_reader* dfile ATTRIBUTE_UNUSED )
|
||||
else
|
||||
filename = ggc_strdup (TREE_STRING_POINTER (fname));
|
||||
|
||||
finfo = get_fileinfo (filename);
|
||||
finfo = get_fileinfo (input_filename);
|
||||
|
||||
if (impl_file_chain == 0)
|
||||
{
|
||||
@ -809,7 +809,7 @@ cxx_make_type (enum tree_code code)
|
||||
/* Set up some flags that give proper default behavior. */
|
||||
if (IS_AGGR_TYPE_CODE (code))
|
||||
{
|
||||
struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename));
|
||||
struct c_fileinfo *finfo = get_fileinfo (input_filename);
|
||||
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown);
|
||||
CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only;
|
||||
}
|
||||
|
@ -2174,7 +2174,7 @@ begin_class_definition (tree t, tree attributes)
|
||||
before. */
|
||||
if (! TYPE_ANONYMOUS_P (t))
|
||||
{
|
||||
struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename));
|
||||
struct c_fileinfo *finfo = get_fileinfo (input_filename);
|
||||
CLASSTYPE_INTERFACE_ONLY (t) = finfo->interface_only;
|
||||
SET_CLASSTYPE_INTERFACE_UNKNOWN_X
|
||||
(t, finfo->interface_unknown);
|
||||
|
7
gcc/testsuite/g++.dg/ext/interface2.C
Normal file
7
gcc/testsuite/g++.dg/ext/interface2.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/26195
|
||||
// { dg-do link }
|
||||
// { dg-additional-sources "interface2b.cc" }
|
||||
// { dg-options "-fno-inline" }
|
||||
|
||||
#pragma implementation "interface2-imaginary.h"
|
||||
#include "interface2a.h"
|
5
gcc/testsuite/g++.dg/ext/interface2a.h
Normal file
5
gcc/testsuite/g++.dg/ext/interface2a.h
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/26195
|
||||
#pragma interface "interface2-imaginary.h"
|
||||
|
||||
inline void foo1() { }
|
||||
inline void foo2() { }
|
9
gcc/testsuite/g++.dg/ext/interface2b.cc
Normal file
9
gcc/testsuite/g++.dg/ext/interface2b.cc
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/26195
|
||||
extern void foo1();
|
||||
extern void foo2();
|
||||
|
||||
int main()
|
||||
{
|
||||
foo1();
|
||||
foo2();
|
||||
}
|
6
gcc/testsuite/g++.dg/ext/interface3/dir1/interface3.h
Normal file
6
gcc/testsuite/g++.dg/ext/interface3/dir1/interface3.h
Normal file
@ -0,0 +1,6 @@
|
||||
// PR c++/26195
|
||||
#pragma interface "dir1/interface3.h"
|
||||
#include "../dir2/interface3.h"
|
||||
|
||||
inline void f1() { }
|
||||
inline void f2() { }
|
5
gcc/testsuite/g++.dg/ext/interface3/dir2/interface3.h
Normal file
5
gcc/testsuite/g++.dg/ext/interface3/dir2/interface3.h
Normal file
@ -0,0 +1,5 @@
|
||||
// PR c++/26195
|
||||
#pragma interface "dir2/interface3.h"
|
||||
|
||||
inline void g1() { }
|
||||
inline void g2() { }
|
7
gcc/testsuite/g++.dg/ext/interface3/interface3a.C
Normal file
7
gcc/testsuite/g++.dg/ext/interface3/interface3a.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/26195
|
||||
// { dg-do link }
|
||||
// { dg-additional-sources "interface3a2.cc" }
|
||||
// { dg-options "-I. -fno-inline" }
|
||||
|
||||
#pragma implementation "dir1/interface3.cc"
|
||||
#include "dir1/interface3.h"
|
9
gcc/testsuite/g++.dg/ext/interface3/interface3a2.cc
Normal file
9
gcc/testsuite/g++.dg/ext/interface3/interface3a2.cc
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/26195
|
||||
extern void f1();
|
||||
extern void f2();
|
||||
|
||||
int main()
|
||||
{
|
||||
f1();
|
||||
f2();
|
||||
}
|
7
gcc/testsuite/g++.dg/ext/interface3/interface3b.C
Normal file
7
gcc/testsuite/g++.dg/ext/interface3/interface3b.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/26195
|
||||
// { dg-do link }
|
||||
// { dg-additional-sources "interface3b2.cc" }
|
||||
// { dg-options "-fno-inline" }
|
||||
|
||||
#pragma implementation "dir2/interface3.cc"
|
||||
#include "dir1/interface3.h"
|
9
gcc/testsuite/g++.dg/ext/interface3/interface3b2.cc
Normal file
9
gcc/testsuite/g++.dg/ext/interface3/interface3b2.cc
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/26195
|
||||
extern void g1();
|
||||
extern void g2();
|
||||
|
||||
int main()
|
||||
{
|
||||
g1();
|
||||
g2();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user