Browse Source

[master] introduce a temporary variable to work around some build failure

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.
JINMEI Tatuya 12 years ago
parent
commit
30e71e8bfd
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/lib/datasrc/tests/database_unittest.cc

+ 5 - 2
src/lib/datasrc/tests/database_unittest.cc

@@ -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);
         }
     }