]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not assign to a temporary. 14899/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Mar 2023 04:02:51 +0000 (22:02 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Mar 2023 04:02:51 +0000 (22:02 -0600)
tests/base/scalar_01.cc

index 1b51831b338b7b1d1beb100420df6093d703d79c..3ce1b772e4035c8976f8449d5c14611e55089980 100644 (file)
@@ -47,7 +47,11 @@ main()
   compare(static_cast<double>(t1), 13.);
   compare(static_cast<double &>(t1), 13.);
   compare((T() = t1), 13.);
-  compare((T() = 13.), 13.);
+  {
+    T t;
+    t = 13.;
+    compare(t, 13.);
+  }
   compare((t1 == t1), true);
   compare((t1 == t2), false);
   compare((t1 != t2), true);

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.