13

I've downloaded and built clang version 3.0 in order to play around a bit with C++11 features, however I get this error (even though I am using the -Wc++11-extensions flag).

S:\llvm\code>clang++.exe -Wc++11-extensions variadic.cpp
variadic.cpp:4:19: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template <typename... Args>

I've built clang with VS10 on Windows 7 (64bit) and the build passed successfully.


Edit: As @cli_hlt pointed out this is a warning not an error, the error is something I did not paste unable to execute command: program not executable. The root cause for that was that link.exe was not in the PATH. Once I ran from a VS command prompt all was well.

R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
Motti
  • 110,860
  • 49
  • 189
  • 262
  • 25
    I assume you originally did `clang++ variadic.cpp`, saw the warning and added the warning flag expecting the warning to go away. `-Wc++11-extensions` is on by default when compiling in C++03 mode (the default mode), so that's why you saw it. You can turn it off using `-Wno-c++11-extensions`, however it's probably better to just compile in C++11 mode using `-std=c++11` – bames53 Oct 24 '11 at 18:53
  • @bames53 thanks that's exactly what happened. – Motti Oct 24 '11 at 19:48

1 Answers1

20

You are getting a warning, not an error.

The -W switch is used to enable compiler warnings. So for my understanding, by using -Wc++11-extensions you tell the compiler to warn you if you are using C++11 extensions.

And thats exactly what happens here.

cli_hlt
  • 7,072
  • 2
  • 26
  • 22
  • 2
    Right you are I'm an idiot. The warnings are followed by error "unable to execute command: program not executable" but this happens even for `int main() { }`. My bad.. – Motti Oct 24 '11 at 12:06