diff options
author | Olly Betts <olly@survex.com> | 2015-01-08 15:56:50 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2015-01-08 15:56:50 +1300 |
commit | 87bdaa3910ebf9ba74704f9753970a83906e7507 (patch) | |
tree | da224f9c4b3fa2174fcc8e160b93b10f90344e09 | |
parent | 62670e756e188e03bb78cc5f371dfa88989783cc (diff) | |
download | swig-87bdaa3910ebf9ba74704f9753970a83906e7507.tar.gz |
Allow C++11 "explicit constexpr"
-rw-r--r-- | CHANGES.current | 4 | ||||
-rw-r--r-- | Examples/test-suite/cpp11_constexpr.i | 2 | ||||
-rw-r--r-- | Source/CParse/parser.y | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/CHANGES.current b/CHANGES.current index 564135d08..880453b53 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -6,6 +6,10 @@ Version 3.0.4 (in progress) =========================== 2015-01-08: olly + Allow C++11 "explicit constexpr". Fixes github issue#284 reported + by Paweł Tomulik. + +2015-01-08: olly When reporting an error for a construct which hasn't been terminated when the end of the file is reached, report it at the start line rather than "EOF" as then tools like editors and IDEs diff --git a/Examples/test-suite/cpp11_constexpr.i b/Examples/test-suite/cpp11_constexpr.i index 412b8132a..d8de0ae1d 100644 --- a/Examples/test-suite/cpp11_constexpr.i +++ b/Examples/test-suite/cpp11_constexpr.i @@ -18,6 +18,8 @@ struct ConstExpressions { static const int LLL = 300; constexpr int MMM() { return 400; } constexpr const int NNN() { return 500; } + // Regression test for https://github.com/swig/swig/issues/284 : + explicit constexpr ConstExpressions(int) { } }; %} diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 9de6a1b07..5e4dc24d7 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -4680,6 +4680,7 @@ storage_class : EXTERN { $$ = "extern"; } | FRIEND { $$ = "friend"; } | EXPLICIT { $$ = "explicit"; } | CONSTEXPR { $$ = "constexpr"; } + | EXPLICIT CONSTEXPR { $$ = "explicit constexpr"; } | STATIC CONSTEXPR { $$ = "static constexpr"; } | THREAD_LOCAL { $$ = "thread_local"; } | THREAD_LOCAL STATIC { $$ = "static thread_local"; } |