From 738cc36aabb80c8a0abbc22147f39cbe3cb13915 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 7 Oct 2013 20:37:00 +0100 Subject: [PATCH] Rename all C++0x to C++11 and cpp0x to cpp11 --- Doc/Devel/{cpp0x.html => cpp11.html} | 126 +++++++------- Doc/Manual/{Cpp0x.html => CPlusPlus11.html} | 158 +++++++++--------- Doc/Manual/chapters | 2 +- Examples/test-suite/common.mk | 72 ++++---- ...ax.i => cpp11_alternate_function_syntax.i} | 4 +- .../{cpp0x_constexpr.i => cpp11_constexpr.i} | 4 +- .../{cpp0x_decltype.i => cpp11_decltype.i} | 4 +- ...efault_delete.i => cpp11_default_delete.i} | 2 +- ...tors.i => cpp11_delegating_constructors.i} | 2 +- ... => cpp11_explicit_conversion_operators.i} | 4 +- ...ion_objects.i => cpp11_function_objects.i} | 2 +- ...pp0x_hash_tables.i => cpp11_hash_tables.i} | 4 +- ...tors.i => cpp11_inheriting_constructors.i} | 2 +- ...alizer_list.i => cpp11_initializer_list.i} | 4 +- ...tend.i => cpp11_initializer_list_extend.i} | 2 +- ...a_functions.i => cpp11_lambda_functions.i} | 4 +- ...nstant.i => cpp11_null_pointer_constant.i} | 4 +- ...literals.i => cpp11_raw_string_literals.i} | 2 +- .../{cpp0x_result_of.i => cpp11_result_of.i} | 4 +- ...e_reference.i => cpp11_rvalue_reference.i} | 2 +- ...reference2.i => cpp11_rvalue_reference2.i} | 2 +- ...reference3.i => cpp11_rvalue_reference3.i} | 2 +- ..._sizeof_object.i => cpp11_sizeof_object.i} | 4 +- ..._static_assert.i => cpp11_static_assert.i} | 2 +- ....i => cpp11_strongly_typed_enumerations.i} | 10 +- ...ets.i => cpp11_template_double_brackets.i} | 4 +- ...e_explicit.i => cpp11_template_explicit.i} | 4 +- ...e_typedefs.i => cpp11_template_typedefs.i} | 2 +- ...0x_thread_local.i => cpp11_thread_local.i} | 2 +- ...ation.i => cpp11_uniform_initialization.i} | 2 +- ...d_unions.i => cpp11_unrestricted_unions.i} | 2 +- ...iterals.i => cpp11_userdefined_literals.i} | 4 +- ...templates.i => cpp11_variadic_templates.i} | 2 +- ...java => cpp11_lambda_functions_runme.java} | 18 +- ...nme.java => cpp11_thread_local_runme.java} | 34 ++-- .../python/cpp0x_function_objects_runme.py | 12 -- .../cpp0x_initializer_list_extend_runme.py | 4 - .../python/cpp0x_initializer_list_runme.py | 5 - .../cpp0x_null_pointer_constant_runme.py | 15 -- .../python/cpp0x_result_of_runme.py | 3 - ... cpp11_alternate_function_syntax_runme.py} | 4 +- ...ltype_runme.py => cpp11_decltype_runme.py} | 4 +- .../python/cpp11_function_objects_runme.py | 12 ++ .../cpp11_initializer_list_extend_runme.py | 4 + .../python/cpp11_initializer_list_runme.py | 5 + .../cpp11_null_pointer_constant_runme.py | 15 ++ ....py => cpp11_raw_string_literals_runme.py} | 2 +- .../python/cpp11_result_of_runme.py | 3 + ...nme.py => cpp11_rvalue_reference_runme.py} | 4 +- ...l_runme.py => cpp11_thread_local_runme.py} | 2 +- ... => cpp11_uniform_initialization_runme.py} | 8 +- Source/CParse/parser.y | 10 +- 52 files changed, 307 insertions(+), 307 deletions(-) rename Doc/Devel/{cpp0x.html => cpp11.html} (90%) rename Doc/Manual/{Cpp0x.html => CPlusPlus11.html} (78%) rename Examples/test-suite/{cpp0x_alternate_function_syntax.i => cpp11_alternate_function_syntax.i} (77%) rename Examples/test-suite/{cpp0x_constexpr.i => cpp11_constexpr.i} (76%) rename Examples/test-suite/{cpp0x_decltype.i => cpp11_decltype.i} (85%) rename Examples/test-suite/{cpp0x_default_delete.i => cpp11_default_delete.i} (96%) rename Examples/test-suite/{cpp0x_delegating_constructors.i => cpp11_delegating_constructors.i} (88%) rename Examples/test-suite/{cpp0x_explicit_conversion_operators.i => cpp11_explicit_conversion_operators.i} (76%) rename Examples/test-suite/{cpp0x_function_objects.i => cpp11_function_objects.i} (95%) rename Examples/test-suite/{cpp0x_hash_tables.i => cpp11_hash_tables.i} (95%) rename Examples/test-suite/{cpp0x_inheriting_constructors.i => cpp11_inheriting_constructors.i} (89%) rename Examples/test-suite/{cpp0x_initializer_list.i => cpp11_initializer_list.i} (91%) rename Examples/test-suite/{cpp0x_initializer_list_extend.i => cpp11_initializer_list_extend.i} (93%) rename Examples/test-suite/{cpp0x_lambda_functions.i => cpp11_lambda_functions.i} (97%) rename Examples/test-suite/{cpp0x_null_pointer_constant.i => cpp11_null_pointer_constant.i} (85%) rename Examples/test-suite/{cpp0x_raw_string_literals.i => cpp11_raw_string_literals.i} (97%) rename Examples/test-suite/{cpp0x_result_of.i => cpp11_result_of.i} (83%) rename Examples/test-suite/{cpp0x_rvalue_reference.i => cpp11_rvalue_reference.i} (94%) rename Examples/test-suite/{cpp0x_rvalue_reference2.i => cpp11_rvalue_reference2.i} (98%) rename Examples/test-suite/{cpp0x_rvalue_reference3.i => cpp11_rvalue_reference3.i} (98%) rename Examples/test-suite/{cpp0x_sizeof_object.i => cpp11_sizeof_object.i} (71%) rename Examples/test-suite/{cpp0x_static_assert.i => cpp11_static_assert.i} (92%) rename Examples/test-suite/{cpp0x_strongly_typed_enumerations.i => cpp11_strongly_typed_enumerations.i} (84%) rename Examples/test-suite/{cpp0x_template_double_brackets.i => cpp11_template_double_brackets.i} (91%) rename Examples/test-suite/{cpp0x_template_explicit.i => cpp11_template_explicit.i} (81%) rename Examples/test-suite/{cpp0x_template_typedefs.i => cpp11_template_typedefs.i} (94%) rename Examples/test-suite/{cpp0x_thread_local.i => cpp11_thread_local.i} (97%) rename Examples/test-suite/{cpp0x_uniform_initialization.i => cpp11_uniform_initialization.i} (96%) rename Examples/test-suite/{cpp0x_unrestricted_unions.i => cpp11_unrestricted_unions.i} (93%) rename Examples/test-suite/{cpp0x_userdefined_literals.i => cpp11_userdefined_literals.i} (97%) rename Examples/test-suite/{cpp0x_variadic_templates.i => cpp11_variadic_templates.i} (98%) rename Examples/test-suite/java/{cpp0x_lambda_functions_runme.java => cpp11_lambda_functions_runme.java} (52%) rename Examples/test-suite/java/{cpp0x_thread_local_runme.java => cpp11_thread_local_runme.java} (52%) delete mode 100644 Examples/test-suite/python/cpp0x_function_objects_runme.py delete mode 100644 Examples/test-suite/python/cpp0x_initializer_list_extend_runme.py delete mode 100644 Examples/test-suite/python/cpp0x_initializer_list_runme.py delete mode 100644 Examples/test-suite/python/cpp0x_null_pointer_constant_runme.py delete mode 100644 Examples/test-suite/python/cpp0x_result_of_runme.py rename Examples/test-suite/python/{cpp0x_alternate_function_syntax_runme.py => cpp11_alternate_function_syntax_runme.py} (73%) rename Examples/test-suite/python/{cpp0x_decltype_runme.py => cpp11_decltype_runme.py} (86%) create mode 100644 Examples/test-suite/python/cpp11_function_objects_runme.py create mode 100644 Examples/test-suite/python/cpp11_initializer_list_extend_runme.py create mode 100644 Examples/test-suite/python/cpp11_initializer_list_runme.py create mode 100644 Examples/test-suite/python/cpp11_null_pointer_constant_runme.py rename Examples/test-suite/python/{cpp0x_raw_string_literals_runme.py => cpp11_raw_string_literals_runme.py} (95%) create mode 100644 Examples/test-suite/python/cpp11_result_of_runme.py rename Examples/test-suite/python/{cpp0x_rvalue_reference_runme.py => cpp11_rvalue_reference_runme.py} (90%) rename Examples/test-suite/python/{cpp0x_thread_local_runme.py => cpp11_thread_local_runme.py} (94%) rename Examples/test-suite/python/{cpp0x_uniform_initialization_runme.py => cpp11_uniform_initialization_runme.py} (68%) diff --git a/Doc/Devel/cpp0x.html b/Doc/Devel/cpp11.html similarity index 90% rename from Doc/Devel/cpp0x.html rename to Doc/Devel/cpp11.html index 4afc5ffe4..fc35465ae 100644 --- a/Doc/Devel/cpp0x.html +++ b/Doc/Devel/cpp11.html @@ -24,15 +24,15 @@ -

C++0x support for SWIG

+

C++0x/C++11 support for SWIG

Summary

-

This is a technical overview of the C++0x support for the Swig. -This area of Swig is a work in progress. Initial C++0x support for +

This is a technical overview of the C++0x/C++11 support for the Swig. +This area of Swig is a work in progress. Initial C++0x/C++11 support for Swig was written during the Google Summer of Code 2009 period by Matevž Jekovec.

SVN branch

branches/gsoc2009-matevz

-

New C++0x features status

+

New C++11 features status

Wikipedia article: http://en.wikipedia.org/wiki/C%2B%2B0x

Rvalue reference and move semantics [done]

@@ -63,12 +63,12 @@ operator=(ClassType&&):

In practice, the Rvalues are used for temporaries (when passing the result of one function as an argument to another).

Done: Added type&& to Swig parser. Added testcase -cpp0x_rvalue_reference.i. Operator && is treated the same as +cpp11_rvalue_reference.i. Operator && is treated the same as operator &. R11450

Article: http://www.artima.com/cppsource/rvalue.html

Generalized constant expressions [done]

-

In C++0x you can define functions as constant expressions. +

In C++11 you can define functions as constant expressions. Functions need to return constant value in form "return expr", where expr is a constant expression.

@@ -84,7 +84,7 @@ so swig doesn't need to know about the constant values when parsing the header file.

Done: Added the “constexpr “ keyword to Swig. Added testcase -cpp0x_constexpr. R11322

+cpp11_constexpr. R11322

Problem: No compilers were known to support constexpr yet, so the testcase was temporarily commented out in common.mk.

@@ -94,7 +94,7 @@ template in the translation unit at that time. It's a feature specifically aimed at compilers to speed up the compilation process.

Done: Added support for 'extern template class -std::vector<MyClass>;'. Added testcase cpp0x_template_explicit. +std::vector<MyClass>;'. Added testcase cpp11_template_explicit. R11385 , R11386

Initializer lists [done]

Initializer list is a new type in standard library: @@ -117,11 +117,11 @@ is a simple way to convert an ordinary list or a vector to the initializer_list.

Done: Ignored the constructor having initializer_list as its argument. Show warning to the user. Added testcase -cpp0x_initializer_list. R11450

+cpp11_initializer_list. R11450

Article: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1919.pdf

Uniform initialization [done]

-

The new C++0x standard will allow the following:

+

The new C++11 standard will allow the following:

struct IdString {
   std::string name;
   int identifier;
@@ -132,7 +132,7 @@ IdString GetString() {
 }

The feature works exactly as it did now for POD types only (eg. int a[] = {1,2,3};). The following declarations are the same in the new -C++0x:

+C++11:

IdString str1 = {„SomeName“, 4};
 IdString str2{„SomeName“, 4};

The new way of using uniform initialization allows the following:

@@ -154,12 +154,12 @@ AltStruct var2{2, 4.3}; // calls the constructor

The new syntax is specific to C++. Java, C# and scripting languages do not support this behaviour, but always need constructors. They support {} brackets for declaration of arrays as C does + they add -support for creation of arrays on-the-fly (what c++0x introduced with +support for creation of arrays on-the-fly (what C++11 introduced with this feature and more).

Done: Added syntax for {} member initialization in class -constructor. Added testcase cpp0x_uniform_initialization. R11413

+constructor. Added testcase cpp11_uniform_initialization. R11413

Type inference [partially done]

-

A new keyword 'auto' is introduced in C++0x:

+

A new keyword 'auto' is introduced in C++11:

auto a1 = 100;
 auto a2 = myFunc();

The type of a1 and a2 is automatically determined according to the @@ -184,7 +184,7 @@ introduce a new SwigType for this.

only.

Lambda functions and expressions [done]

-

C++0x introduces lambda functions defined as:

+

C++11 introduces lambda functions defined as:

[](int x, int y) -> int { return x + y; }

If the lambda function contains a single return statement only or the function doesn't return any type, the return type '->' can be @@ -210,14 +210,14 @@ functions still work inside the function block though.

Article: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2550.pdf

Done: Added syntax support for the lambda functions. Added -testcase cpp0x_lambda_functions.i. R11491, R11492

+testcase cpp11_lambda_functions.i. R11491, R11492

Alternate function syntax [done]

The problem with decltype() is that the parameters need to be defined before the decltype. The following syntax is not valid, because lhs and rhs hasn't been defined at the time of decltype:

template< typename LHS, typename RHS> 
-  decltype(lhs+rhs) AddingFunc(const LHS &lhs, const RHS &rhs) {return lhs + rhs;} //Not legal C++0x

-The solution C++0x offers is the combination of the 'auto' keyword + decltype(lhs+rhs) AddingFunc(const LHS &lhs, const RHS &rhs) {return lhs + rhs;} //Not legal C++11

+The solution C++11 offers is the combination of the 'auto' keyword before and '-> rettype' after the function declaration:

template< typename LHS, typename RHS> 
   auto AddingFunc(const LHS &lhs, const RHS &rhs) -> decltype(lhs+rhs) {return lhs + rhs;}

@@ -233,13 +233,13 @@ auto SomeStruct::FuncName(int x, int y) -> int { }

Done: Added support for the 'auto' return type. Added support for the '-> type' after the funtion declaration. Added testcases -cpp0x_alternate_function_syntax.i and -cpp0x_alternate_function_syntax_runme.py. R11414

+cpp11_alternate_function_syntax.i and +cpp11_alternate_function_syntax_runme.py. R11414

Concepts, Axioms [ignored]

In C++ there is a common problem when you use a template in the class which doesn't support all the operations the functions in the class actually do on the type. Compiler errors are usually very long -and unreadable. C++0x adds support for the "concepts". The +and unreadable. C++11 adds support for the "concepts". The idea is to define what operations and attributes should the template have. In contrast to class inheritance and polimorphism, all lookups are done in compile-time. @@ -293,7 +293,7 @@ other constructs commonly associated with classes: T top(const std::vector<T>& v) { return v.back(); } bool empty(const std::vector<T>& v) { return v.empty(); } };

-Axioms are a facility pertaining to concepts supplied by C++0x to +Axioms are a facility pertaining to concepts supplied by C++11 to express the semantic properties of concepts. For example, the concept Semigroup can be defined with an axiom Associativity as:

@@ -306,7 +306,7 @@ Semigroup can be defined with an axiom Associativity as: Axioms are more like hints to the compiler to speed-up the process of compilation.

-

Ignored: Concepts and axioms were removed from the C++0x standard. +

Ignored: Concepts and axioms were removed from the C++11 standard.

Object construction improvement [done]

This feature allows classes constructors to call other @@ -335,7 +335,7 @@ the inherited class: };

Swig already correctly parses and produces the correct wrapper for the “using” keyword.

-

Done: Added testcase cpp0x_constructors.i which covers both +

Done: Added testcase cpp11_constructors.i which covers both constructor delegation and constructor inheritance. R11532

Problem: Constructor delegation and constructor inheritance is not supported by any compiler yet, so it's impossible to try and test @@ -351,11 +351,11 @@ this feature.

values will work for the C++. And the other way around, nullptr behaves as the ordinary pointer (false, if empty, true, if not empty), so it's ok for swig to compare it.

-

Done: Written a testcase cpp0x_null_pointer_constant.i and -cpp0x_null_pointer_constant_runme.py to prove the nullptr +

Done: Written a testcase cpp11_null_pointer_constant.i and +cpp11_null_pointer_constant_runme.py to prove the nullptr functionality. R11484

Strongly typed enumerations [partially done]

-

C++0x introduces a new syntax for strongly typed enum declaration: +

C++11 introduces a new syntax for strongly typed enum declaration:

 enum class Enumeration {
   Val1,
@@ -371,16 +371,16 @@ int etc.:
 
 enum class Enum2 : unsigned int {Val1, Val2};

And it can be forward declared as well:

-
 enum Enum1;                   //Illegal in C++ and C++0x; no size is explicitly specified.
- enum Enum2 : unsigned int;    //Legal in C++0x.
- enum class Enum3;             //Legal in C++0x, because enum class declarations have a default type of "int".
- enum class Enum4: unsigned int; //Legal C++0x.
- enum Enum2 : unsigned short;  //Illegal in C++0x, because Enum2 was previously declared with a different type.

+

 enum Enum1;                   //Illegal in C++ and C++11; no size is explicitly specified.
+ enum Enum2 : unsigned int;    //Legal in C++11.
+ enum class Enum3;             //Legal in C++11, because enum class declarations have a default type of "int".
+ enum class Enum4: unsigned int; //Legal C++11.
+ enum Enum2 : unsigned short;  //Illegal in C++11, because Enum2 was previously declared with a different type.

Done: Added syntax 'enum class Name' and forward declarators 'enum Name : inherited type' or 'enum class Name : inherited type' in R11449.

TODO: Add semantic support for enum elements not clashing with -enum elements in other enum classes. See cpp0x_strongly_typed_enums.i +enum elements in other enum classes. See cpp11_strongly_typed_enums.i warnings.

Problem: Swig currently doesn't support nested classes. This feature should be implemented using a new nested class when using @@ -396,7 +396,7 @@ following article as a base:

Done: Added support for angle brackets. Used the preferred "Approach 1". Added a testcase named -cpp0x_template_double_brackets. R11245

+cpp11_template_double_brackets. R11245

Explicit conversion operators [done]

This is used when converting one type to another (eg. if (myObject) {}, where myObject is your custom class converted to @@ -407,9 +407,9 @@ supported in any target language (eg. python, php).

Done: Swig already supports the keyword "explicit" for function types as well. Added test case -cpp0x_explicit_conversion_operators. R11323

+cpp11_explicit_conversion_operators. R11323

Template typedefs [partially done]

-

The new C++0x will allow creation of wrapper around the template. +

The new C++11 will allow creation of wrapper around the template. For example, if we want to do this:

template< typename first, typename second, int third>
 class SomeType;
@@ -433,7 +433,7 @@ using PF = void (*)(double);            // New introduced syntax

Swig supports parsing typedefs for templates as well for example:

typedef List<int> intList;

Done: Expanded support for the new 'using' syntax and template -aliasing. Added testcase cpp0x_template_typedefs. R11533

+aliasing. Added testcase cpp11_template_typedefs. R11533

TODO: Make Swig aware of the newly defined typedef. The TYPEDEF keyword is part of the storage_class rule and type+declarator (see c_decl rule) is the right part of the definition – for example void @@ -443,7 +443,7 @@ type, type_right rules and declarator, direct_declarator, notso_direct_declarator etc., which is PITA.

Unrestricted unions [done]

C++ currently offers usage of unions for types with trivial -constructors only. The new C++0x standard allows usage of types with +constructors only. The new C++11 standard allows usage of types with non-trivial constructors as well:

 struct point {
   point() {}
@@ -453,14 +453,14 @@ non-trivial constructors as well:

union P { int z; double w; - point p; // Illegal in C++; point has a non-trivial constructor. However, this is legal in C++0x. + point p; // Illegal in C++; point has a non-trivial constructor. However, this is legal in C++11. } p1;

Swig already parses the given syntax.

-

Done: Added testcase cpp0x_unrestricted_unions. R11435, R11447

+

Done: Added testcase cpp11_unrestricted_unions. R11435, R11447

Problem: GCC doesn't support unrestricted unions yet so there is no way to actually test, if it works.

Variadic templates [partially done]

-

The new C++0x offers the following syntax:

+

The new C++11 offers the following syntax:

template<typename... Values> class tuple;

This can be used for example:

class tuple<int, std::vector<int>, std::map<std::string, std::vector<int>>> someInstanceName;

@@ -502,7 +502,7 @@ A new extension to sizeof is also introduced with this feature. The } // SomeStruct<Type1, Type2>::size is 2 and SomeStruct<>::size is 0

Done: Added syntax support for 'typename' or 'class' + ... + id. -Added testcase cpp0x_variadic_templates. R11458

+Added testcase cpp11_variadic_templates. R11458

Done: Added syntax support for BaseClass + ..., type + ... + id in parameters and baseclass + ... for intializers after constructor. Extended Swig syntax to support sizeof...(Args). R11467

@@ -510,11 +510,11 @@ Extended Swig syntax to support sizeof...(Args). R11467

TODO: Only (if present) first variadically defined argument is currently used in %template directive. The next ones are ignored.

New string literals [partially done]

-

Beside the implementation, the new C++0x Unicode and custom +

Beside the implementation, the new C++11 Unicode and custom delimeter constants can occur in templates in the header file.

Done: Added symbols 'u', 'u8' and 'U' to mark the beginning of the -UTF string. Also added test case cpp0x_raw_string_literals. R11327

+UTF string. Also added test case cpp11_raw_string_literals. R11327

Done: Added R"DELIMITER[, ]DELIMITER" for a custom delimiter for the beginning/end of the string. R11328

TODO: Fix the Swig's C++ preprocessor bug when parsing an odd @@ -524,7 +524,7 @@ Source/Preprocessor/cpp.c.

C++ has different suffix literals. eg. 12.5f marks the number 12.5 as float.

-

C++0x allows user to define his own suffix for the strings always +

C++11 allows user to define his own suffix for the strings always starting with the underscore (_). eg. int a = "hello"_mySuffix;

The syntax is similar to other operator overloading functions: @@ -548,18 +548,18 @@ Another possibility is to use variadic templates: This instantiates the literal processing function as operator""_Suffix<'1', '2', '3', '4'>. In this form, there is no terminating null character to the string. The main -purpose to doing this is to use C++0x's constexpr keyword and the +purpose to doing this is to use C++11's constexpr keyword and the compiler to allow the literal to be transformed entirely at compile time, assuming OutputType is a constexpr-constructable and copyable type, and the literal processing function is a constexpr function.

Article: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf

Done: Added syntax support for userdefined literals. Added -testcase cpp0x_userdefined_literals.i. R11494

+testcase cpp11_userdefined_literals.i. R11494

TODO: %rename doesn't parse operator”” yet.

Thread-local storage [done]

-

New C++0x introduces keyword "thread_local" which marks +

New C++11 introduces keyword "thread_local" which marks the following variable dynamically located depending on the current thread when using the address-of (&) operator.

@@ -569,7 +569,7 @@ thread when using the address-of (&) operator. thread_local int val; };

Done: Add "thread_local" keyword to Swig. Added testcase -cpp0x_thread_local. R11393

+cpp11_thread_local. R11393

Defaulting/deleting of standard functions on C++ objects [done]

C++ automatically creates default constructor with empty parameters, copy constructor, operator= and destructor for any class. @@ -600,11 +600,11 @@ the standard functions brought by C++ itself. Ignored: Swig already parses the keywords "= delete" and "= default". These keywords are used for built-in functions (copy constructor, operator= etc.), which are ignored by Swig anyway.

-

Done: Added testcase cpp0x_default_delete. R11535

+

Done: Added testcase cpp11_default_delete. R11535

Type long long int [done]

Type long long int is an integer type that has at least 64 useful bits. C99 added it to its standard, but the C++ didn't adopt it until -C++0x. Most C++ compilers supported it though. +C++11. Most C++ compilers supported it though.

Done: Swig already parses the C code including the long long type.

@@ -616,18 +616,18 @@ C++0x. Most C++ compilers supported it though. static_assert(sizeof(int) <= sizeof(T), "not big enough"); };

Done: Added syntax support for "static_assert()". Added -test case cpp0x_static_assert. R11369

+test case cpp11_static_assert. R11369

Allow sizeof to work on members of classes without an explicit object [done]

-

C++0x allows calls of sizeof to concrete objects as well: +

C++11 allows calls of sizeof to concrete objects as well:

 struct A { int member; };
- sizeof(A::member); //Does not work with C++03. Okay with C++0x

+ sizeof(A::member); //Does not work with C++03. Okay with C++11

This kind of syntax is already supported by Swig.

-

Done: Added testcase cpp0x_sizeof_objects. R11538 +

Done: Added testcase cpp11_sizeof_objects. R11538

Threading facilities [ignored]

-

C++0x will add the following classes to the standard library: +

C++11 will add the following classes to the standard library:

 * std::thread
  * std::mutex, std::recursive_mutex
@@ -637,7 +637,7 @@ This kind of syntax is already supported by Swig.

Ignored: No changes to the language itself is made.

Tuple types [TODO]

-

Tuple is array of various types. C++0x introduced this feature +

Tuple is array of various types. C++11 introduced this feature using variadic templates. Tuple is defined as:

template <class ...Types> class tuple;

Constructor is automatically generated filling the tuple elements. @@ -655,7 +655,7 @@ t1 = t2 ; // Ok, first two elements can be converted, // the third one can be constructed from a 'const char *'.

TODO: Implement wrappers for the tuplet<> class.

Hash tables [TODO]

-

C++0x introduces the "unordered" version of existing +

C++11 introduces the "unordered" version of existing types, which in practice work faster than the linear types:

 - unordered set
@@ -671,7 +671,7 @@ aliasing unordered classes to ordered ones doesn't work.

TODO: Implement wrappers for unordered_ types. Initial work is already done in Lib/std/unordered_*.i files.

Regular expressions [ignored]

-

Two new classes are introduced in C++0x: basic_regex and +

Two new classes are introduced in C++11: basic_regex and match_results. Both are defined in regex header file.

Ignored: The new feature extends the standardy library only. No @@ -725,9 +725,9 @@ changes to Swig needed. };

Swig already supports the two.

Done: Added a runtime testcase for function objects -cpp0x_function_objects. R11419.

+cpp11_function_objects. R11419.

Type traits for metaprogramming [ignored]

-

C++0x adds a new header file <type_traits> which includes +

C++11 adds a new header file <type_traits> which includes helper functions to determine the template type while initializing the object at compile time.

@@ -783,6 +783,6 @@ class calculus_ver2 { Swig correctly parses the result_of class.

TODO: The return type (the result_of::type member) is not calculated by Swig. This needs a much more complex semantic parser.

-

Done: Added testcase cpp0x_result_of. R11534

+

Done: Added testcase cpp11_result_of. R11534

- \ No newline at end of file + diff --git a/Doc/Manual/Cpp0x.html b/Doc/Manual/CPlusPlus11.html similarity index 78% rename from Doc/Manual/Cpp0x.html rename to Doc/Manual/CPlusPlus11.html index 457a7e41d..3caec748e 100644 --- a/Doc/Manual/Cpp0x.html +++ b/Doc/Manual/CPlusPlus11.html @@ -1,54 +1,54 @@ -SWIG and C++0x +SWIG and C++11 -

7 SWIG and C++0x

+

7 SWIG and C++11

@@ -56,22 +56,22 @@ -

7.1 Introduction

+

7.1 Introduction

This chapter gives you a brief overview about the SWIG -implementation of the C++0x standard. This part of SWIG is still a work in -progress. Initial C++0x support for SWIG was written during the +implementation of the C++11 standard. This part of SWIG is still a work in +progress. Initial C++11 support for SWIG was written during the Google Summer of Code 2009 period.

SWIG supports all the new C++ syntax changes with some minor limitations (decltype expressions, variadic templates number). Wrappers for the new STL types (unordered_ containers, result_of, tuples) are not supported yet.

-

7.2 Core language changes

+

7.2 Core language changes

-

7.2.1 Rvalue reference and move semantics

+

7.2.1 Rvalue reference and move semantics

SWIG correctly parses the new operator && the same as the reference operator &.

@@ -87,7 +87,7 @@ class MyClass { }; -

7.2.2 Generalized constant expressions

+

7.2.2 Generalized constant expressions

SWIG correctly parses the keyword constexpr, but ignores its functionality. Constant functions cannot be used as constants.

@@ -105,7 +105,7 @@ constexpr int myConstFunc() { return MY_CONST; } const int a = MY_CONST; // ok -

7.2.3 Extern template

+

7.2.3 Extern template

SWIG correctly parses the keywords extern template. However, the explicit template instantiation is not used by SWIG, a %template is still required.

@@ -123,7 +123,7 @@ public: }; -

7.2.4 Initializer lists

+

7.2.4 Initializer lists

Initializer lists are very much a C++ compiler construct and are not very accessible from wrappers as @@ -254,7 +254,7 @@ Note that the default typemap for std::initializer_list does nothing bu and hence any user supplied typemaps will override it and suppress the warning.

-

7.2.5 Uniform initialization

+

7.2.5 Uniform initialization

The curly brackets {} for member initialization are fully @@ -287,7 +287,7 @@ AltStruct var2{2, 4.3}; // calls the constructor 142.15 -

7.2.6 Type inference

+

7.2.6 Type inference

SWIG supports decltype() with some limitations. Single @@ -304,13 +304,13 @@ int i; int j; decltype(i+j) k; // syntax error -

7.2.7 Range-based for-loop

+

7.2.7 Range-based for-loop

This feature is part of the implementation block only. SWIG ignores it.

-

7.2.8 Lambda functions and expressions

+

7.2.8 Lambda functions and expressions

SWIG correctly parses most of the Lambda functions syntax. For example:

@@ -336,7 +336,7 @@ auto six = [](int x, int y) { return x+y; }(4, 2); Better support should be available in a later release.

-

7.2.9 Alternate function syntax

+

7.2.9 Alternate function syntax

SWIG fully supports the new definition of functions. For example:

@@ -346,7 +346,7 @@ struct SomeStruct { }; -

can now be written as in C++0x:

+

can now be written as in C++11:

 struct SomeStruct {
@@ -371,7 +371,7 @@ auto SomeStruct::FuncName(int x, int y) -> int {
 auto square(float a, float b) -> decltype(a);
 
-

7.2.10 Object construction improvement

+

7.2.10 Object construction improvement

@@ -412,12 +412,12 @@ class DerivedClass: public BaseClass { }; -

7.2.11 Null pointer constant

+

7.2.11 Null pointer constant

The nullptr constant is largely unimportant in wrappers. In the few places it has an effect, it is treated like NULL.

-

7.2.12 Strongly typed enumerations

+

7.2.12 Strongly typed enumerations

SWIG parses the new enum class syntax and forward declarator for the enums:

@@ -468,7 +468,7 @@ class AllColors { }; -

7.2.13 Double angle brackets

+

7.2.13 Double angle brackets

SWIG correctly parses the symbols >> as closing the @@ -479,7 +479,7 @@ shift operator >> otherwise.

std::vector<std::vector<int>> myIntTable; -

7.2.14 Explicit conversion operators

+

7.2.14 Explicit conversion operators

SWIG correctly parses the keyword explicit both for operators and constructors. @@ -515,7 +515,7 @@ SWIG target languages, because all use their own facilities (eg. classes Cloneab to achieve particular copy and compare behaviours.

-

7.2.15 Alias templates

+

7.2.15 Alias templates

The following is an example of an alias template: @@ -567,7 +567,7 @@ example.i:17: Warning 341: The 'using' keyword in type aliasing is not fully sup typedef void (*PFD)(double); // The old style -

7.2.16 Unrestricted unions

+

7.2.16 Unrestricted unions

SWIG fully supports any type inside a union even if it does not @@ -593,7 +593,7 @@ union P { } p1; -

7.2.17 Variadic templates

+

7.2.17 Variadic templates

SWIG supports the variadic templates syntax (inside the <> @@ -628,7 +628,7 @@ const int SIZE = sizeof...(ClassName<int, int>); In the above example SIZE is of course wrapped as a constant.

-

7.2.18 New string literals

+

7.2.18 New string literals

SWIG supports unicode string constants and raw string literals.

@@ -652,7 +652,7 @@ const char32_t *ii = UR"XXX(I'm a "raw UTF-32" \ string.)XXX";

Note: SWIG currently incorrectly parses the odd number of double quotes inside the string due to SWIG's C++ preprocessor.

-

7.2.19 User-defined literals

+

7.2.19 User-defined literals

@@ -719,7 +719,7 @@ OutputType var2 = 1234_suffix; OutputType var3 = 3.1416_suffix; -

7.2.20 Thread-local storage

+

7.2.20 Thread-local storage

SWIG correctly parses the thread_local keyword. For example, variable @@ -739,7 +739,7 @@ A variable will be thread local if accessed from different threads from the targ same way that it will be thread local if accessed from C++ code.

-

7.2.21 Defaulting/deleting of standard functions on C++ objects

+

7.2.21 Defaulting/deleting of standard functions on C++ objects

SWIG correctly parses the = delete and = default @@ -757,12 +757,12 @@ struct NonCopyable {

This feature is specific to C++ only. The defaulting/deleting is currently ignored, because SWIG automatically produces wrappers for special constructors and operators specific to the target language.

-

7.2.22 Type long long int

+

7.2.22 Type long long int

SWIG correctly parses and uses the new long long type already introduced in C99 some time ago.

-

7.2.23 Static assertions

+

7.2.23 Static assertions

SWIG correctly parses and calls the new static_assert function.

@@ -774,7 +774,7 @@ struct Check { }; -

7.2.24 Allow sizeof to work on members of classes without an explicit object

+

7.2.24 Allow sizeof to work on members of classes without an explicit object

SWIG correctly calls the sizeof() on types as well as on the @@ -785,7 +785,7 @@ struct A { int member; }; -const int SIZE = sizeof(A::member); // does not work with C++03. Okay with C++0x +const int SIZE = sizeof(A::member); // does not work with C++03. Okay with C++11

In Python:

@@ -794,28 +794,28 @@ const int SIZE = sizeof(A::member); // does not work with C++03. Okay with C++0x 8 -

7.3 Standard library changes

+

7.3 Standard library changes

-

7.3.1 Threading facilities

+

7.3.1 Threading facilities

SWIG does not currently wrap or use any of the new threading classes introduced (thread, mutex, locks, condition variables, task). The main reason is that SWIG target languages offer their own threading facilities that do not rely on C++.

-

7.3.2 Tuple types and hash tables

+

7.3.2 Tuple types and hash tables

SWIG does not wrap the new tuple types and the unordered_ container classes yet. Variadic template support is working so it is possible to include the tuple header file; it is parsed without any problems.

-

7.3.3 Regular expressions

+

7.3.3 Regular expressions

-

SWIG does not wrap the new C++0x regular expressions classes, because the SWIG target languages use their own facilities for this.

+

SWIG does not wrap the new C++11 regular expressions classes, because the SWIG target languages use their own facilities for this.

-

7.3.4 General-purpose smart pointers

+

7.3.4 General-purpose smart pointers

@@ -823,12 +823,12 @@ SWIG provides special smart pointer handling for std::tr1::shared_ptr i There is no special smart pointer handling available for std::weak_ptr and std::unique_ptr.

-

7.3.5 Extensible random number facility

+

7.3.5 Extensible random number facility

This feature extends and standardizes the standard library only and does not effect the C++ language and SWIG.

-

7.3.6 Wrapper reference

+

7.3.6 Wrapper reference

The new ref and cref classes are used to instantiate a parameter as a reference of a template function. For example:

@@ -853,7 +853,7 @@ int main() {

The ref and cref classes are not wrapped by SWIG because the SWIG target languages do not support referencing.

-

7.3.7 Polymorphous wrappers for function objects

+

7.3.7 Polymorphous wrappers for function objects

@@ -884,7 +884,7 @@ t = Test() b = t(1,2) # invoke C++ function object -

7.3.8 Type traits for metaprogramming

+

7.3.8 Type traits for metaprogramming

The new C++ metaprogramming is useful at compile time and is aimed specifically for C++ development:

@@ -909,7 +909,7 @@ template< class T1, class T2 > int elaborate( T1 A, T2 B ) {

SWIG correctly parses the template specialization, template types and values inside the <> block and the new helper functions: is_convertible, is_integral, is_const etc. However, SWIG still explicitly requires concrete types when using the %template directive, so the C++ metaprogramming features are not really of interest at runtime in the target languages.

-

7.3.9 Uniform method for computing return type of function objects

+

7.3.9 Uniform method for computing return type of function objects

SWIG does not wrap the new result_of class introduced in the <functional> header and map the result_of::type to the concrete type yet. For example:

diff --git a/Doc/Manual/chapters b/Doc/Manual/chapters index fd21651e3..45d35e793 100644 --- a/Doc/Manual/chapters +++ b/Doc/Manual/chapters @@ -4,7 +4,7 @@ Windows.html Scripting.html SWIG.html SWIGPlus.html -Cpp0x.html +CPlusPlus11.html Preprocessor.html Library.html Arguments.html diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index c0f642212..be6b4736a 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -87,7 +87,7 @@ CPP_TEST_BROKEN += \ overload_complicated \ template_default_pointer \ template_expr \ - $(CPP0X_TEST_BROKEN) + $(CPP11_TEST_BROKEN) # Broken C test cases. (Can be run individually using: make testcase.ctest) @@ -97,7 +97,7 @@ C_TEST_BROKEN += \ # C++ test cases. (Can be run individually using: make testcase.cpptest) CPP_TEST_CASES += \ - $(CPP0X_TEST_CASES) \ + $(CPP11_TEST_CASES) \ abstract_access \ abstract_inherit \ abstract_inherit_ok \ @@ -476,41 +476,41 @@ CPP_TEST_CASES += \ wallkw \ wrapmacro -# C++0x test cases. -CPP0X_TEST_CASES = \ - cpp0x_alternate_function_syntax \ - cpp0x_constexpr \ - cpp0x_decltype \ - cpp0x_default_delete \ - cpp0x_delegating_constructors \ - cpp0x_explicit_conversion_operators \ - cpp0x_function_objects \ - cpp0x_initializer_list \ - cpp0x_initializer_list_extend \ - cpp0x_lambda_functions \ - cpp0x_null_pointer_constant \ - cpp0x_raw_string_literals \ - cpp0x_rvalue_reference \ - cpp0x_rvalue_reference2 \ - cpp0x_rvalue_reference3 \ - cpp0x_sizeof_object \ - cpp0x_static_assert \ - cpp0x_strongly_typed_enumerations \ - cpp0x_template_double_brackets \ - cpp0x_template_explicit \ - cpp0x_template_typedefs \ - cpp0x_uniform_initialization \ - cpp0x_unrestricted_unions \ - cpp0x_userdefined_literals \ - cpp0x_variadic_templates +# C++11 test cases. +CPP11_TEST_CASES = \ + cpp11_alternate_function_syntax \ + cpp11_constexpr \ + cpp11_decltype \ + cpp11_default_delete \ + cpp11_delegating_constructors \ + cpp11_explicit_conversion_operators \ + cpp11_function_objects \ + cpp11_initializer_list \ + cpp11_initializer_list_extend \ + cpp11_lambda_functions \ + cpp11_null_pointer_constant \ + cpp11_raw_string_literals \ + cpp11_rvalue_reference \ + cpp11_rvalue_reference2 \ + cpp11_rvalue_reference3 \ + cpp11_sizeof_object \ + cpp11_static_assert \ + cpp11_strongly_typed_enumerations \ + cpp11_template_double_brackets \ + cpp11_template_explicit \ + cpp11_template_typedefs \ + cpp11_uniform_initialization \ + cpp11_unrestricted_unions \ + cpp11_userdefined_literals \ + cpp11_variadic_templates -# cpp0x_inheriting_constructors \ # not supported by gcc-4.7 -# cpp0x_hash_tables \ # not fully implemented yet -# cpp0x_result_of \ # SWIG does not support -# cpp0x_thread_local \ # needs gcc-4.8 +# cpp11_inheriting_constructors \ # not supported by gcc-4.7 +# cpp11_hash_tables \ # not fully implemented yet +# cpp11_result_of \ # SWIG does not support +# cpp11_thread_local \ # needs gcc-4.8 -# Broken C++0x test cases. -CPP0X_TEST_BROKEN = +# Broken C++11 test cases. +CPP11_TEST_BROKEN = # # Put all the heavy STD/STL cases here, where they can be skipped if needed @@ -626,7 +626,7 @@ all: $(NOT_BROKEN_TEST_CASES) $(BROKEN_TEST_CASES) check: $(NOT_BROKEN_TEST_CASES) -check-cpp11: $(CPP0X_TEST_CASES:=.cpptest) +check-cpp11: $(CPP11_TEST_CASES:=.cpptest) # partialcheck target runs SWIG only, ie no compilation or running of tests (for a subset of languages) partialcheck: diff --git a/Examples/test-suite/cpp0x_alternate_function_syntax.i b/Examples/test-suite/cpp11_alternate_function_syntax.i similarity index 77% rename from Examples/test-suite/cpp0x_alternate_function_syntax.i rename to Examples/test-suite/cpp11_alternate_function_syntax.i index 6726dad7c..227a1c8c8 100644 --- a/Examples/test-suite/cpp0x_alternate_function_syntax.i +++ b/Examples/test-suite/cpp11_alternate_function_syntax.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly uses the new alternate functions - declarations and definitions introduced in C++0x. */ -%module cpp0x_alternate_function_syntax + declarations and definitions introduced in C++11. */ +%module cpp11_alternate_function_syntax %inline %{ struct SomeStruct { diff --git a/Examples/test-suite/cpp0x_constexpr.i b/Examples/test-suite/cpp11_constexpr.i similarity index 76% rename from Examples/test-suite/cpp0x_constexpr.i rename to Examples/test-suite/cpp11_constexpr.i index ae1d292b4..95fe5fa2b 100644 --- a/Examples/test-suite/cpp0x_constexpr.i +++ b/Examples/test-suite/cpp11_constexpr.i @@ -1,7 +1,7 @@ /* This interface tests whether SWIG supports the new "constexpr" keyword - introduced by C++0x. + introduced by C++11. */ -%module cpp0x_constexpr +%module cpp11_constexpr %inline %{ class TestClass { diff --git a/Examples/test-suite/cpp0x_decltype.i b/Examples/test-suite/cpp11_decltype.i similarity index 85% rename from Examples/test-suite/cpp0x_decltype.i rename to Examples/test-suite/cpp11_decltype.i index 5a4292454..deedd5953 100644 --- a/Examples/test-suite/cpp0x_decltype.i +++ b/Examples/test-suite/cpp11_decltype.i @@ -1,7 +1,7 @@ /* This testcase checks whether SWIG correctly uses the new 'decltype()' - introduced in C++0x. + introduced in C++11. */ -%module cpp0x_decltype +%module cpp11_decltype %inline %{ class A { diff --git a/Examples/test-suite/cpp0x_default_delete.i b/Examples/test-suite/cpp11_default_delete.i similarity index 96% rename from Examples/test-suite/cpp0x_default_delete.i rename to Examples/test-suite/cpp11_default_delete.i index bdb74ffb1..be4cc6cc9 100644 --- a/Examples/test-suite/cpp0x_default_delete.i +++ b/Examples/test-suite/cpp11_default_delete.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly parses the default and delete keywords which keep or remove default C++ object construction functions. */ -%module cpp0x_default_delete +%module cpp11_default_delete %{ #include diff --git a/Examples/test-suite/cpp0x_delegating_constructors.i b/Examples/test-suite/cpp11_delegating_constructors.i similarity index 88% rename from Examples/test-suite/cpp0x_delegating_constructors.i rename to Examples/test-suite/cpp11_delegating_constructors.i index 679dce242..ca5aa326e 100644 --- a/Examples/test-suite/cpp0x_delegating_constructors.i +++ b/Examples/test-suite/cpp11_delegating_constructors.i @@ -1,7 +1,7 @@ /* This test checks whether SWIG correctly parses the new delegating constructors. */ -%module cpp0x_delegating_constructors +%module cpp11_delegating_constructors %inline %{ class A { diff --git a/Examples/test-suite/cpp0x_explicit_conversion_operators.i b/Examples/test-suite/cpp11_explicit_conversion_operators.i similarity index 76% rename from Examples/test-suite/cpp0x_explicit_conversion_operators.i rename to Examples/test-suite/cpp11_explicit_conversion_operators.i index 313b5e878..5e3ba03df 100644 --- a/Examples/test-suite/cpp0x_explicit_conversion_operators.i +++ b/Examples/test-suite/cpp11_explicit_conversion_operators.i @@ -1,7 +1,7 @@ /* This interface checks whether SWIG correctly compiles the new - explicit conversion operators feature introduced in C++0x. + explicit conversion operators feature introduced in C++11. */ -%module cpp0x_explicit_conversion_operators +%module cpp11_explicit_conversion_operators %inline %{ diff --git a/Examples/test-suite/cpp0x_function_objects.i b/Examples/test-suite/cpp11_function_objects.i similarity index 95% rename from Examples/test-suite/cpp0x_function_objects.i rename to Examples/test-suite/cpp11_function_objects.i index 4b9895ca8..fb75edea6 100644 --- a/Examples/test-suite/cpp0x_function_objects.i +++ b/Examples/test-suite/cpp11_function_objects.i @@ -3,7 +3,7 @@ Function objects are objects which overload the operator() function. The std::function does not provide any seamless support in the target languages yet. */ -%module cpp0x_function_objects +%module cpp11_function_objects %rename(__call__) Test::operator(); diff --git a/Examples/test-suite/cpp0x_hash_tables.i b/Examples/test-suite/cpp11_hash_tables.i similarity index 95% rename from Examples/test-suite/cpp0x_hash_tables.i rename to Examples/test-suite/cpp11_hash_tables.i index fff630ca0..4f68cbac5 100644 --- a/Examples/test-suite/cpp0x_hash_tables.i +++ b/Examples/test-suite/cpp11_hash_tables.i @@ -1,6 +1,6 @@ /* This testcase checks the new wrappers for the new unordered_ STL types - introduced in C++0x. */ -%module cpp0x_hash_tables + introduced in C++11. */ +%module cpp11_hash_tables %inline %{ #include diff --git a/Examples/test-suite/cpp0x_inheriting_constructors.i b/Examples/test-suite/cpp11_inheriting_constructors.i similarity index 89% rename from Examples/test-suite/cpp0x_inheriting_constructors.i rename to Examples/test-suite/cpp11_inheriting_constructors.i index 452598360..e1adb4caa 100644 --- a/Examples/test-suite/cpp0x_inheriting_constructors.i +++ b/Examples/test-suite/cpp11_inheriting_constructors.i @@ -1,7 +1,7 @@ /* This test checks whether SWIG correctly parses the new constructor inheritance. */ -%module cpp0x_inheriting_constructors +%module cpp11_inheriting_constructors %inline %{ class BaseClass { diff --git a/Examples/test-suite/cpp0x_initializer_list.i b/Examples/test-suite/cpp11_initializer_list.i similarity index 91% rename from Examples/test-suite/cpp0x_initializer_list.i rename to Examples/test-suite/cpp11_initializer_list.i index 14833390e..58d2ecc50 100644 --- a/Examples/test-suite/cpp0x_initializer_list.i +++ b/Examples/test-suite/cpp11_initializer_list.i @@ -1,6 +1,6 @@ /* This testcase shows a few simple ways to deal with the new initializer_list - introduced in C++0x. */ -%module cpp0x_initializer_list + introduced in C++11. */ +%module cpp11_initializer_list %warnfilter(SWIGWARN_TYPEMAP_INITIALIZER_LIST) B::B; %ignore A::A(std::initializer_list); diff --git a/Examples/test-suite/cpp0x_initializer_list_extend.i b/Examples/test-suite/cpp11_initializer_list_extend.i similarity index 93% rename from Examples/test-suite/cpp0x_initializer_list_extend.i rename to Examples/test-suite/cpp11_initializer_list_extend.i index d8443e622..02ad1312e 100644 --- a/Examples/test-suite/cpp0x_initializer_list_extend.i +++ b/Examples/test-suite/cpp11_initializer_list_extend.i @@ -1,6 +1,6 @@ /* This testcase shows how to replace std_initializer_list with std_vector. */ -%module cpp0x_initializer_list_extend +%module cpp11_initializer_list_extend %ignore Container::Container(std::initializer_list); %include diff --git a/Examples/test-suite/cpp0x_lambda_functions.i b/Examples/test-suite/cpp11_lambda_functions.i similarity index 97% rename from Examples/test-suite/cpp0x_lambda_functions.i rename to Examples/test-suite/cpp11_lambda_functions.i index 312414a49..87c7196d8 100644 --- a/Examples/test-suite/cpp0x_lambda_functions.i +++ b/Examples/test-suite/cpp11_lambda_functions.i @@ -1,9 +1,9 @@ /* This testcase checks whether SWIG correctly parses the lambda expressions - and closure syntax introduced in C++0x. + and closure syntax introduced in C++11. SWIG supports only lambda syntax and doesn't produce any wrapper code for this. */ -%module cpp0x_lambda_functions +%module cpp11_lambda_functions %warnfilter(SWIGWARN_CPP11_LAMBDA) lambda1; %warnfilter(SWIGWARN_CPP11_LAMBDA) lambda2; diff --git a/Examples/test-suite/cpp0x_null_pointer_constant.i b/Examples/test-suite/cpp11_null_pointer_constant.i similarity index 85% rename from Examples/test-suite/cpp0x_null_pointer_constant.i rename to Examples/test-suite/cpp11_null_pointer_constant.i index dcb5e61bd..0b3276a44 100644 --- a/Examples/test-suite/cpp0x_null_pointer_constant.i +++ b/Examples/test-suite/cpp11_null_pointer_constant.i @@ -1,8 +1,8 @@ /* This testcase checks whether SWIG correctly treats the new nullptr_t - constant introduced in C++0x. + constant introduced in C++11. */ -%module cpp0x_null_pointer_constant +%module cpp11_null_pointer_constant %feature("autodoc") A::NullPtrMethod; // Triggers conversion of nullptr to None, nil etc in target language %feature("compactdefaultargs") A::NullPtrMethod; diff --git a/Examples/test-suite/cpp0x_raw_string_literals.i b/Examples/test-suite/cpp11_raw_string_literals.i similarity index 97% rename from Examples/test-suite/cpp0x_raw_string_literals.i rename to Examples/test-suite/cpp11_raw_string_literals.i index 39a8bb641..6fd13a0d0 100644 --- a/Examples/test-suite/cpp0x_raw_string_literals.i +++ b/Examples/test-suite/cpp11_raw_string_literals.i @@ -7,7 +7,7 @@ This module also tests whether SWIG correctly parses custom string delimiters. */ -%module cpp0x_raw_string_literals +%module cpp11_raw_string_literals %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG) bb; %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG) ee; %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG) gg; diff --git a/Examples/test-suite/cpp0x_result_of.i b/Examples/test-suite/cpp11_result_of.i similarity index 83% rename from Examples/test-suite/cpp0x_result_of.i rename to Examples/test-suite/cpp11_result_of.i index 42ff6c068..6d98ec0c0 100644 --- a/Examples/test-suite/cpp0x_result_of.i +++ b/Examples/test-suite/cpp11_result_of.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly uses the new result_of class - and its templating capabilities introduced in C++0x. */ -%module cpp0x_result_of + and its templating capabilities introduced in C++11. */ +%module cpp11_result_of %inline %{ #include diff --git a/Examples/test-suite/cpp0x_rvalue_reference.i b/Examples/test-suite/cpp11_rvalue_reference.i similarity index 94% rename from Examples/test-suite/cpp0x_rvalue_reference.i rename to Examples/test-suite/cpp11_rvalue_reference.i index 67686bc0f..45ee06354 100644 --- a/Examples/test-suite/cpp0x_rvalue_reference.i +++ b/Examples/test-suite/cpp11_rvalue_reference.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly parses the double ampersand && move operator which is currently mapped to the reference & operator. */ -%module cpp0x_rvalue_reference +%module cpp11_rvalue_reference %inline %{ #include diff --git a/Examples/test-suite/cpp0x_rvalue_reference2.i b/Examples/test-suite/cpp11_rvalue_reference2.i similarity index 98% rename from Examples/test-suite/cpp0x_rvalue_reference2.i rename to Examples/test-suite/cpp11_rvalue_reference2.i index dbeaa78fa..4ef871c63 100644 --- a/Examples/test-suite/cpp0x_rvalue_reference2.i +++ b/Examples/test-suite/cpp11_rvalue_reference2.i @@ -1,4 +1,4 @@ -%module cpp0x_rvalue_reference2 +%module cpp11_rvalue_reference2 %warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK) globalrrval; diff --git a/Examples/test-suite/cpp0x_rvalue_reference3.i b/Examples/test-suite/cpp11_rvalue_reference3.i similarity index 98% rename from Examples/test-suite/cpp0x_rvalue_reference3.i rename to Examples/test-suite/cpp11_rvalue_reference3.i index 2da1bf741..c65309945 100644 --- a/Examples/test-suite/cpp0x_rvalue_reference3.i +++ b/Examples/test-suite/cpp11_rvalue_reference3.i @@ -1,4 +1,4 @@ -%module cpp0x_rvalue_reference3 +%module cpp11_rvalue_reference3 %warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); diff --git a/Examples/test-suite/cpp0x_sizeof_object.i b/Examples/test-suite/cpp11_sizeof_object.i similarity index 71% rename from Examples/test-suite/cpp0x_sizeof_object.i rename to Examples/test-suite/cpp11_sizeof_object.i index 72299786d..fca8a8ccc 100644 --- a/Examples/test-suite/cpp0x_sizeof_object.i +++ b/Examples/test-suite/cpp11_sizeof_object.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly uses the sizeof() on the - concrete objects and not only types introduced in C++0x. */ -%module cpp0x_sizeof_object + concrete objects and not only types introduced in C++11. */ +%module cpp11_sizeof_object %inline %{ struct B { diff --git a/Examples/test-suite/cpp0x_static_assert.i b/Examples/test-suite/cpp11_static_assert.i similarity index 92% rename from Examples/test-suite/cpp0x_static_assert.i rename to Examples/test-suite/cpp11_static_assert.i index d6413a1e5..8d616f96c 100644 --- a/Examples/test-suite/cpp0x_static_assert.i +++ b/Examples/test-suite/cpp11_static_assert.i @@ -1,7 +1,7 @@ /* This test case checks whether SWIG correctly parses and ignores the keywords "static_assert()" inside the class or struct. */ -%module cpp0x_static_assert +%module cpp11_static_assert %inline %{ template diff --git a/Examples/test-suite/cpp0x_strongly_typed_enumerations.i b/Examples/test-suite/cpp11_strongly_typed_enumerations.i similarity index 84% rename from Examples/test-suite/cpp0x_strongly_typed_enumerations.i rename to Examples/test-suite/cpp11_strongly_typed_enumerations.i index dbe6d44bc..ed466369e 100644 --- a/Examples/test-suite/cpp0x_strongly_typed_enumerations.i +++ b/Examples/test-suite/cpp11_strongly_typed_enumerations.i @@ -1,7 +1,7 @@ /* This testcase checks whether SWIG produces the correct wrapper for the strongly typed enums. Enums with the same type are comparable. Enum classes require support for nested classes. */ -%module cpp0x_strongly_typed_enumerations +%module cpp11_strongly_typed_enumerations %warnfilter(302) Val1; %warnfilter(302) Val2; %warnfilter(302) Val3; @@ -30,13 +30,13 @@ enum class Enum2 : short { %} // SWIG should fail this one -enum Enum2 : unsigned short; // Illegal in C++0x, because Enum2 was previously declared with a different type. +enum Enum2 : unsigned short; // Illegal in C++11, because Enum2 was previously declared with a different type. %inline %{ /* Forward declarations. */ -enum Enum4 : unsigned int; // Legal in C++0x. -enum class Enum5; // Legal in C++0x, because enum class declarations have a default type of "int". -enum class Enum6 : unsigned int; // Legal C++0x. +enum Enum4 : unsigned int; // Legal in C++11. +enum class Enum5; // Legal in C++11, because enum class declarations have a default type of "int". +enum class Enum6 : unsigned int; // Legal C++11. enum Enum4 : unsigned int { Val1, Val2, Val3 = 100, Val4 diff --git a/Examples/test-suite/cpp0x_template_double_brackets.i b/Examples/test-suite/cpp11_template_double_brackets.i similarity index 91% rename from Examples/test-suite/cpp0x_template_double_brackets.i rename to Examples/test-suite/cpp11_template_double_brackets.i index 6b2230362..15fe4903b 100644 --- a/Examples/test-suite/cpp0x_template_double_brackets.i +++ b/Examples/test-suite/cpp11_template_double_brackets.i @@ -1,8 +1,8 @@ /* This interface checks whether SWIG supports the new double angled brackets in the template syntax without having a space inbetween. This feature was - introduced in new C++0x standard. + introduced in new C++11 standard. */ -%module cpp0x_template_double_brackets +%module cpp11_template_double_brackets %inline %{ #include std::map> map1; diff --git a/Examples/test-suite/cpp0x_template_explicit.i b/Examples/test-suite/cpp11_template_explicit.i similarity index 81% rename from Examples/test-suite/cpp0x_template_explicit.i rename to Examples/test-suite/cpp11_template_explicit.i index bbc216ba0..80a30d283 100644 --- a/Examples/test-suite/cpp0x_template_explicit.i +++ b/Examples/test-suite/cpp11_template_explicit.i @@ -1,8 +1,8 @@ /* This unit tests whether SWIG correctly parses the code and makes wrappers - for the new C++0x extern templates (explicit template instantiation without + for the new C++11 extern templates (explicit template instantiation without using the translation unit). */ -%module cpp0x_template_explicit +%module cpp11_template_explicit #pragma SWIG nowarn=SWIGWARN_PARSE_EXPLICIT_TEMPLATE diff --git a/Examples/test-suite/cpp0x_template_typedefs.i b/Examples/test-suite/cpp11_template_typedefs.i similarity index 94% rename from Examples/test-suite/cpp0x_template_typedefs.i rename to Examples/test-suite/cpp11_template_typedefs.i index aeffde11a..ea46706a9 100644 --- a/Examples/test-suite/cpp0x_template_typedefs.i +++ b/Examples/test-suite/cpp11_template_typedefs.i @@ -1,5 +1,5 @@ /* This testcase checks whether SWIG correctly parses alias templates. */ -%module cpp0x_template_typedefs +%module cpp11_template_typedefs %warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefName; %warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) PF; diff --git a/Examples/test-suite/cpp0x_thread_local.i b/Examples/test-suite/cpp11_thread_local.i similarity index 97% rename from Examples/test-suite/cpp0x_thread_local.i rename to Examples/test-suite/cpp11_thread_local.i index 00f12dff9..6a1019824 100644 --- a/Examples/test-suite/cpp0x_thread_local.i +++ b/Examples/test-suite/cpp11_thread_local.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly parses the 'thread_local' storage specifier */ -%module cpp0x_thread_local +%module cpp11_thread_local %inline %{ struct ThreadLocals { diff --git a/Examples/test-suite/cpp0x_uniform_initialization.i b/Examples/test-suite/cpp11_uniform_initialization.i similarity index 96% rename from Examples/test-suite/cpp0x_uniform_initialization.i rename to Examples/test-suite/cpp11_uniform_initialization.i index 81a3e45de..07fb81280 100644 --- a/Examples/test-suite/cpp0x_uniform_initialization.i +++ b/Examples/test-suite/cpp11_uniform_initialization.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG syntactically correctly parses the initialization syntax using {} braces for uniform member initialization. */ -%module cpp0x_uniform_initialization +%module cpp11_uniform_initialization %include diff --git a/Examples/test-suite/cpp0x_unrestricted_unions.i b/Examples/test-suite/cpp11_unrestricted_unions.i similarity index 93% rename from Examples/test-suite/cpp0x_unrestricted_unions.i rename to Examples/test-suite/cpp11_unrestricted_unions.i index be65fd83d..5facaafe1 100644 --- a/Examples/test-suite/cpp0x_unrestricted_unions.i +++ b/Examples/test-suite/cpp11_unrestricted_unions.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly parses the support for types without the defined trivial constructor in the unions. */ -%module cpp0x_unrestricted_unions +%module cpp11_unrestricted_unions %inline %{ struct point { diff --git a/Examples/test-suite/cpp0x_userdefined_literals.i b/Examples/test-suite/cpp11_userdefined_literals.i similarity index 97% rename from Examples/test-suite/cpp0x_userdefined_literals.i rename to Examples/test-suite/cpp11_userdefined_literals.i index d20345fed..43103cc8c 100644 --- a/Examples/test-suite/cpp0x_userdefined_literals.i +++ b/Examples/test-suite/cpp11_userdefined_literals.i @@ -1,6 +1,6 @@ /* This testcase checks whether SWIG correctly parses the user-defined literals - introduced in C++0x. */ -%module cpp0x_userdefined_literals + introduced in C++11. */ +%module cpp11_userdefined_literals // Unfortunately full declaration is needed for %rename atm, the parameter list cannot be omitted. %rename(MyRawLiteral) operator"" _myRawLiteral(const char * value); diff --git a/Examples/test-suite/cpp0x_variadic_templates.i b/Examples/test-suite/cpp11_variadic_templates.i similarity index 98% rename from Examples/test-suite/cpp0x_variadic_templates.i rename to Examples/test-suite/cpp11_variadic_templates.i index 2c0b2eac8..15ab4eece 100644 --- a/Examples/test-suite/cpp0x_variadic_templates.i +++ b/Examples/test-suite/cpp11_variadic_templates.i @@ -3,7 +3,7 @@ the template brackets, new functions sizeof... and multiple inheritance using variadic number of classes. */ -%module cpp0x_variadic_templates +%module cpp11_variadic_templates %warnfilter(SWIGWARN_CPP11_VARIADIC_TEMPLATE) MultiArgs; %warnfilter(SWIGWARN_CPP11_VARIADIC_TEMPLATE) SizeOf; %warnfilter(SWIGWARN_CPP11_VARIADIC_TEMPLATE) MultiInherit; diff --git a/Examples/test-suite/java/cpp0x_lambda_functions_runme.java b/Examples/test-suite/java/cpp11_lambda_functions_runme.java similarity index 52% rename from Examples/test-suite/java/cpp0x_lambda_functions_runme.java rename to Examples/test-suite/java/cpp11_lambda_functions_runme.java index 79545f87e..a0d310c7c 100644 --- a/Examples/test-suite/java/cpp0x_lambda_functions_runme.java +++ b/Examples/test-suite/java/cpp11_lambda_functions_runme.java @@ -1,10 +1,10 @@ -import cpp0x_lambda_functions.*; +import cpp11_lambda_functions.*; -public class cpp0x_lambda_functions_runme { +public class cpp11_lambda_functions_runme { static { try { - System.loadLibrary("cpp0x_lambda_functions"); + System.loadLibrary("cpp11_lambda_functions"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.exit(1); @@ -18,11 +18,11 @@ public class cpp0x_lambda_functions_runme { public static void main(String argv[]) { - check(cpp0x_lambda_functions.runLambda1(), 11); - check(cpp0x_lambda_functions.runLambda2(), 11); - check(cpp0x_lambda_functions.runLambda3(), 11); - check(cpp0x_lambda_functions.runLambda4(), 11); - check(cpp0x_lambda_functions.runLambda5(), 1); - check(cpp0x_lambda_functions.runLambda5(), 2); + check(cpp11_lambda_functions.runLambda1(), 11); + check(cpp11_lambda_functions.runLambda2(), 11); + check(cpp11_lambda_functions.runLambda3(), 11); + check(cpp11_lambda_functions.runLambda4(), 11); + check(cpp11_lambda_functions.runLambda5(), 1); + check(cpp11_lambda_functions.runLambda5(), 2); } } diff --git a/Examples/test-suite/java/cpp0x_thread_local_runme.java b/Examples/test-suite/java/cpp11_thread_local_runme.java similarity index 52% rename from Examples/test-suite/java/cpp0x_thread_local_runme.java rename to Examples/test-suite/java/cpp11_thread_local_runme.java index dc7cafafe..a645fbabf 100644 --- a/Examples/test-suite/java/cpp0x_thread_local_runme.java +++ b/Examples/test-suite/java/cpp11_thread_local_runme.java @@ -1,10 +1,10 @@ -import cpp0x_thread_local.*; +import cpp11_thread_local.*; -public class cpp0x_thread_local_runme { +public class cpp11_thread_local_runme { static { try { - System.loadLibrary("cpp0x_thread_local"); + System.loadLibrary("cpp11_thread_local"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.exit(1); @@ -20,32 +20,32 @@ public class cpp0x_thread_local_runme { if (ThreadLocals.tscval99 != 99) throw new RuntimeException(); - cpp0x_thread_local.setEtval(-11); - if (cpp0x_thread_local.getEtval() != -11) + cpp11_thread_local.setEtval(-11); + if (cpp11_thread_local.getEtval() != -11) throw new RuntimeException(); - cpp0x_thread_local.setStval(-22); - if (cpp0x_thread_local.getStval() != -22) + cpp11_thread_local.setStval(-22); + if (cpp11_thread_local.getStval() != -22) throw new RuntimeException(); - cpp0x_thread_local.setTsval(-33); - if (cpp0x_thread_local.getTsval() != -33) + cpp11_thread_local.setTsval(-33); + if (cpp11_thread_local.getTsval() != -33) throw new RuntimeException(); - cpp0x_thread_local.setEtval(-44); - if (cpp0x_thread_local.getEtval() != -44) + cpp11_thread_local.setEtval(-44); + if (cpp11_thread_local.getEtval() != -44) throw new RuntimeException(); - cpp0x_thread_local.setTeval(-55); - if (cpp0x_thread_local.getTeval() != -55) + cpp11_thread_local.setTeval(-55); + if (cpp11_thread_local.getTeval() != -55) throw new RuntimeException(); - cpp0x_thread_local.setEctval(-55); - if (cpp0x_thread_local.getEctval() != -55) + cpp11_thread_local.setEctval(-55); + if (cpp11_thread_local.getEctval() != -55) throw new RuntimeException(); - cpp0x_thread_local.setEcpptval(-66); - if (cpp0x_thread_local.getEcpptval() != -66) + cpp11_thread_local.setEcpptval(-66); + if (cpp11_thread_local.getEcpptval() != -66) throw new RuntimeException(); } } diff --git a/Examples/test-suite/python/cpp0x_function_objects_runme.py b/Examples/test-suite/python/cpp0x_function_objects_runme.py deleted file mode 100644 index ed8f888b1..000000000 --- a/Examples/test-suite/python/cpp0x_function_objects_runme.py +++ /dev/null @@ -1,12 +0,0 @@ -import cpp0x_function_objects -import sys - -t = cpp0x_function_objects.Test() -if t.value != 0: - raise RuntimeError("Runtime cpp0x_function_objects failed. t.value should be 0, but is " + str(t.value)) - -t(1,2) # adds numbers and sets value - -if t.value != 3: - raise RuntimeError("Runtime cpp0x_function_objects failed. t.value not changed - should be 3, but is " + str(t.value)) - diff --git a/Examples/test-suite/python/cpp0x_initializer_list_extend_runme.py b/Examples/test-suite/python/cpp0x_initializer_list_extend_runme.py deleted file mode 100644 index b07231408..000000000 --- a/Examples/test-suite/python/cpp0x_initializer_list_extend_runme.py +++ /dev/null @@ -1,4 +0,0 @@ -import cpp0x_initializer_list_extend - -c = cpp0x_initializer_list_extend.Container( [10, 20, 30, 40] ) - diff --git a/Examples/test-suite/python/cpp0x_initializer_list_runme.py b/Examples/test-suite/python/cpp0x_initializer_list_runme.py deleted file mode 100644 index 5c8c153a5..000000000 --- a/Examples/test-suite/python/cpp0x_initializer_list_runme.py +++ /dev/null @@ -1,5 +0,0 @@ -import cpp0x_initializer_list - -a = cpp0x_initializer_list.A() -a = cpp0x_initializer_list.A(11.1) - diff --git a/Examples/test-suite/python/cpp0x_null_pointer_constant_runme.py b/Examples/test-suite/python/cpp0x_null_pointer_constant_runme.py deleted file mode 100644 index b80dcaf2f..000000000 --- a/Examples/test-suite/python/cpp0x_null_pointer_constant_runme.py +++ /dev/null @@ -1,15 +0,0 @@ -import cpp0x_null_pointer_constant - -a = cpp0x_null_pointer_constant.A() - -if a._myA != None: - raise RuntimeError, ("cpp0x_null_pointer_constant: _myA should be None, but is ", a._myA) - -b = cpp0x_null_pointer_constant.A() -if a._myA != b._myA: - raise RuntimeError, ("cpp0x_null_pointer_constant: a._myA should be the same as b._myA, but ", a._myA, "!=", b._myA) - -a._myA = cpp0x_null_pointer_constant.A() -if a._myA == None: - raise RuntimeError, ("cpp0x_null_pointer_constant: _myA should be object, but is None") - diff --git a/Examples/test-suite/python/cpp0x_result_of_runme.py b/Examples/test-suite/python/cpp0x_result_of_runme.py deleted file mode 100644 index 5411cd1ce..000000000 --- a/Examples/test-suite/python/cpp0x_result_of_runme.py +++ /dev/null @@ -1,3 +0,0 @@ -import cpp0x_result_of -if cpp0x_result_of.test_result(cpp0x_result_of.square, 3.0) != 9.0: - raise RuntimeError, "test_result(square, 3.0) is not 9.0." diff --git a/Examples/test-suite/python/cpp0x_alternate_function_syntax_runme.py b/Examples/test-suite/python/cpp11_alternate_function_syntax_runme.py similarity index 73% rename from Examples/test-suite/python/cpp0x_alternate_function_syntax_runme.py rename to Examples/test-suite/python/cpp11_alternate_function_syntax_runme.py index 8005cfab7..0a1c45716 100644 --- a/Examples/test-suite/python/cpp0x_alternate_function_syntax_runme.py +++ b/Examples/test-suite/python/cpp11_alternate_function_syntax_runme.py @@ -1,6 +1,6 @@ -import cpp0x_alternate_function_syntax +import cpp11_alternate_function_syntax -a = cpp0x_alternate_function_syntax.SomeStruct() +a = cpp11_alternate_function_syntax.SomeStruct() res = a.addNormal(4,5) if res != 9: diff --git a/Examples/test-suite/python/cpp0x_decltype_runme.py b/Examples/test-suite/python/cpp11_decltype_runme.py similarity index 86% rename from Examples/test-suite/python/cpp0x_decltype_runme.py rename to Examples/test-suite/python/cpp11_decltype_runme.py index ce742e6b2..bfcbbec79 100644 --- a/Examples/test-suite/python/cpp0x_decltype_runme.py +++ b/Examples/test-suite/python/cpp11_decltype_runme.py @@ -1,6 +1,6 @@ -import cpp0x_decltype +import cpp11_decltype -a = cpp0x_decltype.A() +a = cpp11_decltype.A() a.i = 5 if a.i != 5: raise RuntimeError, "Assignment to a.i failed." diff --git a/Examples/test-suite/python/cpp11_function_objects_runme.py b/Examples/test-suite/python/cpp11_function_objects_runme.py new file mode 100644 index 000000000..aac7f9c5f --- /dev/null +++ b/Examples/test-suite/python/cpp11_function_objects_runme.py @@ -0,0 +1,12 @@ +import cpp11_function_objects +import sys + +t = cpp11_function_objects.Test() +if t.value != 0: + raise RuntimeError("Runtime cpp11_function_objects failed. t.value should be 0, but is " + str(t.value)) + +t(1,2) # adds numbers and sets value + +if t.value != 3: + raise RuntimeError("Runtime cpp11_function_objects failed. t.value not changed - should be 3, but is " + str(t.value)) + diff --git a/Examples/test-suite/python/cpp11_initializer_list_extend_runme.py b/Examples/test-suite/python/cpp11_initializer_list_extend_runme.py new file mode 100644 index 000000000..eedf8f148 --- /dev/null +++ b/Examples/test-suite/python/cpp11_initializer_list_extend_runme.py @@ -0,0 +1,4 @@ +import cpp11_initializer_list_extend + +c = cpp11_initializer_list_extend.Container( [10, 20, 30, 40] ) + diff --git a/Examples/test-suite/python/cpp11_initializer_list_runme.py b/Examples/test-suite/python/cpp11_initializer_list_runme.py new file mode 100644 index 000000000..395cd610d --- /dev/null +++ b/Examples/test-suite/python/cpp11_initializer_list_runme.py @@ -0,0 +1,5 @@ +import cpp11_initializer_list + +a = cpp11_initializer_list.A() +a = cpp11_initializer_list.A(11.1) + diff --git a/Examples/test-suite/python/cpp11_null_pointer_constant_runme.py b/Examples/test-suite/python/cpp11_null_pointer_constant_runme.py new file mode 100644 index 000000000..d304c139d --- /dev/null +++ b/Examples/test-suite/python/cpp11_null_pointer_constant_runme.py @@ -0,0 +1,15 @@ +import cpp11_null_pointer_constant + +a = cpp11_null_pointer_constant.A() + +if a._myA != None: + raise RuntimeError, ("cpp11_null_pointer_constant: _myA should be None, but is ", a._myA) + +b = cpp11_null_pointer_constant.A() +if a._myA != b._myA: + raise RuntimeError, ("cpp11_null_pointer_constant: a._myA should be the same as b._myA, but ", a._myA, "!=", b._myA) + +a._myA = cpp11_null_pointer_constant.A() +if a._myA == None: + raise RuntimeError, ("cpp11_null_pointer_constant: _myA should be object, but is None") + diff --git a/Examples/test-suite/python/cpp0x_raw_string_literals_runme.py b/Examples/test-suite/python/cpp11_raw_string_literals_runme.py similarity index 95% rename from Examples/test-suite/python/cpp0x_raw_string_literals_runme.py rename to Examples/test-suite/python/cpp11_raw_string_literals_runme.py index ea7d16550..32282d8d8 100644 --- a/Examples/test-suite/python/cpp0x_raw_string_literals_runme.py +++ b/Examples/test-suite/python/cpp11_raw_string_literals_runme.py @@ -1,4 +1,4 @@ -from cpp0x_raw_string_literals import * +from cpp11_raw_string_literals import * if cvar.L != 100: raise RuntimeError diff --git a/Examples/test-suite/python/cpp11_result_of_runme.py b/Examples/test-suite/python/cpp11_result_of_runme.py new file mode 100644 index 000000000..a97dd7ccc --- /dev/null +++ b/Examples/test-suite/python/cpp11_result_of_runme.py @@ -0,0 +1,3 @@ +import cpp11_result_of +if cpp11_result_of.test_result(cpp11_result_of.square, 3.0) != 9.0: + raise RuntimeError, "test_result(square, 3.0) is not 9.0." diff --git a/Examples/test-suite/python/cpp0x_rvalue_reference_runme.py b/Examples/test-suite/python/cpp11_rvalue_reference_runme.py similarity index 90% rename from Examples/test-suite/python/cpp0x_rvalue_reference_runme.py rename to Examples/test-suite/python/cpp11_rvalue_reference_runme.py index 43fbc997e..a72a3e63b 100644 --- a/Examples/test-suite/python/cpp0x_rvalue_reference_runme.py +++ b/Examples/test-suite/python/cpp11_rvalue_reference_runme.py @@ -1,6 +1,6 @@ -import cpp0x_rvalue_reference +import cpp11_rvalue_reference -a = cpp0x_rvalue_reference.A() +a = cpp11_rvalue_reference.A() a.setAcopy(5) if a.getAcopy() != 5: diff --git a/Examples/test-suite/python/cpp0x_thread_local_runme.py b/Examples/test-suite/python/cpp11_thread_local_runme.py similarity index 94% rename from Examples/test-suite/python/cpp0x_thread_local_runme.py rename to Examples/test-suite/python/cpp11_thread_local_runme.py index ff27b7785..59a657488 100644 --- a/Examples/test-suite/python/cpp0x_thread_local_runme.py +++ b/Examples/test-suite/python/cpp11_thread_local_runme.py @@ -1,4 +1,4 @@ -from cpp0x_thread_local import * +from cpp11_thread_local import * t = ThreadLocals() if t.stval != 11: diff --git a/Examples/test-suite/python/cpp0x_uniform_initialization_runme.py b/Examples/test-suite/python/cpp11_uniform_initialization_runme.py similarity index 68% rename from Examples/test-suite/python/cpp0x_uniform_initialization_runme.py rename to Examples/test-suite/python/cpp11_uniform_initialization_runme.py index 42228f3d7..85c3b2478 100644 --- a/Examples/test-suite/python/cpp0x_uniform_initialization_runme.py +++ b/Examples/test-suite/python/cpp11_uniform_initialization_runme.py @@ -1,13 +1,13 @@ -import cpp0x_uniform_initialization +import cpp11_uniform_initialization -var1 = cpp0x_uniform_initialization.cvar.var1 +var1 = cpp11_uniform_initialization.cvar.var1 if var1.x != 5: raise RuntimeError -var2 = cpp0x_uniform_initialization.cvar.var2 +var2 = cpp11_uniform_initialization.cvar.var2 if var2.getX() != 2: raise RuntimeError -m = cpp0x_uniform_initialization.MoreInit() +m = cpp11_uniform_initialization.MoreInit() if m.charptr != None: raise RuntimeError, m.charptr m.charptr = "hello sir" diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index dc033ed7b..b6366d76d 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -1710,7 +1710,7 @@ static void tag_nodes(Node *n, const_String_or_char_ptr attrname, DOH *value) { %token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS %token ENUM %token CLASS TYPENAME PRIVATE PUBLIC PROTECTED COLON STATIC VIRTUAL FRIEND THROW CATCH EXPLICIT AUTO -%token STATIC_ASSERT CONSTEXPR THREAD_LOCAL DECLTYPE /* C++0x keywords */ +%token STATIC_ASSERT CONSTEXPR THREAD_LOCAL DECLTYPE /* C++11 keywords */ %token USING %token NAMESPACE %token NATIVE INLINE @@ -3258,7 +3258,7 @@ c_decl : storage_class type declarator initializer c_decl_tail { set_nextSibling($$,$5); } } - /* Alternate function syntax introduced in C++0x: + /* Alternate function syntax introduced in C++11: auto funcName(int x, int y) -> int; */ | storage_class AUTO declarator ARROW cpp_alternate_rettype initializer c_decl_tail { $$ = new_node("cdecl"); @@ -5330,7 +5330,7 @@ declarator : pointer notso_direct_declarator { } } | LAND notso_direct_declarator { - /* Introduced in C++0x, move operator && */ + /* Introduced in C++11, move operator && */ /* Adds one S/R conflict */ $$ = $2; $$.type = NewStringEmpty(); @@ -5427,7 +5427,7 @@ declarator : pointer notso_direct_declarator { } } | LAND PERIOD PERIOD PERIOD notso_direct_declarator { - /* Introduced in C++0x, move operator && */ + /* Introduced in C++11, move operator && */ /* Adds one S/R conflict */ $$ = $5; $$.type = NewStringEmpty(); @@ -6673,7 +6673,7 @@ mem_initializer : idcolon LPAREN { skip_balanced('(',')'); Clear(scanner_ccode); } - /* Uniform initialization in C++0x. + /* Uniform initialization in C++11. Example: struct MyStruct { MyStruct(int x, double y) : x_{x}, y_{y} {}