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

Bug 351228

Summary: [gnu extension] Using directive can be followed by attributes
Product: [Tools] CDT Reporter: Hering Cheng <hering.cheng>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, hering.cheng
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Hering Cheng CLA 2011-07-05 15:00:57 EDT
Build Identifier: 20110615-0604

Type the following snippet in Eclipse editor when C++ miscellaneous flag "-std=c++0x" is set.  g++ 4.6.0 accepts it but CDT 8 flags "outer::foo x;" as error:

{
   namespace inner
   {
       class foo{};
   }
   using namespace inner __attribute__((__strong__));
}

outer::foo x;		// Legal C++0x, but syntax error in CDT 8
outer::inner::foo y;	// OK


Reproducible: Always

Steps to Reproduce:
1. Right click on project name
2. Properties
3. C/C++ Build
4. Settings
5. Tool Settings tab
6. GCC C++ Compiler -> Miscellaneous
7. Add "-std=c++0x" in Other Flags
8. Copy and paste the snippet into editor
Comment 1 Markus Schorn CLA 2011-07-06 02:35:13 EDT
Added testcase, fixed in 8.0.1 > 20110706.
Comment 2 Hering Cheng CLA 2011-07-07 03:09:48 EDT
(In reply to comment #1)
> Added testcase, fixed in 8.0.1 > 20110706.

I checked out the current code base from CSV, built and launched in self-hosting mode, but the "outer::foo x;" line is still flagged as error.  Am I missing something?
Comment 3 Markus Schorn CLA 2011-07-07 06:53:23 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Added testcase, fixed in 8.0.1 > 20110706.
> I checked out the current code base from CSV, built and launched in
> self-hosting mode, but the "outer::foo x;" line is still flagged as error.  Am
> I missing something?

We are using GIT by now:
http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/
Alternatively you can pick up a hudson build https://hudson.eclipse.org/hudson/job/cdt-nightly/
Comment 4 Hering Cheng CLA 2011-07-07 17:11:43 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > Added testcase, fixed in 8.0.1 > 20110706.
> > I checked out the current code base from CSV, built and launched in
> > self-hosting mode, but the "outer::foo x;" line is still flagged as error.  Am
> > I missing something?
> 
> We are using GIT by now:
> http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/
> Alternatively you can pick up a hudson build
> https://hudson.eclipse.org/hudson/job/cdt-nightly/

I downloaded build755 from Hudson and unzipped it into a clean Indigo release that already had CDT 8.0 installed.  The sample code is still flagged as error.
Comment 5 Markus Schorn CLA 2011-07-08 02:27:06 EDT
(In reply to comment #4)
I assume that you do not have the right version of CDT installed. You can check by looking at Help - About - Installation Details - Features.
Comment 6 Hering Cheng CLA 2011-07-08 02:48:57 EDT
(In reply to comment #5)
> (In reply to comment #4)
> I assume that you do not have the right version of CDT installed. You can check
> by looking at Help - About - Installation Details - Features.

You are right.  Indeed I am still running CDT 8.0.  How should I install the nightly build correctly?  Thanks.
Comment 7 Hering Cheng CLA 2011-07-08 02:59:53 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > I assume that you do not have the right version of CDT installed. You can check
> > by looking at Help - About - Installation Details - Features.
> 
> You are right.  Indeed I am still running CDT 8.0.  How should I install the
> nightly build correctly?  Thanks.

Finally figured out how to install the nightly build, and now it works as expected: Help -> Install New Software -> Add... -> Archive..., and then pick the ZIP file from  the nightly build.  Sorry for all these dumb questions.