From: Jean-Paul Pelteret Date: Sun, 7 Apr 2019 19:47:27 +0000 (+0200) Subject: Try to reproduce GCC tester error with ambiguous constructor X-Git-Tag: v9.1.0-rc1~213^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d1e3d8af4c25588c430fcddfeb2608747053614;p=dealii.git Try to reproduce GCC tester error with ambiguous constructor --- diff --git a/tests/algorithms/general_data_storage_01.cc b/tests/algorithms/general_data_storage_01.cc index fc421e7895..5721492f80 100644 --- a/tests/algorithms/general_data_storage_01.cc +++ b/tests/algorithms/general_data_storage_01.cc @@ -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("value", val_1); + } + + // Pass Arguments by rvalue reference + { + double val_1 = 1.0; + const double &val_2 = + data.get_or_add_object_with_name("value", std::move(val_1)); + } + + // Pass Arguments ambiguously + { + const double &val_2 = + data.get_or_add_object_with_name("value", 1.0); + } + } + deal_II_exceptions::disable_abort_on_exception(); diff --git a/tests/algorithms/general_data_storage_01.debug.output b/tests/algorithms/general_data_storage_01.debug.output index 4583c5e216..0c9a8b99b9 100644 --- a/tests/algorithms/general_data_storage_01.debug.output +++ b/tests/algorithms/general_data_storage_01.debug.output @@ -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:: -------------------------------------------------------- diff --git a/tests/algorithms/general_data_storage_01.debug.output.2 b/tests/algorithms/general_data_storage_01.debug.output.2 index 50b2af1bbd..f44444ad4e 100644 --- a/tests/algorithms/general_data_storage_01.debug.output.2 +++ b/tests/algorithms/general_data_storage_01.debug.output.2 @@ -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:: -------------------------------------------------------- diff --git a/tests/algorithms/general_data_storage_01.release.output b/tests/algorithms/general_data_storage_01.release.output index b10d09135f..9384e0f746 100644 --- a/tests/algorithms/general_data_storage_01.release.output +++ b/tests/algorithms/general_data_storage_01.release.output @@ -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