Blame SOURCES/gcc48-pr60046.patch

67287f
2014-02-19  Jason Merrill  <jason@redhat.com>
67287f
67287f
	PR c++/60046
67287f
	* pt.c (maybe_instantiate_noexcept): Don't instantiate exception
67287f
	spec from template context.
67287f
67287f
--- gcc/cp/pt.c	(revision 207920)
67287f
+++ gcc/cp/pt.c	(revision 207921)
67287f
@@ -18567,6 +18567,10 @@ maybe_instantiate_noexcept (tree fn)
67287f
 {
67287f
   tree fntype, spec, noex, clone;
67287f
 
67287f
+  /* Don't instantiate a noexcept-specification from template context.  */
67287f
+  if (processing_template_decl)
67287f
+    return;
67287f
+
67287f
   if (DECL_CLONED_FUNCTION_P (fn))
67287f
     fn = DECL_CLONED_FUNCTION (fn);
67287f
   fntype = TREE_TYPE (fn);
67287f
--- gcc/testsuite/g++.dg/cpp0x/noexcept22.C	(revision 0)
67287f
+++ gcc/testsuite/g++.dg/cpp0x/noexcept22.C	(revision 207921)
67287f
@@ -0,0 +1,21 @@
67287f
+// PR c++/60046
67287f
+// { dg-require-effective-target c++11 }
67287f
+
67287f
+constexpr bool foo () { return noexcept (true); }
67287f
+template <typename T>
67287f
+struct V
67287f
+{
67287f
+  void bar (V &) noexcept (foo ()) {}
67287f
+};
67287f
+template <typename T>
67287f
+struct W : public V <int>
67287f
+{
67287f
+  void bar (W &x) { V <int>::bar (x); }
67287f
+};
67287f
+
67287f
+int
67287f
+main ()
67287f
+{
67287f
+  W <int> a, b;
67287f
+  a.bar (b);
67287f
+}