[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bison 3.7.90 (beta)
From: |
Akim Demaille |
Subject: |
Re: Bison 3.7.90 (beta) |
Date: |
Thu, 19 Aug 2021 08:46:20 +0200 |
Hi Dagobert,
> Le 13 août 2021 à 09:50, Dagobert Michelsen <dam@opencsw.org> a écrit :
>
> I see errors on Solaris 10 x86:
>
> CXX examples/c++/glr/examples_c___glr_c___types-c++-types.o
> "examples/c++/glr/c++-types.cc", line 734: Warning: The template qualifier
> can only be used within a template.
> "/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/algorithmfwd.h",
> line 582: Error: Could not find a match for std::swap<_Tp>(_Tp, _Tp) needed
> in glr_stack_item::operator=(glr_stack_item).
> "examples/c++/glr/c++-types.cc", line 1360: Where: While instantiating
> "void std::swap<char, 60>(char(&)[60], char(&)[60])".
> "examples/c++/glr/c++-types.cc", line 1360: Where: Instantiated from
> non-template code.
> "/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/algorithmfwd.h",
> line 582: Error: A constant expression is required here.
> "examples/c++/glr/c++-types.cc", line 1360: Where: While instantiating
> "void std::swap<char, 60>(char(&)[60], char(&)[60])".
> "examples/c++/glr/c++-types.cc", line 1360: Where: Instantiated from
> non-template code.
> "examples/c++/glr/c++-types.cc", line 2124: Warning: The template qualifier
> can only be used within a template.
> "examples/c++/glr/c++-types.cc", line 2220: Warning: The template qualifier
> can only be used within a template.
> "examples/c++/glr/c++-types.cc", line 2462: Warning: The template qualifier
> can only be used within a template.
> "examples/c++/glr/c++-types.cc", line 2858: Warning: The template qualifier
> can only be used within a template.
> "examples/c++/glr/c++-types.cc", line 3098: Warning: The template qualifier
> can only be used within a template.
> "examples/c++/glr/c++-types.cc", line 3147: Warning: The template qualifier
> can only be used within a template.
> 2 Error(s) and 7 Warning(s) detected.
> gmake[3]: *** [Makefile:9470:
> examples/c++/glr/examples_c___glr_c___types-c++-types.o] Error 2
For this part of the failures, I'm installing this:
commit 36f37568bac3ac9efb2917c5d68dea50a4a619c3
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Tue Aug 17 12:53:09 2021 +0200
glr2.cc: require C++11
Reported by Dagobert Michelsen.
https://lists.gnu.org/r/bug-bison/2021-08/msg00006.html
* m4/bison-cxx-std.m4 (_BISON_CXXSTD_98_snippet): We don't need
vector::data, it was only for glr2.cc, which is C++11 anyway.
(_BISON_CXXSTD_11_snippet): We need vector::data and std::swap on
arrays.
* m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): We don't need
vector::data.
* tests/local.at (AT_COMPILE_CXX): Skip when glr2.cc and no support
for C++11.
diff --git a/TODO b/TODO
index de240dda..2e6e7d5a 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,6 @@
+* 3.8
+Don't showcase multi start.
+
* Soon
** scan-code
The default case is scanning char-per-char.
@@ -183,7 +186,7 @@ Les catégories d'avertissements incluent :
Line -1 and -3 should mention CATEGORIE, not CATEGORY.
-* Bison 3.8
+* Bison 3.9
** Rewrite glr.cc (currently glr2.cc)
*** custom error messages
diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc
index edd05d89..d682a078 100644
--- a/data/skeletons/glr2.cc
+++ b/data/skeletons/glr2.cc
@@ -1370,7 +1370,6 @@ public:
check_ ();
other.check_ ();]])[
std::swap (is_state_, other.is_state_);
- // NB: swap on arrays is C++11.
std::swap (raw_, other.raw_);
return *this;
}
diff --git a/m4/bison-cxx-std.m4 b/m4/bison-cxx-std.m4
index 4a71d20f..dd8a5345 100644
--- a/m4/bison-cxx-std.m4
+++ b/m4/bison-cxx-std.m4
@@ -7,36 +7,22 @@
# with or without modifications, as long as this notice is preserved.
m4_define([_BISON_CXXSTD_98_snippet],
-[[#include <cassert>
-#include <vector>
-
-void cxx98_vector ()
-{
- typedef std::vector<int> ints;
-
- // Check support for std::vector<T,Allocator>::data.
- // GCC 4.2 on macOS claims to support C++98, but does not feature it.
- //
- // input.cc: In member function 'void state_stack::yycompressStack()':
- // input.cc:1774: error: 'class std::vector<glr_stack_item,
std::allocator<glr_stack_item> >' has no member named 'data'
- //
- //
<https://trac.macports.org/raw-attachment/ticket/59927/bison-test-results-20210811-95b72.log.xz>.
- ints my_ints;
- assert (my_ints.data () == &my_ints[0]);
-}
-]])
+[[]])
m4_define([_BISON_CXXSTD_03_snippet],
-[])
+[[]])
m4_define([_BISON_CXXSTD_11_snippet],
-[[#include <algorithm>
+[[ // C++11
+#include <algorithm>
+#include <cassert>
#include <memory>
#include <set>
#include <sstream>
#include <string>
+#include <utility> // std::swap
+#include <vector>
- // C++11
template <typename T>
struct check
{
@@ -80,6 +66,22 @@ m4_define([_BISON_CXXSTD_11_snippet],
// GCC 4.8.2 on Solaris 11.3 does not support to_string.
auto e = std::to_string(42);
+
+ // Needed by glr2.cc.
+ void cxx11_vector_data ()
+ {
+ std::vector<int> ints;
+ ints.emplace_back (42);
+ assert (ints.data () == &ints[0]);
+ }
+
+ // Needed by glr2.cc.
+ void cxx11_array_swap ()
+ {
+ int i0[4] = { 1, 2, 3, 4 };
+ int i1[4] = { 5, 6, 7, 8 };
+ std::swap (i0, i1);
+ }
]])
m4_define([_BISON_CXXSTD_14_snippet],
@@ -177,7 +179,7 @@ m4_define([_BISON_CXXSTD_testbody],
# BISON_CXXSTD(STD)
# -----------------
-# Check whether the C++ compiler support STD (11, 98, 2b, etc.).
+# Check whether the C++ compiler supports STD (11, 98, 2b, etc.).
# If it does, AC_SUBST 'CXX<STD>_CXXFLAGS' to the corresponding flags.
AC_DEFUN([BISON_CXXSTD],
[AC_REQUIRE([AC_PROG_CXX])
diff --git a/m4/cxx.m4 b/m4/cxx.m4
index 0a99fa27..1172f556 100644
--- a/m4/cxx.m4
+++ b/m4/cxx.m4
@@ -28,17 +28,13 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
- #include <cassert>
#include <cstdlib>
#include <iostream>
#include <map>
#include <string>
- #include <vector>
using namespace std;]],
[[std::cerr << "";
cout << "";
- std::vector<int> ints;
- assert(ints.data () == &ints[0]);
typedef std::pair<unsigned, int> uipair;
std::map<unsigned, int> m;
std::map<unsigned, int>::iterator i;
diff --git a/tests/local.at b/tests/local.at
index 39c9dbcd..bc43ee1c 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -1362,8 +1362,10 @@ m4_define([AT_COMPILE],
# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT
# with trailing ".o" removed, and ".cc" appended.
m4_define([AT_COMPILE_CXX],
-[AT_KEYWORDS(c++)
+[AT_KEYWORDS([c++])
AT_SKIP_IF([[! $BISON_CXX_WORKS]])
+m4_ifdef([AT_GLR2_CC_IF],
+ [AT_GLR2_CC_IF([AT_SKIP_IF([[test x"$CXX11_CXXFLAGS" == x]])])])
AT_CHECK(m4_join([ ],
[$CXX $CXXFLAGS $CPPFLAGS $3],
[m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])],
diff --git a/tests/output.at b/tests/output.at
index d17098e2..e2615161 100644
--- a/tests/output.at
+++ b/tests/output.at
@@ -744,6 +744,7 @@ m4_pushdef([AT_TEST],
AT_SETUP([C++ Output File Prefix Mapping])
# AT_TEST([PREFIX], [DIRECTIVES])
+# -------------------------------
m4_pushdef([AT_TEST],
[AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" %define api.namespace {$1} $2])
AT_LOC_PUSHDEF([begin.line], [begin.column], [end.line], [end.column])
- Re: Bison 3.7.90 (beta): test 4, (continued)
- Re: Bison 3.7.90 (beta): test 4, Dagobert Michelsen, 2021/08/19
- Re: Bison 3.7.90 (beta): test 4, Akim Demaille, 2021/08/19
- Re: Bison 3.7.90 (beta): test 4, Dagobert Michelsen, 2021/08/19
- Re: Bison 3.7.90 (beta): test 4, Akim Demaille, 2021/08/19
- Re: Bison 3.7.90 (beta): test 4, Dagobert Michelsen, 2021/08/19
- Re: Bison 3.7.90 (beta): test 4, Akim Demaille, 2021/08/20
- Re: Bison 3.7.90 (beta): test 4, Dagobert Michelsen, 2021/08/23
- Re: Bison 3.7.90 (beta): test 4, Akim Demaille, 2021/08/29
- Re: Bison 3.7.90 (beta): test 4, Dagobert Michelsen, 2021/08/29
- Re: Bison 3.7.90 (beta): example/c/lexcalc, Akim Demaille, 2021/08/19
Re: Bison 3.7.90 (beta),
Akim Demaille <=