Only disable -Wnoexcept-type on gcc >= 7
diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h
index 75d7be4..f00c0f9 100644
--- a/include/pybind11/pybind11.h
+++ b/include/pybind11/pybind11.h
@@ -31,7 +31,9 @@
 #  pragma GCC diagnostic ignored "-Wmissing-field-initializers"
 #  pragma GCC diagnostic ignored "-Wstrict-aliasing"
 #  pragma GCC diagnostic ignored "-Wattributes"
-#  pragma GCC diagnostic ignored "-Wnoexcept-type"
+#  if __GNUC__ >= 7
+#    pragma GCC diagnostic ignored "-Wnoexcept-type"
+#  endif
 #endif
 
 #include "attr.h"