[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++17 skeleton with move semantics and std::variant

From: Hans Åberg
Subject: Re: C++17 skeleton with move semantics and std::variant
Date: Mon, 9 Apr 2018 20:26:59 +0200

> On 9 Apr 2018, at 20:15, Hans Åberg <address@hidden> wrote:
>> On 9 Apr 2018, at 19:19, Frank Heckenbach <address@hidden> wrote:
>> Hans Åberg wrote:
>> You should apply the patch in /usr/share/bison (or your respective
>> Bison data directory), not in your build directory (where a stack.hh
>> exists, but is different, being generated from the stack.hh
>> template, so the patch fails; and location.cc won't exist, instead
>> position.hh and location.hh are generated from it).
>> So, try this:
>> cd /usr/share/bison
>> sudo patch < /path/to/extra-header-prefix.diff
>> cd /your/source/dir
>> rm -f stack.hh position.hh location.hh
>> make clean
>> make
> I wouldn't do that for two reasons: screwing up the installation, and 
> security reasons - one should do the changes while not root, and copy them to 
> the installation location.

One can though do:
$ cp -R /usr/local/share/bison/ data
$ cd data
$ patch < ../patch-c++.txt
patching file stack.hh
Hunk #1 succeeded at 129 (offset -1 lines).
Hunk #2 succeeded at 145 (offset -1 lines).
patching file location.cc
Hunk #1 succeeded at 290 (offset -4 lines).
Hunk #2 succeeded at 309 (offset -4 lines).
patching file lalr1.cc

Followed by (as root)
# cp c++17.m4 lalr1-c++17.cc stack-c++11.hh variant-c++17.hh 

But I get the same error as before:
$ make clean
rm -f calc-c++17-scanner.cc calc-c++17-parser.cc calc-c++17-parser.hh 
calc-c++17-position.hh calc-c++17-location.hh calc-c++17-stack.hh 
calc-c++17-scanner.o calc-c++17-parser.o calc-c++17-driver.o calc-c++17.o 
calc-c++17 input

$ ls
Makefile                calc-c++17-driver.hh    calc-c++17-scanner.ll   
calc-c++17.test         position.hh
calc-c++17-driver.cc    calc-c++17-parser.yy    calc-c++17.cc           
location.hh             test.txt

$ rm location.hh position.hh 

$ make
bison -Wall -o "calc-c++17-parser.cc" "calc-c++17-parser.yy"
flex -o "calc-c++17-scanner.cc" "calc-c++17-scanner.ll"
g++ --std=c++17   -c -o calc-c++17-scanner.o calc-c++17-scanner.cc
In file included from calc-c++17-driver.hh:5:0,
                 from calc-c++17-scanner.ll:6:
calc-c++17-parser.hh:61:11: fatal error: calc-c++17-location.hh: No such file 
or directory
 # include "calc-c++17-location.hh"
compilation terminated.
make: *** [calc-c++17-scanner.o] Error 1
rm calc-c++17-scanner.cc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]