The following issues were found

caffe2/python/pybind_state_gpu.cc
1 issues
syntax error
Error

Line: 165

                        });
}

PYBIND11_MODULE(caffe2_pybind11_state_gpu, m) {
  m.doc() = "pybind11 stateful interface to Caffe2 workspaces - GPU edition";

  addGlobalMethods(m);
  addCUDAGlobalMethods(m);
  addObjectMethods(m);

            

Reported by Cppcheck.

caffe2/python/pybind_state.cc
1 issues
syntax error
Error

Line: 1970

                initialize();
};

PYBIND11_MODULE(caffe2_pybind11_state, m) {
  m.doc() = "pybind11 stateful interface to Caffe2 workspaces";

  C10_LOG_API_USAGE_ONCE("caffe2.python.import");

  addGlobalMethods(m);

            

Reported by Cppcheck.

test/cpp/jit/test_cs_debug_info_serialization.cpp
1 issues
syntax error
Error

Line: 83

                return true;
}

TEST(CSDebugInfoSerializaitionTest, TwoSubmodules) {
  std::shared_ptr<CompilationUnit> cu = std::make_shared<CompilationUnit>();
  Module a("A", cu);
  a.define(R"JIT(
    def forward(self, x):
      return x + 1

            

Reported by Cppcheck.

test/cpp/jit/test_constant_pooling.cpp
1 issues
syntax error
Error

Line: 31

                    ->run(*graph);
}

TEST(ConstantPoolingTest, PoolingAcrossBlocks) {
  auto graph = std::make_shared<Graph>();
  parseIR(
      R"IR(
graph(%cond : Tensor):
  %a : str = prim::Constant[value="bcd"]()

            

Reported by Cppcheck.

test/cpp/jit/test_concat_opt.cpp
1 issues
syntax error
Error

Line: 43

              
} // namespace

TEST(ConcatOptTest, SimpleCommonInputsEliminationPrefix) {
  auto graph = std::make_shared<Graph>();

  const std::string input =
      R"IR(
        graph(%0: Float(64, 56, 56, strides=[3136, 56, 1], requires_grad=0, device=cpu),

            

Reported by Cppcheck.

test/cpp/jit/test_code_template.cpp
1 issues
syntax error
Error

Line: 36

                int notest(int a)
  )";

TEST(TestCodeTemplate, Copying) {
  TemplateEnv e;
  e.s("hi", "foo");
  e.v("what", {"is", "this"});
  TemplateEnv c(e);
  c.s("hi", "foo2");

            

Reported by Cppcheck.

test/cpp/jit/test_class_type.cpp
1 issues
syntax error
Error

Line: 37

                cls->addAttribute("attr1", IntType::get());
}

TEST(ClassTypeTest, AddRemoveConstant) {
  auto cu = std::make_shared<CompilationUnit>();
  auto cls = ClassType::create("foo.bar", cu);
  cls->addConstant("const1", IValue(1));
  cls->addConstant("const2", IValue(2));
  cls->addConstant("const3", IValue(3));

            

Reported by Cppcheck.

test/cpp/jit/test_class_parser.cpp
1 issues
syntax error
Error

Line: 19

                  an_attribute : Tensor
)JIT";

TEST(ClassParserTest, Basic) {
  Parser p(std::make_shared<Source>(testSource));
  std::vector<Def> definitions;
  std::vector<Resolver> resolvers;

  const auto classDef = ClassDef(p.parseClass());

            

Reported by Cppcheck.

test/cpp/jit/test_class_import.cpp
1 issues
syntax error
Error

Line: 48

                si.loadType(QualifiedName(class_name));
}

TEST(ClassImportTest, Basic) {
  auto cu1 = std::make_shared<CompilationUnit>();
  auto cu2 = std::make_shared<CompilationUnit>();
  std::vector<at::IValue> constantTable;
  // Import different versions of FooTest into two namespaces.
  import_libs(

            

Reported by Cppcheck.

test/cpp/jit/test_autodiff.cpp
1 issues
syntax error
Error

Line: 90

                    fmap(inputs, get_edge));
}

TEST(AutodiffTest, ADFormulas) {
  const auto cast = [](const Variable& v) {
    return static_cast<at::Tensor>(v);
  };

  using VL = variable_list;

            

Reported by Cppcheck.