Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Zhi_W_
Beginner
355 Views

compiler rejects this code on OS X 10.10 with -std=c++14 option

//  test.cpp
#include <tuple>

int main()
{ 
auto t = std::make_tuple(1, 1.2);
return 0;
}

 

icpc -v

icpc version 15.0.3 (gcc version 5.1.0 compatibility)

OS X 10.10 - If using " icpc -std=c++11 test.cpp ", it's OK. But if using " icpc -std=c++14 test.cpp ", it prompts

error: namespace "std" has no member "make_tuple"

  auto t = std::make_tuple(1, 1.2);

 

I tested this code on a linux machine, and both cases passed. So what could cause this problem on OS X?

0 Kudos
2 Replies
Judith_W_Intel
Employee
355 Views

 

I see this warning (i.e. the c++14 option is not supported in 15.0) before the errors.

 

sptem22-31> icpc -c -std=c++14 t.cpp
icpc: command line warning #10159: invalid argument for option '-std'
t.cpp(6): error #303: explicit type is missing ("int" assumed)
    auto t = std::make_tuple(1, 1.2);
         ^

t.cpp(6): error: namespace "std" has no member "make_tuple"
    auto t = std::make_tuple(1, 1.2);
                  ^

compilation aborted for t.cpp (code 2)
sptem22-32>

Zhi_W_
Beginner
355 Views

 

Well, I didn't get this warning...

And in "icpc -help"

Language
--------

-std=<std>
          enable language support for <std>, as described below
            c99   conforms to ISO/IEC 9899:1999 standard for C programs
            c++11 enables C++11 support for C++ programs
            c++14 enables experimental C++14 support for C++ programs
            c89   conforms to ISO/IEC 9899:1990 standard for C programs
            gnu89 conforms to ISO C90 plus GNU extensions
            gnu99 conforms to ISO C99 plus GNU extensions
            gnu++98 conforms to 1998 ISO C++ standard plus GNU extensions
            gnu++11 conforms to 2011 ISO C++ standard plus GNU extensions

So I assume "c++14" won't be an "invalid argument".

Reply