Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352309

Summary: CDT8 cannot parse __is_pod, __is_empty declaration in namespace std.
Product: [Tools] CDT Reporter: Alfred Wang <alfred.wang>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: major    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Alfred Wang CLA 2011-07-18 03:54:46 EDT
CDT reports them as problem declarations. The definitions of these two structs locate /usr/include/c++/4.2.1/bits/cpp_type_traints.h. Here is a sample test case.

template<typename _Tp>
struct __is_pod
{
};

template<typename _Tp>
struct __is_empty
{
};

If I remove the first underline, CDT8 will be OK. It's like here.

template<typename _Tp>
struct _is_pod
{
};

template<typename _Tp>
struct _is_empty
{
};

I am aware that GCC 4.4 has removed these two structs.
Comment 1 Markus Schorn CLA 2011-07-27 09:01:42 EDT
I made the support for the builtin type-traits dependent on the version of gcc. I cannot do the fix on the maintenance branch, to work around the issue you can map __is_pod to something different in the project settings 'C/C++ - General - Paths and Symbols - Symbols - C++'.
Comment 2 CDT Genie CLA 2011-07-27 09:18:28 EDT
*** cdt git genie on behalf of 352309 ***

    Bug 352309: Builtin type-traits conflict with old system headers

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=16da85ea6b2727782f9c936558cbb25ef9e7b702
Comment 3 Markus Schorn CLA 2011-07-27 11:00:37 EDT
I ported the fix to the 8.0.x branch.
Comment 4 CDT Genie CLA 2011-07-27 11:18:32 EDT
*** cdt git genie on behalf of 352309 ***

    Bug 352859: Matching of template template parameters.
commit df4c17ffdc939e78ce57107d0eafb285673f0385
    Bug 352309: Builtin type-traits conflict with old system headers

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=947aacd42b4da991ab9be0b046c0ffe234e427a4
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=df4c17ffdc939e78ce57107d0eafb285673f0385