]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cgraphunit.c (analyze_functions): Save input_location, set it to UNKNOWN_LOCATION...
authorJan Hubicka <jh@suse.cz>
Tue, 10 Sep 2013 13:04:36 +0000 (15:04 +0200)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 10 Sep 2013 13:04:36 +0000 (13:04 +0000)
2013-09-10  Jan Hubicka  <jh@suse.cz>
    Paolo Carlini  <paolo.carlini@oracle.com>

* cgraphunit.c (analyze_functions): Save input_location, set it
to UNKNOWN_LOCATION and restore it at the end.

/cp
2013-09-10  Jan Hubicka  <jh@suse.cz>
    Paolo Carlini  <paolo.carlini@oracle.com>

* error.c (print_instantiation_partial_context_line): If
loc == UNKNOWN_LOCATION return immediately.

/testsuite
2013-09-10  Jan Hubicka  <jh@suse.cz>
    Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/template/cond2.C: Tweak, do not expect a "required from".

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r202445

gcc/ChangeLog
gcc/cgraphunit.c
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/cond2.C

index 7a2bd31a8cb69abf12b97187184191caf74a35a3..b07980abe02a3efcab55bb3a78926cfa6f816ba7 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-10  Jan Hubicka  <jh@suse.cz>
+           Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * cgraphunit.c (analyze_functions): Save input_location, set it
+       to UNKNOWN_LOCATION and restore it at the end.
+
 2013-09-10  Martin Jambor  <mjambor@suse.cz>
 
        * ipa-cp.c (propagate_constants_topo): Do not ignore SCC
index 9681df518cda018b23c141b473035e511850ccfc..092c74a718489c8583dc4293391767b75986da2b 100644 (file)
@@ -916,9 +916,11 @@ analyze_functions (void)
   int i;
   struct ipa_ref *ref;
   bool changed = true;
+  location_t saved_loc = input_location;
 
   bitmap_obstack_initialize (NULL);
   cgraph_state = CGRAPH_STATE_CONSTRUCTION;
+  input_location = UNKNOWN_LOCATION;
 
   /* Ugly, but the fixup can not happen at a time same body alias is created;
      C++ FE is confused about the COMDAT groups being right.  */
@@ -1099,6 +1101,8 @@ analyze_functions (void)
      used by it.  */
   if (!seen_error ())
     symtab_initialize_asm_name_hash ();
+
+  input_location = saved_loc;
 }
 
 /* Translate the ugly representation of aliases as alias pairs into nice
index cca0229dc0a1a37ea38606f37d3a55a1a5349a3e..6d32109fff51ab762f75a3e6f45ff9dfe40cf6d4 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-10  Jan Hubicka  <jh@suse.cz>
+           Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * error.c (print_instantiation_partial_context_line): If
+       loc == UNKNOWN_LOCATION return immediately.
+
 2013-09-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/58325
index 02ec6c7608f7bce7626d85632e46c24a4726d2d8..62e39d3bcbf4cdaee77f2daf562afd2268acb38b 100644 (file)
@@ -3200,8 +3200,10 @@ print_instantiation_partial_context_line (diagnostic_context *context,
                                          const struct tinst_level *t,
                                          location_t loc, bool recursive_p)
 {
-  expanded_location xloc;
-  xloc = expand_location (loc);
+  if (loc == UNKNOWN_LOCATION)
+    return;
+
+  expanded_location xloc = expand_location (loc);
 
   if (context->show_column)
     pp_verbatim (context->printer, _("%r%s:%d:%d:%R   "),
index 1e5f483d20ada3fcb5e2b7a837613d1e84eb673f..8d58e2d83f430d1e9612467793e1a543b0053ad2 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-10  Jan Hubicka  <jh@suse.cz>
+           Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * g++.dg/template/cond2.C: Tweak, do not expect a "required from".
+
 2013-09-10  Jeff Law  <law@redhat.com>
 
        * gcc.c-torture/compile/pr58343.c: New test.
index fad86bebe5105e056ef960862da6d337cc529469..e6bd19d40fa85a33d2cb458a0ed72639a6f47acf 100644 (file)
@@ -6,5 +6,5 @@ template<int X> class c;
 template<int X, int Y> int test(c<X ? : Y>&); // { dg-error "omitted" }
 
 void test(c<2>*c2) {
-       test<0, 2>(*c2); // { dg-message "required" }
+       test<0, 2>(*c2);
 }