aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh.poyarekar@gmail.com>2011-08-23 14:56:48 +0000
committerJason Merrill <jason@gcc.gnu.org>2011-08-23 10:56:48 -0400
commite70e0b60724694c40064580368e5b93aae951842 (patch)
tree0e47c675ab7cee9f6ecfde53d2aa6253c1b0783d /gcc/cp
parentd466b40756ea5ed503f7d5c43bddf9f5cf57b859 (diff)
downloadgcc-e70e0b60724694c40064580368e5b93aae951842.zip
gcc-e70e0b60724694c40064580368e5b93aae951842.tar.gz
gcc-e70e0b60724694c40064580368e5b93aae951842.tar.bz2
re PR c++/50055 ([PATCH] Location information for the throw() specification in a function may be incorrect)
PR c++/50055 * except.c (begin_eh_spec_block): Build EH_SPEC block on the same line as the function. From-SVN: r177990
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/except.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b9e83d4..5ebab87 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-23 Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com>
+
+ PR c++/50055
+ * except.c (begin_eh_spec_block): Build EH_SPEC block on the
+ same line as the function.
+
2011-08-23 Jakub Jelinek <jakub@redhat.com>
PR c++/46862
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 129d2f4..bfc520d 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -527,15 +527,17 @@ tree
begin_eh_spec_block (void)
{
tree r;
+ location_t spec_location = DECL_SOURCE_LOCATION (current_function_decl);
+
/* A noexcept specification (or throw() with -fnothrow-opt) is a
MUST_NOT_THROW_EXPR. */
if (TYPE_NOEXCEPT_P (TREE_TYPE (current_function_decl)))
{
- r = build_stmt (input_location, MUST_NOT_THROW_EXPR, NULL_TREE);
+ r = build_stmt (spec_location, MUST_NOT_THROW_EXPR, NULL_TREE);
TREE_SIDE_EFFECTS (r) = 1;
}
else
- r = build_stmt (input_location, EH_SPEC_BLOCK, NULL_TREE, NULL_TREE);
+ r = build_stmt (spec_location, EH_SPEC_BLOCK, NULL_TREE, NULL_TREE);
add_stmt (r);
TREE_OPERAND (r, 0) = push_stmt_list ();
return r;