submesh demo fails to build - error: missing braces around initializer

Issue #580 resolved
Johannes Ring created an issue

The wheezy-amd64 buildbot currently fails when building the submesh demo with the following error:

[ 98%] Building CXX object demo/undocumented/submesh/cpp/CMakeFiles/demo_submesh.dir/main.cpp.o
/home/buildbot/buildslave/dolfin-master-full-wheezy-amd64/build/demo/undocumented/submesh/cpp/main.cpp: In function ‘int main()’:
/home/buildbot/buildslave/dolfin-master-full-wheezy-amd64/build/demo/undocumented/submesh/cpp/main.cpp:59:52: error: missing braces around initializer for ‘std::array<double, 2ul>::value_type [2] {aka double [2]}’ [-Werror=missing-braces]
cc1plus: all warnings being treated as errors

This happened after f67801. Adding extra braces fixes the problem:

-    std::array<double, 2> x = {v->x()[0], v->x()[1]};
+    std::array<double, 2> x = {{v->x()[0], v->x()[1]}};

Comments (2)

  1. Log in to comment