mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 10:15:14 +00:00
Compare commits
13
Commits
8d101c19d4
...
v3.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fb8b11152 | ||
|
|
2a1aefbf76 | ||
|
|
734b0ce45d | ||
|
|
59bcaebfae | ||
|
|
680b715518 | ||
|
|
2eb1ad9ef3 | ||
|
|
0360a35228 | ||
|
|
2e053317c8 | ||
|
|
33c788d37b | ||
|
|
c03d0d9625 | ||
|
|
bf7abf4849 | ||
|
|
2731332150 | ||
|
|
554a12102e |
+1
-1
@@ -1 +1 @@
|
|||||||
3.2
|
3.2.1
|
||||||
|
|||||||
+22
-5
@@ -30,7 +30,9 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
||||||
|
|
||||||
- name: "Clang 7 libc++ and ASAN"
|
# ASAN is time consuming, and we timeout the 50min granted by
|
||||||
|
# Travis if we run all the tests in on go. Run in two parts.
|
||||||
|
- name: "Clang 7 libc++ and ASAN part 1"
|
||||||
os: linux
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@@ -43,7 +45,22 @@ matrix:
|
|||||||
- libc++abi-7-dev
|
- libc++abi-7-dev
|
||||||
env:
|
env:
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
- MATRIX_EVAL="CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
- MATRIX_EVAL="PART=1 CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
||||||
|
|
||||||
|
- name: "Clang 7 libc++ and ASAN part 2"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libc++-7-dev
|
||||||
|
- libc++abi-7-dev
|
||||||
|
env:
|
||||||
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
|
- MATRIX_EVAL="PART=2 CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
||||||
|
|
||||||
- name: "ICC"
|
- name: "ICC"
|
||||||
os: linux
|
os: linux
|
||||||
@@ -292,9 +309,9 @@ script:
|
|||||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||||
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
||||||
- make -j2 $MAKE_ARGS
|
- make -j2 $MAKE_ARGS
|
||||||
- make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
- if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
- make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
- if test ${PART-1} = 1; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
- make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
- if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
GNU Bison NEWS
|
GNU Bison NEWS
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.2.2 (2018-11-21) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
C++ portability issues.
|
||||||
|
|
||||||
* Noteworthy changes in release 3.2.1 (2018-11-09) [stable]
|
* Noteworthy changes in release 3.2.1 (2018-11-09) [stable]
|
||||||
|
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ Roland Levillain [email protected]
|
|||||||
Satya Kiran Popuri [email protected]
|
Satya Kiran Popuri [email protected]
|
||||||
Sebastian Setzer [email protected]
|
Sebastian Setzer [email protected]
|
||||||
Sebastien Fricker [email protected]
|
Sebastien Fricker [email protected]
|
||||||
|
Sébastien Villemot [email protected]
|
||||||
Sergei Steshenko [email protected]
|
Sergei Steshenko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
Simon Sobisch [email protected]
|
Simon Sobisch [email protected]
|
||||||
|
|||||||
+9
-3
@@ -53,8 +53,14 @@ m4_define([b4_inline],
|
|||||||
# b4_cxx_portability
|
# b4_cxx_portability
|
||||||
# ------------------
|
# ------------------
|
||||||
m4_define([b4_cxx_portability],
|
m4_define([b4_cxx_portability],
|
||||||
[// Support move semantics when possible.
|
[#if defined __cplusplus
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
# define YY_CPLUSPLUS __cplusplus
|
||||||
|
#else
|
||||||
|
# define YY_CPLUSPLUS 199711L
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Support move semantics when possible.
|
||||||
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
# define YY_MOVE std::move
|
# define YY_MOVE std::move
|
||||||
# define YY_MOVE_OR_COPY move
|
# define YY_MOVE_OR_COPY move
|
||||||
# define YY_MOVE_REF(Type) Type&&
|
# define YY_MOVE_REF(Type) Type&&
|
||||||
@@ -272,7 +278,7 @@ m4_define([b4_symbol_type_declare],
|
|||||||
location_type location;])[
|
location_type location;])[
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if !defined __cplusplus || __cplusplus < 201103L
|
#if YY_CPLUSPLUS < 201103L
|
||||||
/// Assignment operator.
|
/// Assignment operator.
|
||||||
basic_symbol& operator= (const basic_symbol& other);
|
basic_symbol& operator= (const basic_symbol& other);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -706,7 +706,7 @@ struct yyGLRStack {
|
|||||||
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static _Noreturn void
|
_Noreturn static void
|
||||||
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||||
{
|
{
|
||||||
if (yymsg != YY_NULLPTR)
|
if (yymsg != YY_NULLPTR)
|
||||||
@@ -714,7 +714,7 @@ yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
|||||||
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static _Noreturn void
|
_Noreturn static void
|
||||||
yyMemoryExhausted (yyGLRStack* yystackp)
|
yyMemoryExhausted (yyGLRStack* yystackp)
|
||||||
{
|
{
|
||||||
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
||||||
|
|||||||
+4
-4
@@ -336,7 +336,7 @@ m4_define([b4_shared_declarations],
|
|||||||
stack_symbol_type (YY_RVREF (stack_symbol_type) that);
|
stack_symbol_type (YY_RVREF (stack_symbol_type) that);
|
||||||
/// Steal the contents from \a sym to build this.
|
/// Steal the contents from \a sym to build this.
|
||||||
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
||||||
#if !defined __cplusplus || __cplusplus < 201103L
|
#if YY_CPLUSPLUS < 201103L
|
||||||
/// Assignment, needed by push_back by some old implementations.
|
/// Assignment, needed by push_back by some old implementations.
|
||||||
/// Moves the contents of that.
|
/// Moves the contents of that.
|
||||||
stack_symbol_type& operator= (stack_symbol_type& that);
|
stack_symbol_type& operator= (stack_symbol_type& that);
|
||||||
@@ -612,7 +612,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
{]b4_variant_if([
|
{]b4_variant_if([
|
||||||
b4_symbol_variant([that.type_get ()],
|
b4_symbol_variant([that.type_get ()],
|
||||||
[value], [YY_MOVE_OR_COPY], [YY_MOVE (that.value)])])[
|
[value], [YY_MOVE_OR_COPY], [YY_MOVE (that.value)])])[
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
// that is emptied.
|
// that is emptied.
|
||||||
that.state = empty_state;
|
that.state = empty_state;
|
||||||
#endif
|
#endif
|
||||||
@@ -627,7 +627,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
that.type = empty_symbol;
|
that.type = empty_symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined __cplusplus || __cplusplus < 201103L
|
#if YY_CPLUSPLUS < 201103L
|
||||||
]b4_parser_class_name[::stack_symbol_type&
|
]b4_parser_class_name[::stack_symbol_type&
|
||||||
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
||||||
{
|
{
|
||||||
@@ -685,7 +685,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
void
|
void
|
||||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
||||||
{
|
{
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
||||||
#else
|
#else
|
||||||
stack_symbol_type ss (s, sym);
|
stack_symbol_type ss (s, sym);
|
||||||
|
|||||||
+30
-12
@@ -125,7 +125,7 @@ m4_define([b4_variant_define],
|
|||||||
return *new (yyas_<T> ()) T ();
|
return *new (yyas_<T> ()) T ();
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if 201103L <= YY_CPLUSPLUS
|
||||||
/// Instantiate a \a T in here from \a t.
|
/// Instantiate a \a T in here from \a t.
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
T&
|
T&
|
||||||
@@ -213,7 +213,7 @@ m4_define([b4_variant_define],
|
|||||||
void
|
void
|
||||||
move (self_type& other)
|
move (self_type& other)
|
||||||
{
|
{
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if 201103L <= YY_CPLUSPLUS
|
||||||
emplace<T> (std::move (other.as<T> ()));
|
emplace<T> (std::move (other.as<T> ()));
|
||||||
# else
|
# else
|
||||||
emplace<T> ();
|
emplace<T> ();
|
||||||
@@ -222,7 +222,7 @@ m4_define([b4_variant_define],
|
|||||||
other.destroy<T> ();
|
other.destroy<T> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if 201103L <= YY_CPLUSPLUS
|
||||||
/// Move the content of \a other to this.
|
/// Move the content of \a other to this.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
@@ -379,26 +379,44 @@ b4_join(b4_symbol_if([$1], [has_type],
|
|||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
# Generate a constructor declaration for basic_symbol from given type.
|
# Generate a constructor declaration for basic_symbol from given type.
|
||||||
m4_define([b4_basic_symbol_constructor_declare],
|
m4_define([b4_basic_symbol_constructor_declare],
|
||||||
[[ basic_symbol (]b4_join(
|
[[# if 201103L <= YY_CPLUSPLUS
|
||||||
|
basic_symbol (]b4_join(
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
b4_symbol_if([$1], [has_type], [b4_symbol([$1], [type])&& v]),
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[);
|
b4_locations_if([location_type&& l]))[);
|
||||||
|
#else
|
||||||
|
basic_symbol (]b4_join(
|
||||||
|
[typename Base::kind_type t],
|
||||||
|
b4_symbol_if([$1], [has_type], [const b4_symbol([$1], [type])& v]),
|
||||||
|
b4_locations_if([const location_type& l]))[);
|
||||||
|
#endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# b4_basic_symbol_constructor_define
|
# b4_basic_symbol_constructor_define
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# Generate a constructor implementation for basic_symbol from given type.
|
# Generate a constructor implementation for basic_symbol from given type.
|
||||||
m4_define([b4_basic_symbol_constructor_define],
|
m4_define([b4_basic_symbol_constructor_define],
|
||||||
[[ template <typename Base>
|
[[# if 201103L <= YY_CPLUSPLUS
|
||||||
|
template <typename Base>
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
b4_symbol_if([$1], [has_type], [b4_symbol([$1], [type])&& v]),
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[)
|
b4_locations_if([location_type&& l]))[)
|
||||||
: Base (t)]b4_symbol_if([$1], [has_type], [
|
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||||
, value (YY_MOVE (v))])[]b4_locations_if([
|
, value (std::move (v))])[]b4_locations_if([
|
||||||
, location (YY_MOVE (l))])[
|
, location (std::move (l))])[
|
||||||
{}
|
{}
|
||||||
|
#else
|
||||||
|
template <typename Base>
|
||||||
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
|
[typename Base::kind_type t],
|
||||||
|
b4_symbol_if([$1], [has_type], [const b4_symbol([$1], [type])& v]),
|
||||||
|
b4_locations_if([const location_type& l]))[)
|
||||||
|
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||||
|
, value (v)])[]b4_locations_if([
|
||||||
|
, location (l)])[
|
||||||
|
{}
|
||||||
|
#endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# b4_symbol_constructor_define
|
# b4_symbol_constructor_define
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ if ENABLE_CXX14
|
|||||||
check_PROGRAMS += %D%/simple
|
check_PROGRAMS += %D%/simple
|
||||||
nodist_%C%_simple_SOURCES = $(simple_sources)
|
nodist_%C%_simple_SOURCES = $(simple_sources)
|
||||||
|
|
||||||
%C%_simple_CXXFLAGS = $(CXX11_CXXFLAGS)
|
%C%_simple_CXXFLAGS = $(CXX11_CXXFLAGS) $(WARN_CXXFLAGS_TEST)
|
||||||
# Don't use gnulib's system headers.
|
# Don't use gnulib's system headers.
|
||||||
%C%_simple_CPPFLAGS = -I$(top_builddir)
|
%C%_simple_CPPFLAGS = -I$(top_builddir)
|
||||||
TESTS += %D%/simple.test
|
TESTS += %D%/simple.test
|
||||||
@@ -58,7 +58,7 @@ EXTRA_DIST += %D%/variant.test
|
|||||||
if ENABLE_CXX11
|
if ENABLE_CXX11
|
||||||
check_PROGRAMS += %D%/variant-11
|
check_PROGRAMS += %D%/variant-11
|
||||||
nodist_%C%_variant_11_SOURCES = %D%/variant-11.yy
|
nodist_%C%_variant_11_SOURCES = %D%/variant-11.yy
|
||||||
%C%_variant_11_CXXFLAGS = $(CXX11_CXXFLAGS)
|
%C%_variant_11_CXXFLAGS = $(CXX11_CXXFLAGS) $(WARN_CXXFLAGS_TEST)
|
||||||
# Don't use gnulib's system headers.
|
# Don't use gnulib's system headers.
|
||||||
%C%_variant_11_CPPFLAGS = -I$(top_builddir)
|
%C%_variant_11_CPPFLAGS = -I$(top_builddir)
|
||||||
TESTS += %D%/variant-11.test
|
TESTS += %D%/variant-11.test
|
||||||
|
|||||||
@@ -37,9 +37,8 @@
|
|||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
{
|
{
|
||||||
#include <algorithm>
|
#include <climits> // INT_MIN, INT_MAX
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
@@ -141,7 +140,10 @@ int
|
|||||||
main (int argc, const char *argv[])
|
main (int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
if (2 <= argc && isdigit (*argv[1]))
|
if (2 <= argc && isdigit (*argv[1]))
|
||||||
max = strtol (argv[1], nullptr, 10);
|
{
|
||||||
|
auto maxl = strtol (argv[1], nullptr, 10);
|
||||||
|
max = INT_MIN <= maxl && maxl <= INT_MAX ? int(maxl) : 4;
|
||||||
|
}
|
||||||
auto&& p = yy::parser{};
|
auto&& p = yy::parser{};
|
||||||
p.set_debug_level (!!getenv ("YYDEBUG"));
|
p.set_debug_level (!!getenv ("YYDEBUG"));
|
||||||
return p.parse ();
|
return p.parse ();
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ typedef std::vector<std::string> strings_type;
|
|||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
{
|
{
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: a79f2a2871...48a6c46b0b
@@ -190,3 +190,4 @@
|
|||||||
/localtime-buffer.m4
|
/localtime-buffer.m4
|
||||||
/sys_resource_h.m4
|
/sys_resource_h.m4
|
||||||
/timespec.m4
|
/timespec.m4
|
||||||
|
/intl-thread-locale.m4
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ AT_CHECK([[$PERL -n -0777 -e '
|
|||||||
|YYUSE
|
|YYUSE
|
||||||
|YY_ATTRIBUTE(?:_PURE|_UNUSED)?
|
|YY_ATTRIBUTE(?:_PURE|_UNUSED)?
|
||||||
|YY_COPY
|
|YY_COPY
|
||||||
|
|YY_CPLUSPLUS
|
||||||
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|
||||||
|YY_INITIAL_VALUE
|
|YY_INITIAL_VALUE
|
||||||
|YY_MOVE
|
|YY_MOVE
|
||||||
|
|||||||
+37
-20
@@ -539,6 +539,9 @@ main (int argc, char const* argv[])
|
|||||||
return ]AT_NAME_PREFIX[parse ();
|
return ]AT_NAME_PREFIX[parse ();
|
||||||
}]])
|
}]])
|
||||||
|
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD(c)],
|
||||||
|
[$1])
|
||||||
|
|
||||||
|
|
||||||
## ----- ##
|
## ----- ##
|
||||||
## C++. ##
|
## C++. ##
|
||||||
@@ -573,21 +576,24 @@ main (int argc, char const* argv[])
|
|||||||
return p.parse ();
|
return p.parse ();
|
||||||
}]])
|
}]])
|
||||||
|
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD(c++)],
|
||||||
|
[AT_FOR_EACH_CXX([$1])])
|
||||||
|
|
||||||
m4_define([AT_FOR_EACH_CXX],
|
m4_define([AT_FOR_EACH_CXX],
|
||||||
[[at_for_each_cxx_CXXFLAGS_save=$CXXFLAGS
|
[[at_for_each_std_CXXFLAGS_save=$CXXFLAGS
|
||||||
for at_cxx_std in '' \
|
for at_std in '' \
|
||||||
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
|
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
|
||||||
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
|
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
|
||||||
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
|
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
|
||||||
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
|
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
|
||||||
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
|
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
|
||||||
${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"}
|
${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"}
|
||||||
do
|
do
|
||||||
]AS_ECHO(["======== Testing with C++ standard flags: '$at_cxx_std'"])[
|
]AS_ECHO(["======== Testing with C++ standard flags: '$at_cxx_std'"])[
|
||||||
CXXFLAGS="$at_for_each_cxx_CXXFLAGS_save $at_cxx_std"
|
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
|
||||||
]$1[
|
]$1[
|
||||||
done
|
done
|
||||||
CXXFLAGS=$at_for_each_cxx_CXXFLAGS_save
|
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
|
||||||
]])
|
]])
|
||||||
|
|
||||||
## ------ ##
|
## ------ ##
|
||||||
@@ -619,7 +625,8 @@ m4_define([AT_MAIN_DEFINE(java)],
|
|||||||
}
|
}
|
||||||
}]])
|
}]])
|
||||||
|
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD(java)],
|
||||||
|
[$1])
|
||||||
|
|
||||||
## --------------- ##
|
## --------------- ##
|
||||||
## Running Bison. ##
|
## Running Bison. ##
|
||||||
@@ -819,6 +826,11 @@ AT_CHECK([[$SHELL ../../../javacomp.sh ]$1],
|
|||||||
[[0]], [ignore], [ignore])])
|
[[0]], [ignore], [ignore])])
|
||||||
|
|
||||||
|
|
||||||
|
# AT_LANG_FOR_EACH_STD(BODY)
|
||||||
|
# -------------------------------
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD], [AT_LANG_DISPATCH([$0], $@)])
|
||||||
|
|
||||||
|
|
||||||
# AT_LANG_COMPILE(OUTPUT, [SOURCES = OUTPUT.c], [EXTRA-COMPILER-FLAGS])
|
# AT_LANG_COMPILE(OUTPUT, [SOURCES = OUTPUT.c], [EXTRA-COMPILER-FLAGS])
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Compile SOURCES into OUTPUT. Skip if compiler does not work.
|
# Compile SOURCES into OUTPUT. Skip if compiler does not work.
|
||||||
@@ -904,11 +916,11 @@ AT_PARSER_CHECK([./c-and-cxx])
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# AT_REQUIRE_CXX_VERSION(STD)
|
# AT_REQUIRE_CXX_STD(STD, [IF-FAIL = SKIP])
|
||||||
# ---------------------------
|
# -----------------------------------------
|
||||||
# Skip unless this compiler supports at least C++ STD (e.g., "11",
|
# Skip unless this compiler supports at least C++ STD (e.g., "11",
|
||||||
# "14", etc.).
|
# "14", etc.).
|
||||||
m4_define([AT_REQUIRE_CXX_VERSION],
|
m4_define([AT_REQUIRE_CXX_STD],
|
||||||
[AT_DATA([check.cc],
|
[AT_DATA([check.cc],
|
||||||
[[int main ()
|
[[int main ()
|
||||||
{
|
{
|
||||||
@@ -920,14 +932,19 @@ m4_define([AT_REQUIRE_CXX_VERSION],
|
|||||||
[17], [201703],
|
[17], [201703],
|
||||||
[2a], [201709],
|
[2a], [201709],
|
||||||
[m4_fatal([$0: invalid arguments: $@])])[
|
[m4_fatal([$0: invalid arguments: $@])])[
|
||||||
return 77;
|
return 1;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
AT_COMPILE_CXX([check])
|
AT_COMPILE_CXX([check])
|
||||||
AT_CHECK([@&t@./check])
|
AT_CHECK([@&t@./check], [ignore])
|
||||||
|
m4_ifval([$2],
|
||||||
|
[if test $at_status != 0; then
|
||||||
|
$2
|
||||||
|
fi],
|
||||||
|
[SKIP_IF([test $at_status != 0])])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -940,11 +957,11 @@ m4_define([AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR],
|
|||||||
[[#include <iostream>
|
[[#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
void foo()
|
void foo ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
throw std::runtime_error("foo");
|
throw std::runtime_error ("foo");
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@@ -953,11 +970,11 @@ void foo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foo();
|
foo ();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -396,7 +396,7 @@ AT_BISON_OPTION_PUSHDEFS([%skeleton "$1"])
|
|||||||
# properly to the linker, and is unable to save a file named this way.
|
# properly to the linker, and is unable to save a file named this way.
|
||||||
# Don't try with such compilers.
|
# Don't try with such compilers.
|
||||||
AT_DATA([\"\\\"\".c],
|
AT_DATA([\"\\\"\".c],
|
||||||
[[int main() { return 0; }
|
[[int main (void) { return 0; }
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([AT_CXX_IF([$CXX $CXXFLAGS], [$CC $CFLAGS]) $CPPFLAGS \"\\\"\".c -o \"\\\"\" ||
|
AT_CHECK([AT_CXX_IF([$CXX $CXXFLAGS], [$CC $CFLAGS]) $CPPFLAGS \"\\\"\".c -o \"\\\"\" ||
|
||||||
|
|||||||
+25
-4
@@ -78,7 +78,7 @@ m4_pushdef([_AT_TEST],
|
|||||||
[
|
[
|
||||||
AT_SETUP([$1])
|
AT_SETUP([$1])
|
||||||
AT_KEYWORDS([api.value.type])
|
AT_KEYWORDS([api.value.type])
|
||||||
$7
|
|
||||||
AT_BISON_OPTION_PUSHDEFS([%debug $1 $2])
|
AT_BISON_OPTION_PUSHDEFS([%debug $1 $2])
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[%debug
|
[[%debug
|
||||||
@@ -104,9 +104,12 @@ start: $3;
|
|||||||
]AT_MAIN_DEFINE[
|
]AT_MAIN_DEFINE[
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_FULL_COMPILE([[test]])
|
AT_LANG_FOR_EACH_STD([
|
||||||
AT_PARSER_CHECK([[./test]], 0, [[$6
|
$7
|
||||||
|
AT_FULL_COMPILE([[test]])
|
||||||
|
AT_PARSER_CHECK([[./test]], 0, [[$6
|
||||||
]])
|
]])
|
||||||
|
])
|
||||||
|
|
||||||
AT_BISON_OPTION_POPDEFS
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
@@ -267,6 +270,24 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
|||||||
AT_VAL.build<std::string> ("two");],
|
AT_VAL.build<std::string> ("two");],
|
||||||
[10, two])
|
[10, two])
|
||||||
|
|
||||||
|
# Test a regression where we passed user types (we can include
|
||||||
|
# commas) to a CPP macro.
|
||||||
|
AT_TEST([%skeleton "]b4_skel["
|
||||||
|
%define api.value.type variant],
|
||||||
|
[%token <std::pair<int, int>> '1';
|
||||||
|
%token <std::pair<std::string, std::string>> '2';],
|
||||||
|
['1' '2'
|
||||||
|
{
|
||||||
|
std::cout << $1.first << ':' << $1.second << ", "
|
||||||
|
<< $2.first << ':' << $2.second << '\n';
|
||||||
|
}],
|
||||||
|
["12"],
|
||||||
|
[if (res == '1')
|
||||||
|
AT_VAL.build (std::make_pair (10, 11));
|
||||||
|
else if (res == '2')
|
||||||
|
AT_VAL.build (std::make_pair<std::string, std::string> ("two", "deux"));],
|
||||||
|
[10:11, two:deux])
|
||||||
|
|
||||||
# Move-only types.
|
# Move-only types.
|
||||||
AT_TEST([%skeleton "]b4_skel["
|
AT_TEST([%skeleton "]b4_skel["
|
||||||
%code requires { #include <memory> }
|
%code requires { #include <memory> }
|
||||||
@@ -282,7 +303,7 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
|||||||
]AT_VAL[.emplace <std::unique_ptr<std::string>>
|
]AT_VAL[.emplace <std::unique_ptr<std::string>>
|
||||||
(std::make_unique <std::string> ("two"));]],
|
(std::make_unique <std::string> ("two"));]],
|
||||||
[10, two],
|
[10, two],
|
||||||
[AT_REQUIRE_CXX_VERSION(14)])])
|
[AT_REQUIRE_CXX_STD(14, [echo "$at_std not supported"; continue])])])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user