forked from OSchip/llvm-project
[Axccel] Remove -Wno-missing-braces in build
Summary: I originally added the -Wno-missing-braces flag because I thought it was erroneously flagging std::array initializations. Now I realize the extra braces really are desired for these initializations, so I'm turning the warning flag back on. Reviewers: jlebar Subscribers: mgorny, parallel_libs-commits Differential Revision: https://reviews.llvm.org/D27941 llvm-svn: 290137
This commit is contained in:
parent
5967c97323
commit
492c5a1674
|
@ -35,7 +35,7 @@ set(CMAKE_CXX_STANDARD 11)
|
|||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Add warning flags.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-braces")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
|
||||
|
||||
add_library(
|
||||
acxxel
|
||||
|
|
|
@ -57,9 +57,9 @@ void saxpy(float A, std::array<float, N> &X, const std::array<float, N> &Y) {
|
|||
|
||||
int main() {
|
||||
float A = 2.f;
|
||||
std::array<float, 3> X = {0.f, 1.f, 2.f};
|
||||
std::array<float, 3> Y = {3.f, 4.f, 5.f};
|
||||
std::array<float, 3> Expected = {3.f, 6.f, 9.f};
|
||||
std::array<float, 3> X{{0.f, 1.f, 2.f}};
|
||||
std::array<float, 3> Y{{3.f, 4.f, 5.f}};
|
||||
std::array<float, 3> Expected{{3.f, 6.f, 9.f}};
|
||||
saxpy(A, X, Y);
|
||||
for (int I = 0; I < 3; ++I)
|
||||
if (X[I] != Expected[I]) {
|
||||
|
|
|
@ -79,12 +79,12 @@ TEST(Span, ArrayConstruction) {
|
|||
}
|
||||
|
||||
TEST(Span, StdArrayConstruction) {
|
||||
std::array<int, 3> Array{0, 1, 2};
|
||||
std::array<int, 3> Array{{0, 1, 2}};
|
||||
acxxel::Span<int> Span(Array);
|
||||
EXPECT_EQ(Span.data(), Array.data());
|
||||
EXPECT_EQ(static_cast<size_t>(Span.size()), Array.size());
|
||||
|
||||
std::array<const int, 3> ConstArray{0, 1, 2};
|
||||
std::array<const int, 3> ConstArray{{0, 1, 2}};
|
||||
acxxel::Span<const int> ConstSpan(ConstArray);
|
||||
EXPECT_EQ(ConstSpan.data(), ConstArray.data());
|
||||
EXPECT_EQ(static_cast<size_t>(ConstSpan.size()), ConstArray.size());
|
||||
|
|
Loading…
Reference in New Issue