Bug 51699 - Clang refuses to compile ext/rope citing scope resolution issues
Summary: Clang refuses to compile ext/rope citing scope resolution issues
Status: RESOLVED DUPLICATE of bug 24163
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.6.2
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-29 03:23 UTC by fedorabugmail
Modified: 2011-12-29 15:22 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fedorabugmail 2011-12-29 03:23:52 UTC
When using clang to compile an existing program, clang refuses to compile the ext/rope header files. One of the errors given is below.

ropeimpl.h:433:2: error: use of undeclared identifier '_Data_allocate' _Data_allocate(_S_rounded_up_size(__old_len + __len));

g++ will compile this okay but the clang authors claim this code is invalid, http://llvm.org/bugs/show_bug.cgi?id=6454. Below are the 7 changes to the two files that allowed a successful compile. Line numbers may not be exact.

In ropeimpl.h

383c381
< 	    this->_L_deallocate(__l, 1);
---
>         _L_deallocate(__l, 1);
392c390
< 	    this->_C_deallocate(__c, 1);
---
>         _C_deallocate(__c, 1);
400c398
< 	    this->_F_deallocate(__f, 1);
---
>         _F_deallocate(__f, 1);
409c407
< 	    this->_S_deallocate(__ss, 1);
---
>         _S_deallocate(__ss, 1);
433c431
< 	_Rope_base<_CharT, _Alloc>::_Data_allocate(_S_rounded_up_size(__old_len + __len));
---
>     _Data_allocate(_S_rounded_up_size(__old_len + __len));
514c512
< 	      _Rope_base<_CharT, _Alloc>::_C_deallocate(__result,1);
---
>           _C_deallocate(__result,1);
817c815
< 	      _Rope_base<_CharT, _Alloc>::_Data_allocate(_S_rounded_up_size(__result_len));
---
>           _Data_allocate(_S_rounded_up_size(__result_len));


In rope

732c730
<         this->_S_free_string(_M_data, this->_M_size,this->_M_get_allocator());
---
>         __STL_FREE_STRING(_M_data, this->_M_size, this->_M_get_allocator());
Comment 1 Paolo Carlini 2011-12-29 10:15:31 UTC
Unfortunately rope is largely unmaintained. Assuming these issues are easy to handle somebody with access to clang should do the work.

Note: before touching the library at all, the C++ issue should be analyzed in detail, make sure we have a Bugzilla open for it, etc, it doesn't really make sense blindly "fixing" the library for the benefit of another compiler without being able to double check what is going on with GCC. Is there a Bugzilla open for the C++ front-end issue? Otherwise, can you please open one?
Comment 2 Jonathan Wakely 2011-12-29 14:35:18 UTC
I think there is a front-end bug about this, I'll try to find it.
I've encountered it myself when compiling code with Clang and needed to fix code that G++ accepts in order to find names in dependent base classes
Comment 3 Jonathan Wakely 2011-12-29 14:45:14 UTC
the rope code has already been fixed in trunk by Jason when he fixed the G++ lookup bug

*** This bug has been marked as a duplicate of bug 24163 ***
Comment 4 Paolo Carlini 2011-12-29 14:54:18 UTC
Oh very well, thanks Jon, indeed now I remember that work.
Comment 5 Jonathan Wakely 2011-12-29 15:08:09 UTC
I'm tempted to backport the library fixes, as I've been frustrated by http://bugzilla.redhat.com/show_bug.cgi?id=702256 and would like to see a working combination of clang and libstdc++ in F17
Comment 6 Paolo Carlini 2011-12-29 15:22:08 UTC
If you have the time, seems indeed a good idea.