From 09328f5fe2ab5282e4d453831387d023b68791e0 Mon Sep 17 00:00:00 2001
From: Daniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Date: Thu, 28 Jun 2018 16:08:03 +0200
Subject: [PATCH] Make IdentityMatrix constrcutor explicit

---
 include/deal.II/lac/identity_matrix.h |  2 +-
 tests/lac/identity_matrix_07.cc       | 35 +++++++++++++++++++++++++++
 tests/lac/identity_matrix_07.output   |  9 +++++++
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 tests/lac/identity_matrix_07.cc
 create mode 100644 tests/lac/identity_matrix_07.output

diff --git a/include/deal.II/lac/identity_matrix.h b/include/deal.II/lac/identity_matrix.h
index 0c1bdb85e6..e418b61d7a 100644
--- a/include/deal.II/lac/identity_matrix.h
+++ b/include/deal.II/lac/identity_matrix.h
@@ -85,7 +85,7 @@ public:
   /**
    * Constructor. Creates a identity matrix of size #n.
    */
-  IdentityMatrix(const size_type n);
+  explicit IdentityMatrix(const size_type n);
 
   /**
    * Resize the matrix to be of size #n by #n.
diff --git a/tests/lac/identity_matrix_07.cc b/tests/lac/identity_matrix_07.cc
new file mode 100644
index 0000000000..d4336f84db
--- /dev/null
+++ b/tests/lac/identity_matrix_07.cc
@@ -0,0 +1,35 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Check that clearing a FullMatrix<Number> using a number type convertible to
+// Number is not ambiguous.
+
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/identity_matrix.h>
+#include <deal.II/lac/vector.h>
+
+#include "../tests.h"
+
+int
+main()
+{
+  initlog();
+  FullMatrix<std::complex<double>> matrix1;
+  matrix = 0.;
+
+  deallog << "OK" << std::endl;
+  return 0;
+}
diff --git a/tests/lac/identity_matrix_07.output b/tests/lac/identity_matrix_07.output
new file mode 100644
index 0000000000..29bcfce3a3
--- /dev/null
+++ b/tests/lac/identity_matrix_07.output
@@ -0,0 +1,9 @@
+
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
+DEAL:: 1. 2. 3. 4.
-- 
2.39.5