Bug 1320576 - Eclipse fails to resolve c++11 symbols
Summary: Eclipse fails to resolve c++11 symbols
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: eclipse
Version: DTS 4.0 RHEL 7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: alpha
: 4.1
Assignee: Jeff Johnston
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-23 14:26 UTC by Piyush Bhoot
Modified: 2019-11-14 07:39 UTC (History)
4 users (show)

Fixed In Version: devtoolset-4-eclipse-cdt-8.8.1-9.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-31 08:42:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1145 0 normal SHIPPED_LIVE devtoolset-4-eclipse bug fix and enhancement update 2016-05-31 12:35:29 UTC

Description Piyush Bhoot 2016-03-23 14:26:12 UTC
Description of problem:
Eclipse fails to resolve c++11 symbols like shared_ptr, 
it poses no problem during compilation though.

Version-Release number of selected component (if applicable):
devtoolset-4-eclipse-cdt-8.7.0-8.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Create new c++ plus project
  write word shared_ptr
2.Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build-in Compiler Settings
in the text box entitled Command to get compiler specs append -std=c++11
3.Rebuild project, index 

Actual results:
Codepad shows Symbol `shared_ptr` could not be resolved.

Expected results:
Should show no such messages

Additional info:

Comment 1 Alexander Kurtakov 2016-03-23 15:20:22 UTC
Jeff, would you please investigate? This is major usecase we have to support.

Comment 2 Jeff Johnston 2016-04-06 17:57:38 UTC
(In reply to Alexander Kurtakov from comment #1)
> Jeff, would you please investigate? This is major usecase we have to support.

The code is working, but it needs some help to make it index properly.

From: http://stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support

First, one needs to go to:

Project->Properties->Preprocessor Include Paths->Providers and click on the CDT GCC Built-in Compiler Settings

Underneath, unselect "Use global provider shared between projects"

and in the Command string for finding built-ins, add: -std=c++0x

For the project, go to Project->Properties->C/C++ Build->Settings->Dialect and choose c++0x from the drop-down.

Rebuild your index if it already showing failure or build as usual.

I am using devtoolset-4-eclipse-cdt-8.8.1-9.2.el6-x86_64 and with the aforementioned changes, I am able to parse the following code fine:


#include <iostream>
#include <memory>
using namespace std;

int main(
  shared_ptr<int> sp(new int(5));
  cout << *sp;
  return 0;
}

Comment 4 Václav Kadlčík 2016-04-14 14:35:26 UTC
verified in devtoolset-4-eclipse-cdt-8.8.1-9.3

Comment 6 errata-xmlrpc 2016-05-31 08:42:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2016:1145


Note You need to log in before you can comment on or make changes to this bug.