]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] introduce a temporary variable to work around some build failure
authorJINMEI Tatuya <jinmei@isc.org>
Fri, 11 Jan 2013 18:51:29 +0000 (10:51 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Fri, 11 Jan 2013 18:51:29 +0000 (10:51 -0800)
some compilers seem to be confused if we directly call a method
on the result of dynamic_cast.  I suspect it's a bug of the compiler in
template handling, but the workaround doesn't look so messy and I think
it's acceptable.

committing at my discretion.

src/lib/datasrc/tests/database_unittest.cc

index 06b3874008ad5433071f2c1d06de565f6af5414f..3a97cb522a385c362822807cede36f659d22c352 100644 (file)
@@ -1322,8 +1322,11 @@ public:
     // Mock-only; control whether to allow subsequent transaction.
     void allowMoreTransaction(bool is_allowed) {
         if (is_mock_) {
-            dynamic_cast<MockAccessor&>(*current_accessor_).
-                allowMoreTransaction(is_allowed);
+            // Use a separate variable for MockAccessor&; some compilers
+            // would be confused otherwise.
+            MockAccessor& mock_accessor =
+                dynamic_cast<MockAccessor&>(*current_accessor_);
+            mock_accessor.allowMoreTransaction(is_allowed);
         }
     }