1

I am trying to compile the following piece of code in Visual Studio 2015 (Community version) but encountering the error shown further down below.

/*****Source Code Start*******/
constexpr char const* GetStatusAsCString(Status compute)
{
    switch (compute)
    {
        case armnn::Status::Success: return "Status::Success";
        case armnn::Status::Failure: return "Status::Failure";
        default:                     return "Unknown";
    }
}
/*****Source Code End*******/

Error message:

> Error (active)        a constexpr function must contain exactly one return
> statement ArmNN_MnistTF_64b   c:\armnn\armnn-devenv\armnn\include\armnn\TypesUtils.hpp    22

Note that i have made sure of the following settings:

  1. Set the compiler front end as Clang in VS 2015:

  1. I have set the C++ standard as C++14.

Can anyone please advise me on what else am I missing? Been struggling with this error for sometime now.

1
  • I suppose that Visual Studio 2015 doesn't completely support C++14 Commented Jul 20, 2018 at 18:32

1 Answer 1

2

Visual Studio 2015 does not fully implement C++14 even as of VS 2015 Update 3 although it has a lot of it.

Specifically, N3652 Extended constexpr is not implemented until VS 2017. You should upgrade to the latest VS 2017 Community edition update (which at this point is 15.7)

See Visual C++ Language Conformance

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.