Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339803 - dev-util/kdevelop:4 failed to compile without -std=c++0x or -std=gnu++0x
Summary: dev-util/kdevelop:4 failed to compile without -std=c++0x or -std=gnu++0x
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-05 10:06 UTC by Oleh Kravchenko
Modified: 2010-11-14 20:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,4.11 KB, text/plain)
2010-10-05 10:08 UTC, Oleh Kravchenko
Details
build.log (build.log,44.14 KB, text/plain)
2010-10-06 09:16 UTC, Oleh Kravchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleh Kravchenko 2010-10-05 10:06:27 UTC
У файлі включеному з /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4/unordered_map:35,                                                                                                                                                 
                 з /var/tmp/portage/dev-util/kdevelop-4.0.2/work/kdevelop-4.0.2/languages/cpp/parser/parser.h:41,
                 з /var/tmp/portage/dev-util/kdevelop-4.0.2/work/kdevelop-4.0.2/languages/cpp/parser/parser.cpp:23:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.

Reproducible: Always

Steps to Reproduce:
1. emerge kdevelop
Comment 1 Oleh Kravchenko 2010-10-05 10:08:40 UTC
Created attachment 249623 [details]
emerge --info
Comment 2 Michael Weber (RETIRED) gentoo-dev 2010-10-06 08:46:28 UTC
Hello,

can you please provide an full build.log? 

Thanks, Michael
Comment 3 Oleh Kravchenko 2010-10-06 09:16:12 UTC
Created attachment 249731 [details]
build.log
Comment 4 Maciej Mrozowski gentoo-dev 2010-10-06 23:43:08 UTC
My build log (same gcc and same glibc):

-- Looking for include files HAVE_VALGRIND_H - found
-- Found shared-mime-info version: 0.71
-- Enabling c++0x support for unordered map

It seems kdevelop assumes every >=gcc-4.3 provides support for C++0x. Yours for some reason does not provide those features - do you happen to know why would it be the case?

#elif defined GXX_LT_4_3
#include <ext/hash_map>
using namespace __gnu_cxx;

#else // CXX-0
#include <unordered_map> <------ it bails here in your case
template <class Key, class Data>
class  hash_map : public std::unordered_map<Key, Data> { };
#endif
Comment 5 Maciej Mrozowski gentoo-dev 2010-10-06 23:53:39 UTC
 macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3)
  if (GCC_IS_NEWER_THAN_4_3)
    message(STATUS "Enabling c++0x support for unordered map")
    add_definitions( -std=c++0x ) # For unordered_map
  else(GCC_IS_NEWER_THAN_4_3)
    add_definitions( -DGXX_LT_4_3 )
  endif (GCC_IS_NEWER_THAN_4_3)
endif(CMAKE_COMPILER_IS_GNUCXX)

So GXX_LT_4_3 is passed correctly to preprocessor. I don't know why it doesn't work, anyway below there's full conditional block. It will use unordered map on any non-msvc compiler that is not '<=gcc-4.3'. I won't say it's perfectly safe condition but should work in your case nevertheless. 

#ifdef Q_CC_MSVC
#include <hash_map>
using namespace stdext;

#elif defined GXX_LT_4_3
#include <ext/hash_map>
using namespace __gnu_cxx;

#else // CXX-0
#include <unordered_map>
template <class Key, class Data>
class  hash_map : public std::unordered_map<Key, Data> { };
#endif
Comment 6 Oleh Kravchenko 2010-11-14 20:52:02 UTC
Work for me as like this bug http://bugs.gentoo.org/show_bug.cgi?id=339798