Remove [[ noreturn ]], MSVC14 doesn't yet support attributes?

This commit is contained in:
Jason Turner 2015-01-15 15:15:02 -07:00
parent f95ca75aca
commit 759d6fc42f
5 changed files with 12 additions and 12 deletions

View File

@ -155,7 +155,7 @@ else()
add_definitions(-Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wcast-qual -Woverloaded-virtual -pedantic ${CPP11_FLAG})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions(-Weverything -Wno-c++98-compat -Wno-documentation -Wno-switch-enum -Wno-weak-vtables -Wno-sign-conversion -Wno-missing-prototypes -Wno-padded)
add_definitions(-Weverything -Wno-c++98-compat -Wno-documentation -Wno-switch-enum -Wno-weak-vtables -Wno-sign-conversion -Wno-missing-prototypes -Wno-padded -Wno-missing-noreturn)
else()
add_definitions(-Wnoexcept)
endif()

View File

@ -298,7 +298,7 @@ namespace chaiscript
}
}
static void throw_exception [[ noreturn ]] (const Boxed_Value &bv) {
static void throw_exception(const Boxed_Value &bv) {
throw bv;
}

View File

@ -8,7 +8,10 @@
#include <list>
#include <regex>
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <chaiscript/chaiscript.hpp>
#include <chaiscript/chaiscript_stdlib.hpp>
@ -154,10 +157,6 @@ void help(int n) {
}
}
void version(int){
std::cout << "chai: compiled " << __TIME__ << " " << __DATE__ << std::endl;
}
std::string helloWorld(const std::string &t_name)
{
return "Hello " + t_name + "!";
@ -297,7 +296,6 @@ int main(int argc, char *argv[])
chai.add(chaiscript::fun(&myexit), "exit");
chai.add(chaiscript::fun(&myexit), "quit");
chai.add(chaiscript::fun(&help), "help");
chai.add(chaiscript::fun(&version), "version");
chai.add(chaiscript::fun(&throws_exception), "throws_exception");
chai.add(chaiscript::fun(&get_eval_error), "get_eval_error");
@ -356,7 +354,7 @@ int main(int argc, char *argv[])
}
}
else if (arg == "-v" || arg == "--version") {
arg = "version(0)";
arg = "version()";
}
else if (arg == "-h" || arg == "--help") {
arg = "help(-1)";
@ -388,7 +386,7 @@ int main(int argc, char *argv[])
printf("**ChaiScript::time= %.10f\n", elapsed_secs1);
break;
}
default: std::cout << "Unrecognized execution mode" << std::endl; return EXIT_FAILURE;
}
}
catch (const chaiscript::exception::eval_error &ee) {

View File

@ -8,6 +8,8 @@ class BaseClass
{
}
BaseClass(const BaseClass &) = default;
virtual ~BaseClass() {}
virtual std::string doSomething(float, double) const = 0;

View File

@ -213,11 +213,11 @@ std::string get_next_command() {
// We have to wrap exit with our own because Clang has a hard time with
// function pointers to functions with special attributes (system exit being marked NORETURN)
void myexit [[ noreturn ]] (int return_val) {
void myexit(int return_val) {
exit(return_val);
}
void interactive [[ noreturn ]] (chaiscript::ChaiScript& chai)
void interactive(chaiscript::ChaiScript& chai)
{
using_history();
@ -331,8 +331,8 @@ int main(int argc, char *argv[])
try {
switch ( mode ) {
case eInteractive:
// interactive never returns, no need for break;
interactive(chai);
break;
case eCommand:
val = chai.eval(arg);
break;