User account creation filtered due to spam.

Bug 33506 - [4.2 Regression] TYPE_RAISES_EXCEPTIONS dumped with attributes
Summary: [4.2 Regression] TYPE_RAISES_EXCEPTIONS dumped with attributes
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.1
: P1 major
Target Milestone: 4.3.0
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords:
Depends on: 25095
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-19 23:17 UTC by Jakub Jelinek
Modified: 2009-12-13 16:52 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.0
Known to fail: 4.2.0 4.2.5
Last reconfirmed: 2007-09-20 00:08:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2007-09-19 23:17:46 UTC
extern int foo (char *) __attribute__ ((warn_unused_result));
extern int bar (char *) throw () __attribute__ ((warn_unused_result));
extern int bar (char *) throw ();

fails to compile with 4.2/4.3 (instead of warn_unused_result
any other attribute that has type_required set can be used, like nonnull,
regparm, ...).  The problem is that attribs will modify the type
using build_type_attribute_variant, which, being a middle-end rather than FE
function, doesn't know about TYPE_RAISES_EXCEPTIONS.
Comment 1 Jakub Jelinek 2007-09-24 15:16:36 UTC
Subject: Bug 33506

Author: jakub
Date: Mon Sep 24 15:16:23 2007
New Revision: 128718

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128718
Log:
	PR c++/33506
	* langhooks.h (struct lang_hooks_for_types): Add type_hash_eq
	field.
	* langhooks-def.h (LANG_HOOKS_TYPE_HASH_EQ): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_TYPE_HASH_EQ.
	* tree.c (type_hash_eq): For FUNCTION_TYPE use
	lang_hooks.type.type_hash_eq in addition to generic tests.

	* cp-tree.h (cxx_type_hash_eq): New prototype.
	* cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
	* tree.c (cxx_type_hash_eq): New function.

	* g++.dg/ext/attrib29.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/attrib29.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-objcp-common.h
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/tree.c
    trunk/gcc/langhooks-def.h
    trunk/gcc/langhooks.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c

Comment 2 Jakub Jelinek 2007-09-27 09:20:14 UTC
Fixed on the trunk.
Comment 3 Mark Mitchell 2007-10-09 19:20:51 UTC
Change target milestone to 4.2.3, as 4.2.2 has been released.
Comment 4 Joseph S. Myers 2008-02-01 16:54:47 UTC
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Comment 5 Joseph S. Myers 2008-05-19 20:23:25 UTC
4.2.4 is being released, changing milestones to 4.2.5.
Comment 6 Joseph S. Myers 2009-03-30 22:25:27 UTC
Closing 4.2 branch, fixed in 4.3.