bugAldo - Bugs: bug #42127, Fails to compile on OS X 10.9 with...

 
 

bug #42127: Fails to compile on OS X 10.9 with Xcode 5.1

Submitted by:  None
Submitted on:  Wed 16 Apr 2014 01:48:58 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 16 Apr 2014 01:48:58 AM UTC, original submission:

Trying to compile on OS X 10.9 with Xcode 5.1 fails with:

menu.cc:115:8: error: calling a private constructor of class 'std::__1::__wrap_iter<libmenu::Item *>'
IT it(&m_its[pos]);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1220:31: note: declared private here
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
^
menu.cc:121:8: error: calling a private constructor of class 'std::__1::__wrap_iter<libmenu::Item *>'
IT it(&m_its[pos]);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1220:31: note: declared private here
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
^
menu.cc:127:8: error: calling a private constructor of class 'std::__1::__wrap_iter<libmenu::Item *>'
IT it(&m_its[pos]);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1220:31: note: declared private here
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}

The following patch allows compilation to succeed:

diff --git a/src/menu.cc b/src/menu.cc
index 483b826..092d604 100644
--- a/src/menu.cc
+++ b/src/menu.cc
@@ -112,20 +112,17 @@ void Menu::add_item(id_type id, std::string c, Function2 f)

void Menu::add_item_at(unsigned int pos, id_type id, std::string c, Function1 f)
{
- IT it(&m_its[pos]);
- m_its.insert(it, Item(id,c,f) );
+ m_its.insert(m_its.begin()+pos, Item(id,c,f) );
}

void Menu::add_item_at(unsigned int pos, id_type id, std::string c, Function2 f)
{
- IT it(&m_its[pos]);
- m_its.insert(it, Item(id,c,f) );
+ m_its.insert(m_its.begin()+pos, Item(id,c,f) );
}

void Menu::delete_item_at(unsigned int pos)
{
- IT it(&m_its[pos]);
- m_its.erase(it);
+ m_its.erase(m_its.begin()+pos);
}

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup1