Bugzilla – Bug 1374
[LLVM] error: variable length array of non-POD element type 'Ptr<ns3::UeNetDevice>'
Last modified: 2012-03-12 10:52:59 UTC
../src/lte/examples/lte-multiple-flows.cc:69:22: error: variable length array of non-POD element type 'Ptr<ns3::UeNetDevice>' Ptr<UeNetDevice> ue[nbUE]; ^ 1 error generated.
diff -r 383bd9261cb9 src/lte/examples/lte-multiple-flows.cc --- a/src/lte/examples/lte-multiple-flows.cc Tue Feb 21 11:47:25 2012 +0000 +++ b/src/lte/examples/lte-multiple-flows.cc Wed Feb 22 13:36:12 2012 +0000 @@ -66,7 +66,7 @@ Ptr<EnbNetDevice> enb; enb = enbDevs.Get (0)->GetObject<EnbNetDevice> (); - Ptr<UeNetDevice> ue[nbUE]; + std::vector< Ptr<UeNetDevice> >ue (nbUE); for (int i = 0; i < nbUE; i++) { ue[i] = ueDevs.Get (i)->GetObject<UeNetDevice> ();
Also this fixes unit tests problems with clang (basically just add parenthesis to around the NS_TEST_ASSERT_MSG_EQ first arg. diff -r 383bd9261cb9 src/lte/test/lte-propagation-loss-model-test.cc --- a/src/lte/test/lte-propagation-loss-model-test.cc Tue Feb 21 11:47:25 2012 +0000 +++ b/src/lte/test/lte-propagation-loss-model-test.cc Wed Feb 22 13:46:27 2012 +0000 @@ -170,8 +170,8 @@ int nbOfValues = tx.size (); for (int i = 0; i < nbOfValues; i++) { - NS_TEST_ASSERT_MSG_EQ (tx.at (i) == 0 && rx.at (i) != 0, false, "Problem with elements of tx and rx."); - NS_TEST_ASSERT_MSG_EQ (tx.at (i) != 0 && (tx.at (i) <= rx.at (i)), false, "Problem with elements of tx and rx."); + NS_TEST_ASSERT_MSG_EQ ((tx.at (i) == 0 && rx.at (i) != 0), false, "Problem with elements of tx and rx."); + NS_TEST_ASSERT_MSG_EQ ((tx.at (i) != 0 && (tx.at (i) <= rx.at (i))), false, "Problem with elements of tx and rx."); }
The proposed patch worked for me also.
fixed in changeset: 7761:db874b5c35f7