Community
Participate
Working Groups
Hi, I am committing this improvement request despite nothing is settled yet for C++17. The feature is supported by GCC 6 and thus CDT should not produce any warning for the following code: namespace x::y <--- Syntax error { }
AFAIK, nested namespace definitions were officially adopted into the upcoming C++17 standard back in November 2014. I would really like CDT to support this.
anything new with this issue? I just wanted today switch to C++1z in out project, just because of the nested namespaces. with the compiles we use this works, but than I hade to notice that eclipse does not support this and reports synztx errors. This is not good, and this issue is already 1 year old
(In reply to Harald Achitz from comment #2) > This is not good, and this issue is already 1 year old There are much older features that are still not supported, like C++14 init-captures or most C11 features. It takes someone to do the work of implementing these. I spend most of what little spare time I have working on CDT, but I'm barely staying on top of regressions from previous changes. Help / contributions are welcome.
It seems that are too less development resources for CDT. When I look around at how many companies I have seen eclipse CDT in use, and than read that resources for implementing features are missing, this makes me sad.
This is actually a quite important feature, since CDT fails to parse any code inside nested namespaces, turning it essentially into a plain text editor.
I would be willing to mentor someone who is interested in contributing a fix for this.
I heard some time back that there was a project working to incorperate the Clang AST into eclipse CDT in order to resolve problems like this one, is that still going on?
(In reply to Joshua Newcomb from comment #7) > I heard some time back that there was a project working to incorperate the > Clang AST into eclipse CDT in order to resolve problems like this one, is > that still going on? Yes, bug 511851. But it's a long term project, I wouldn't expect the results of that to be usable any time soon.
Is there an ETA for this issue. I am not able to use eclipse at all as our existing codebase is using the new nested namespace feature everywhere and I will be forced to use a different IDE just to get away from this issue. Will be quite a sad end to my tenure as an eclipse CDT user.
Or if there is a workaround then it will help too as it might temporarily give me some time to wait for a final improvement in CDT as currently it is completely unusable for me
Workaround: #ifdef __CDT_PARSER__ namespace x { namespace y { #else namespace x::y { #endif Of course, at that point you may as well just use the longer form unconditionally. You could also consider contributing a patch to CDT to accept the short form.
thanks a lot for the information I'll have to impose this change to everyone in the team in order for me to use eclipse. I guess it is not the most viable option for me. Any clue if there is a time line for anyone to pick it up in near future?
(In reply to Kamil Rojewski from comment #5) > This is actually a quite important feature, since CDT fails to parse any > code inside nested namespaces, turning it essentially into a plain text > editor. did you find any workaround for this issue? I cannot just sk the whole team to not use the feature till eclipse comes up with a patch :-( any help appreciated.
New Gerrit change created: https://git.eclipse.org/r/115779
I had a look it this; it ended up being quite straightforward to add support for this to the parser. We don't explicitly represent in the AST whether the nested form of a namespace definition was used or the regular form, although an AST consumer could probably deduce it by observing that the start offset of a namespace definition node is the same as the start offset of its enclosing namespace definition node (which wouldn't happen with the regular form). In any case, parsing and name resolution should work correctly with this change.
great! looking forward seeing this update in upstream
Thanks a lot for the same...I look forward to see the changes
Thanks for the patch - is it possible to apply it to an existing installation of Eclipse somehow? This bug is forcing us to revert all "C++17 nested namespace" changes, as the IDE becomes unusable with them...
(In reply to Vittorio Romeo from comment #18) > Thanks for the patch - is it possible to apply it to an existing > installation of Eclipse somehow? This bug is forcing us to revert all "C++17 > nested namespace" changes, as the IDE becomes unusable with them... I will commit the patch today, and it should then make it into the next CDT nightly build. You can install a nightly build into an existing installation.
Gerrit change https://git.eclipse.org/r/115779 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=f413c21d032e4428bda60528983493cbf45845b5
Ok, committed now. Should be in the next nightly build. Nightly builds can be installed via this update site: http://download.eclipse.org/tools/cdt/builds/master/nightly/
Fixed for CDT 9.5.
New Gerrit change created: https://git.eclipse.org/r/116684
Gerrit change https://git.eclipse.org/r/116684 was merged to [cdt_9_4]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=1566253cb81542b7dd56cb8a5d5dfdae8b15ac4d
Fixed for 9.4.2 as well.