hackt icon indicating copy to clipboard operation
hackt copied to clipboard

gcc 5.2.1 doesn't like the STL wrappers

Open ghost opened this issue 9 years ago • 6 comments

In file included from ./util/sublist.hh:11:0, from :0: ./util/STL/list_fwd.hh:22:10: error: reference to ‘list’ is ambiguous typedef list<T, std::allocator<T> > type; ^ ./util/STL/list_fwd.hh:18:7: note: candidates are: template<class T, class Alloc> class std::list class list; ^ In file included from /usr/include/c++/5/list:63:0, from ./util/sublist.hh:10, from :0: /usr/include/c++/5/bits/stl_list.h:507:11: note: template<class _Tp, class _Alloc> class std::__cxx11::list class list : protected _List_base<_Tp, _Alloc> ^ Makefile:7090: recipe for target 'util/sublist.hhchk' failed

ghost avatar Nov 21 '15 17:11 ghost

Eh, I was logged into the wrong account... Oh well.

nbingham@Lira:~/src/hackt$ gcc --version
gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nbingham@Lira:~/src/hackt$ g++ --version
g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nbingham1 avatar Nov 21 '15 18:11 nbingham1

It seems as though this applies for clang as well (This was a fresh clone):

nbingham@Lira:~/src/hackt$ clang --version
Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
nbingham@Lira:~/src/hackt$ ./bootstrap
nbingham@Lira:~/src/hackt$ ./configure CXX=clang CC=clang
nbingham@Lira:~/src/hackt$ make
./util/STL/list_fwd.hh:22:10: error: unknown type name 'list'
        typedef list<T, std::allocator<T> >     type;
                ^
./util/STL/list_fwd.hh:22:14: error: expected member name or ';' after declaration specifiers
        typedef list<T, std::allocator<T> >     type;
        ~~~~~~~~~~~~^

nbingham1 avatar Nov 24 '15 03:11 nbingham1

I actually looked at this a few months ago, and started trying to make my forward declaration headers work with GNU libstdc++ and (clang) libc++, and it was a significant (unfinished) effort. I'm thinking that maybe it's not worth maintaining these forward declaration headers -- one option is to scrap them in favor of including standard full headers (, ) at the expense of increased compile time in some cases.

fangism avatar May 03 '16 22:05 fangism

Increased compile time for something shouldn't often be compiled is not such a terrible thing.

On Tue, May 3, 2016 at 6:55 PM, David Fang [email protected] wrote:

I actually looked at this a few months ago, and started trying to make my forward declaration headers work with GNU libstdc++ and (clang) libc++, and it was a significant (unfinished) effort. I'm thinking that maybe it's not worth maintaining these forward declaration headers -- one option is to scrap them in favor of including standard full headers (, ) at the expense of increased compile time in some cases.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/fangism/hackt/issues/40#issuecomment-216689461

ghost avatar May 06 '16 13:05 ghost

I just ran into this same error while compiling with gcc 6.3.1. Is there a workaround?

tadeoman avatar May 08 '17 04:05 tadeoman

Somehow this message escaped my attention. Workaround is to replace these silly headers with the original header, like . Need to find time to modernize the codebase...

fangism avatar Dec 15 '17 20:12 fangism