]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a lonely, forgotten bugtest
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Nov 2012 22:40:10 +0000 (22:40 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Nov 2012 22:40:10 +0000 (22:40 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27302 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_for_compiler_bugs.cmake
deal.II/include/deal.II/base/config.h.in

index 9d7bd356b08a7dd6ed33b7c8008beaf3dea7ffb9..9214f680b9e73234ac9d6b2f97adb796b1d3a526 100644 (file)
@@ -202,6 +202,37 @@ CHECK_CXX_COMPILER_BUG(
   DEAL_II_MEMBER_ARRAY_SPECIALIZATION_BUG
   )
 
+#
+# Many compilers get this wrong (see Section 14.7.3.1, number (4)):
+#
+#   template <int dim> struct T {
+#     static const int i;
+#   };
+#
+#   template <> const int T<1>::i;
+#   template <> const int T<1>::i = 1;
+#
+# First, by Section 14.7.3.14 of the standard, the first template<>
+# line must necessarily be the _declaration_ of a specialization,
+# and the second is then its definition. There is therefore no
+# reason to report a doubly defined variable (Intel ICC 6.0), or
+# to choke on these lines at all (Sun Forte)
+#
+# - Wolfgang Bangerth, Matthias Maier, rewritten 2012
+#
+CHECK_CXX_COMPILER_BUG(
+  "
+  template <int dim> struct T
+  {
+    static const int i;
+  };
+  template <> const int T<1>::i;
+  template <> const int T<1>::i = 1;
+  int main() {return 0;}
+  "
+  DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG
+  )
+
 
 #
 # Some older versions of gcc compile this, despite the 'explicit'
index 571646cc3af4ac01ec040fd864b6b0dd35a2bb19..0bf1afbfb5b88874d15d7005f5e6d7a2eca7e777 100644 (file)
  */
 #cmakedefine DEAL_II_MEMBER_ARRAY_SPECIALIZATION_BUG
 
+/* Defined if the compiler refuses to allow the explicit specialization of
+ * static member variables.
+ */
+#cmakedefine DEAL_II_MEMBER_VAR_SPECIALIZATION_BUG
+
 /* Defined if the compiler does not honor the explicit keyword on template
  * constructors.
  */

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.