Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341341 - Correct source code in gcc results in CPPASTProblemDeclaration with CDT
Summary: Correct source code in gcc results in CPPASTProblemDeclaration with CDT
Status: CLOSED DUPLICATE of bug 333200
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 08:03 EDT by Alfred Wang CLA
Modified: 2011-03-30 11:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wang CLA 2011-03-30 08:03:07 EDT
Build Identifier: CDT 7.0, org.eclipse.cdt.core_5.2.0.201006141710.jar

The following source code is compiled and linked OK in GCC. But CDT will report CPPASTProblemDeclaration.
# 1 "case3.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "case3.cpp"

namespace sc_core
{
 class sc_module
 {
 };

 class sc_module_name
 {
 public:
  sc_module_name() {}
 };
}

class A
{
public:
 A() {}
 A(const char *str) {}
};

struct B : ::sc_core::sc_module
{
 typedef B SC_B; B (::sc_core::sc_module_name )://this declaration results in CPPASTProblemDeclaration.
 i(1)
 ,a("test")
 {
 }

 B() {}
 int i;
 A a;
};

int main()
{
 B::SC_B bi;
 return 0;
}


Reproducible: Always

Steps to Reproduce:
1.Prepare CDT and let the upper source code as input
2.Get a 'IASTTranslationUnit' object. Then get all declarations.
3.There are five declarations in the third CPPASTSimnpleDeclaration. The second one of the five declarations is CPPASTProblemDeclaration.
Comment 1 Markus Schorn CLA 2011-03-30 11:10:42 EDT

*** This bug has been marked as a duplicate of bug 333200 ***