]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Try to reproduce GCC tester error with ambiguous constructor
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 7 Apr 2019 19:47:27 +0000 (21:47 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 7 Apr 2019 19:54:57 +0000 (21:54 +0200)
tests/algorithms/general_data_storage_01.cc
tests/algorithms/general_data_storage_01.debug.output
tests/algorithms/general_data_storage_01.debug.output.2
tests/algorithms/general_data_storage_01.release.output

index fc421e7895af30a26496da001adeb58a214c5c13..5721492f80b3fb15adfab0bd6cb69cbb075738bb 100644 (file)
@@ -138,6 +138,29 @@ main()
     deallog << "Size: " << data.size() << std::endl;
   }
 
+  deallog << "Ambiguous construction" << std::endl;
+  {
+    // Pass Arguments by lvalue reference
+    {
+      const double  val_1 = 1.0;
+      const double &val_2 =
+        data.get_or_add_object_with_name<double>("value", val_1);
+    }
+
+    // Pass Arguments by rvalue reference
+    {
+      double        val_1 = 1.0;
+      const double &val_2 =
+        data.get_or_add_object_with_name<double>("value", std::move(val_1));
+    }
+
+    // Pass Arguments ambiguously
+    {
+      const double &val_2 =
+        data.get_or_add_object_with_name<double>("value", 1.0);
+    }
+  }
+
 
   deal_II_exceptions::disable_abort_on_exception();
 
index 4583c5e2160f7a40b944e22d03dd4069f2cb6e1d..0c9a8b99b98c589b5e59fbdd5d1b1f5d91681dda 100644 (file)
@@ -17,6 +17,7 @@ DEAL::Data post-merge:
 DEAL::value            double
 DEAL::value_2          double
 DEAL::Size: 2
+DEAL::Ambiguous construction
 DEAL::Try to overwrite existing entry: Copy
 DEAL::
 --------------------------------------------------------
index 50b2af1bbd66b6f3c569d9a7ace502f28e0e209e..f44444ad4eaccb2e1de6f0736f7833c3a3c93020 100644 (file)
@@ -17,6 +17,7 @@ DEAL::Data post-merge:
 DEAL::value            double
 DEAL::value_2          double
 DEAL::Size: 2
+DEAL::Ambiguous construction
 DEAL::Try to overwrite existing entry: Copy
 DEAL::
 --------------------------------------------------------
index b10d09135f905a7188cdcebb7ed2b2ef48144f28..9384e0f746b8281fbebf71f6387f18d50d6f1456 100644 (file)
@@ -17,6 +17,7 @@ DEAL::Data post-merge:
 DEAL::value            double
 DEAL::value_2          double
 DEAL::Size: 2
+DEAL::Ambiguous construction
 DEAL::Try to overwrite existing entry: Copy
 DEAL::Try to overwrite existing entry: Reference
 DEAL::Fetch non-existing entry

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.