aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-20 08:34:54 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-20 08:34:54 +0000
commit146c1b4f3b845afd53dfd6595f550000b25325c5 (patch)
tree77c6f2ecee8dfe71ed0ec15fc16f213965dbd4dc /gcc/testsuite/g++.dg/other
parent859f903a74f702e73d4e4ac15fab371ff739e076 (diff)
* c-common.h (has_c_linkage): New interface.
* c-cppbuiltin.c: Include target.h. (c_cpp_builtins): Define __PRAGMA_REDEFINE_EXTNAME and __PRAGMA_EXTERN_PREFIX when appropriate. * c-pragma.c: Include target.h. Document clarified semantics of symbol-renaming #pragmas. (handle_pragma_redefine_extname, handle_pragma_extern_prefix) (maybe_apply_renaming_pragma): Rewrite according to clarified semantics. Always recognize, but do not necessarily execute. (init_pragma): Unconditionally register symbol-renaming pragmas. * system.h: Poison HANDLE_PRAGMA_REDEFINE_EXTNAME and HANDLE_PRAGMA_EXTERN_PREFIX. * target.h (struct gcc_target): Add handle_pragma_redefine_extname and handle_pragma_extern_prefix flags. * target-def.h: Add defaults for TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME and TARGET_HANDLE_PRAGMA_EXTERN_PREFIX. * Makefile.in (c-pragma.o, c-cppbuiltin.o): Update dependencies. * config/sol2.h: Define TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME, not HANDLE_PRAGMA_REDEFINE_EXTNAME. (TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_REDEFINE_EXTNAME. (TRANSFER_FROM_TRAMPOLINE): Prototype mprotect. * config/alpha/osf.h: Define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX, not HANDLE_PRAGMA_EXTERN_PREFIX. (TARGET_OS_CPP_BUILTINS): No need to define __PRAGMA_EXTERN_PREFIX. * doc/extend.texi (Solaris Pragmas, Tru64 Pragmas): Combine into one section "Symbol-Renaming Pragmas"; clarify; document adjusted semantics. * builtins.c (expand_builtin): Do not issue error for a builtin with no special case code and no DECL_ASSEMBLER_NAME; just do the library call. * c-decl.c (builtin_function): Don't call make_decl_rtl. * c-objc-common.c (has_c_linkage): Stub implementation. * cgraphunit.c (cgraph_expand_function) (cgraph_remove_unreachable_nodes): Don't clear DECL_ARGUMENTS. cp: * cp-lang.c (has_c_linkage): Implement. * cp-tree.h (set_mangled_name_for_decl): Don't prototype. * decl.c (duplicate_decls): Use COPY_DECL_RTL. (builtin_function_1): Don't call make_decl_rtl. (build_cp_library_fn): Don't call set_mangled_name_for_decl. (grokvardecl): Don't call mangle_decl. * except.c (nothrow_libfn_p): Look at DECL_NAME, not DECL_ASSEMBLER_NAME. * method.c (set_mangled_name_for_decl): Delete. * name-lookup.c (pushdecl): When a local extern shadows a file-scope declaration of the same object, give both DECLs the same DECL_UID. * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE on DECL_ASSEMBLER_NAME. testsuite: * g++.dg/expr/enum1.C, g++.dg/opt/const3.C: Declare abort with extern "C". * g++.dg/other/pragma-re-1.C: Add comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83405 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/other')
-rw-r--r--gcc/testsuite/g++.dg/other/pragma-re-1.C3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/pragma-re-1.C b/gcc/testsuite/g++.dg/other/pragma-re-1.C
index ec567f93460..b29ac99ba4e 100644
--- a/gcc/testsuite/g++.dg/other/pragma-re-1.C
+++ b/gcc/testsuite/g++.dg/other/pragma-re-1.C
@@ -8,10 +8,13 @@
#error
#endif
+/* This one is expected to work. */
#pragma redefine_extname foo bar
extern "C" int foo(void);
void *p = (void *)foo;
+/* This one is expected not to work (redefine_extname
+ can only be applied to extern "C" names). */
#pragma redefine_extname baz baq
extern int baz(void);
void *q = (void *)baz;