Преглед на файлове

Fix compiler warning about the use of '$' in a variable name.

Sam Jaffe преди 5 години
родител
ревизия
6fd701d9d2
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      include/expect/expect.hpp
  2. 1 1
      test/expect_test.cxx

+ 2 - 2
include/expect/expect.hpp

@@ -190,5 +190,5 @@ namespace contract {
 }
 
 #define contract_postconditions(type) \
-  contract::postcondition_helper<type> $return
-#define contract_return( ... ) return ($return = __VA_ARGS__)
+  contract::postcondition_helper<type> _return
+#define contract_return( ... ) return (_return = __VA_ARGS__)

+ 1 - 1
test/expect_test.cxx

@@ -81,7 +81,7 @@ TEST(EnsureTest, ThrowsIfFailed) {
 TEST(EnsureTest, CanBeMadeToCaptureRval) {
   auto function = [](std::string const & expected) -> std::string {
     contract_postconditions(std::string);
-    ensures($return == expected);
+    ensures(_return == expected);
     contract_return("this is a string");
   };
   EXPECT_THROW(function("hello world!"), std::runtime_error);