PR c++/30500
* pt.c (instantiate_decl): Set in_system_header.
2007-03-26 Paolo Carlini <pcarlini@suse.de>
PR c++/30500
* g++.dg/warn/pragma-system_header1.C: New test.
* g++.dg/warn/pragma-system_header2.C: New test.
* g++.dg/warn/pragma-system_header1.h. New.
* g++.dg/warn/pragma-system_header2.h. New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123238
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-03-26 Paolo Carlini <pcarlini@suse.de>
+
+ PR c++/30500
+ * pt.c (instantiate_decl): Set in_system_header.
+
2007-03-22 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (current_tempalte_parms): Improve documentation.
bool pattern_defined;
int need_push;
location_t saved_loc = input_location;
+ int saved_in_system_header = in_system_header;
bool external_p;
/* This function should only be used to instantiate templates for
mark_definable (d);
input_location = DECL_SOURCE_LOCATION (d);
+ in_system_header = DECL_IN_SYSTEM_HEADER (d);
/* If D is a member of an explicitly instantiated class template,
and no definition is available, treat it like an implicit
out:
input_location = saved_loc;
+ in_system_header = saved_in_system_header;
pop_deferring_access_checks ();
pop_tinst_level ();
--- /dev/null
+// PR c++/30500
+// { dg-options "-Wconversion" }
+
+#include "pragma-system_header1.h"
+
+void f()
+{
+ g<int>();
+ h<int>();
+}
--- /dev/null
+#pragma GCC system_header
+
+template <typename T>
+ int g() { double d = 0.1; return d; }
+
+template <typename T>
+ T h() { double d = 0.1; return d; }
--- /dev/null
+// PR c++/30500
+// { dg-options "-Wconversion" }
+
+#include "pragma-system_header2.h"
+
+void f()
+{
+ g<int>();
+ h<int>();
+}
+
+// { dg-warning "conversion" "" { target *-*-* } 2 }
+// { dg-warning "conversion" "" { target *-*-* } 5 }
--- /dev/null
+template <typename T>
+ int g() { double d = 0.1; return d; }
+
+template <typename T>
+ T h() { double d = 0.1; return d; }