Bug 1123527 - Initialized some locals in TestNoArithmeticExprInArgument.cpp. r=ehsan.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 15 Jan 2015 22:16:38 -0800
changeset 224845 34fe493c58066b6e0087e0af38713dd1119ca63a
parent 224844 fa7dbc827709ea19e84d714bc783113daec21946
child 224846 7da2cd7a1125f225d4246bdff67d76557c40a7d0
push id28146
push usercbook@mozilla.com
push dateWed, 21 Jan 2015 13:22:59 +0000
treeherdermozilla-central@0f2b4a7a9daf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1123527
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1123527 - Initialized some locals in TestNoArithmeticExprInArgument.cpp. r=ehsan. I think these undefined variables don't matter because it's a static analysis input, but defining them does stop cppcheck from complaining.
build/clang-plugin/tests/TestNoArithmeticExprInArgument.cpp
--- a/build/clang-plugin/tests/TestNoArithmeticExprInArgument.cpp
+++ b/build/clang-plugin/tests/TestNoArithmeticExprInArgument.cpp
@@ -5,19 +5,19 @@ struct X {
   void baz(int) MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT;
 };
 
 int operator+(int, X);
 int operator+(X, int);
 int operator++(X);
 
 void badArithmeticsInArgs() {
-  int a;
+  int a = 1;
   typedef int myint;
-  myint b;
+  myint b = 2;
   X goodObj1(a);
   goodObj1.baz(b);
   X badObj1(a + b); // expected-error{{cannot pass an arithmetic expression of built-in types to 'X'}}
   X badObj2 = X(a ? 0 : ++a); // expected-error{{cannot pass an arithmetic expression of built-in types to 'X'}}
   X badObj3(~a); // expected-error{{cannot pass an arithmetic expression of built-in types to 'X'}}
   badObj1.baz(a - 1 - b); // expected-error{{cannot pass an arithmetic expression of built-in types to 'baz'}}
   badObj1.baz(++a); // expected-error{{cannot pass an arithmetic expression of built-in types to 'baz'}}
   badObj1.baz(a++); // expected-error{{cannot pass an arithmetic expression of built-in types to 'baz'}}