This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Fixed regressions with "Patch: Remove input_file_stack"
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: tromey at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Sun, 2 Mar 2008 15:02:23 +0100
- Subject: Fixed regressions with "Patch: Remove input_file_stack"
> From: Tom Tromey <tromey@redhat.com>
> Date: Wed, 27 Feb 2008 18:43:35 -0700
> Now that we only have mapped locations, there is no point to having
> input_file_stack and friends -- the information provided by this is
> included in a location_t.
>
> This patch removes input_file_stack and related variables and
> functions.
>
> I don't think there is any more fallout from mapped locations, but if
> you know of something, let me know.
> 2008-02-27 Tom Tromey <tromey@redhat.com>
>
> * toplev.c (input_file_stack, input_file_stack_tick, fs_p,
> input_file_stack_history, input_file_stack_restored): Remove.
> (push_srcloc, pop_srcloc, restore_input_file_stack): Likewise.
> * input.h (struct file_stack): Remove.
> (push_srcloc, pop_srcloc, restore_input_file_stack): Likewise.
> (input_file_stack, input_file_stack_tick, INPUT_FILE_STACK_BITS):
> Likewise.
> * diagnostic.h (struct diagnostic_context) <last_module>: Change
> type.
> (diagnostic_last_module_changed): Add 'map' argument.
> (diagnostic_set_last_function): Likewise.
> * diagnostic.c (undiagnostic_report_current_module): Iterate using
> line map, not input_file_stack.
> * c-lex.c (fe_file_change): Don't use push_srcloc or pop_srcloc.
>
> cp/ChangeLog:
> 2008-02-27 Tom Tromey <tromey@redhat.com>
>
> * parser.c (struct cp_token) <input_file_stack_index>: Remove.
> (cp_lexer_get_preprocessor_token): Update.
> (cp_lexer_set_source_position_from_token): Don't call
> restore_input_file_stack.
> * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
I'm a bit surprised your testing didn't show these fallout
regressions (for cris-elf, but I see from gcc-testresults@ the
same new FAILs, your patch being the only suspect in the range
132770:132776):
Running /tmp/hpautotest-gcc1/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp ...
FAIL: 20_util/shared_ptr/assign/shared_ptr_neg.cc (test for excess errors)
...
FAIL: tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc (test for excess errors)
due to (e.g.):
Excess errors:
In file included from x/gccobj/cris-elf/libstdc++-v3/include/memory:88,
from x/gcc/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc:24:
That is, where it used to just say:
x/cris-elf/gccobj/cris-elf/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h: In member function 'std::__shared_ptr<_Tp, _Lp>& std::__shared_ptr<_Tp, _Lp>::operator=(const std::__shared_ptr<_Tp1, _Lp>&) [with _Tp1 = B, _Tp = A, __gnu_cxx::_Lock_policy _Lp = _S_single]':
x/cris-elf/gccobj/cris-elf/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h:887: instantiated from 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp1>&) [with _Tp1 = B, _Tp = A]'
x/gcc/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc:40: instantiated from here
x/cris-elf/gccobj/cris-elf/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h:399: error: cannot convert 'B* const' to 'A*' in assignment
it now says:
In file included from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/memory:88,
from /tmp/hpautotest-gcc1/gcc/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc:24:
x/cris-elf/gccobj/cris-elf/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h: In member function 'std::__shared_ptr<_Tp, _Lp>& std::__shared_ptr<_Tp, _Lp>::operator=(const std::__shared_ptr<_Tp1, _Lp>&) [with _Tp1 = B, _Tp = A, __gnu_cxx::_Lock_policy _Lp = _S_single]':
x/cris-elf/gccobj/cris-elf/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h:887: instantiated from 'std::shared_ptr<_Tp>& std::shared_ptr<_Tp>::operator=(const std::shared_ptr<_Tp1>&) [with _Tp1 = B, _Tp = A]'
x/gcc/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc:40: instantiated from here
x/cris-elf/gccobj/cris-elf/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h:399: error: cannot convert 'B* const' to 'A*' in assignment
I committed the following as obvious. This exact construct was
in other libstdc++ tests.
libstdc++-v3:
* testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc,
testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc:
Mark changed error message prelude, adding "in file included from",
using dg-excess-errors.
Index: testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc
===================================================================
--- testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc (revision 132814)
+++ testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc (working copy)
@@ -1,6 +1,6 @@
// { dg-do compile }
-// Copyright (C) 2005 Free Software Foundation
+// Copyright (C) 2005, 2008 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -20,7 +20,7 @@
// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
-#include <tr1/memory>
+#include <tr1/memory> // { dg-excess-errors "In file included from" }
#include <testsuite_hooks.h>
struct A { };
Index: testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc
===================================================================
--- testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc (revision 132814)
+++ testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc (working copy)
@@ -1,7 +1,7 @@
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -21,7 +21,7 @@
// 20.6.6.2 Template class shared_ptr [util.smartptr.shared]
-#include <memory>
+#include <memory> // { dg-excess-errors "In file included from" }
#include <testsuite_hooks.h>
struct A { };