[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] parser issues in Helios
|
Hi Sergey,
the boost library does some crazy things like recursively including a header 10 times to declare 10 different versions of a template and things like that.
A clear example of where the fast-indexer approach does not work with boost is given here:
Independent of that the problem with BOOST_FOREACH(int i, array) // ERROR HERE
could be a different issue.
Markus.
On Fri, Dec 10, 2010 at 1:06 AM, Leonid Kaplan
<xeormail@xxxxxxxxx> wrote:
Hi,
I have also started trying to make the latest CDT live with boost, and found that probably many issues caused by this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197989
Boost makes heavy use of preprocessor features, and the assumption that file is included only once doesn't allow the code to be parsed right. I have made CDT to use full indexer, and see much less issues (for example, with BOOST_FOREACH). This also means that
code parsed through gcc preprocessor may not show the problem.
Thanks,
Leonid
-sergey
On Fri, Dec 10, 2010 at 6:19 AM, Sergey Prigogin
<eclipse.sprigogin@xxxxxxxxx> wrote:
On Thu, Dec 9, 2010 at 7:01 PM, Nathan Ridge
<zeratul976@xxxxxxxxxxx> wrote:
Hello,
I've tried out the Milestone 3 development build of Eclipse Indigo with
the corresponding development build of CDT 8. It's very nice!
I'm really glad to see C++0x features implemented up to what's supported
by gcc 4.5. I think Eclipse Indigo with gcc 4.5 now has more complete
C++0x support than any other IDE/compiler combination I'm aware of.
Another nice feature is that semantic errors caught by the parser
are now underlined in red. I previously used syntax coloring to simulate
this feature (with the absence of proper syntax coloring indicating a
semantic error), but the red underlines are much more explicit and give
the reason for the error.
One side effect of this feature is that as a result of imperfections in
the parser, valid lines of code are sometimes underlined in red. I
thought I'd point out a few cases:
1. The parser complains about the BOOST_FOREACH macro, citing a number of
"Invalid arguments" errors:
#include <iostream>
#include <boost/foreach.hpp>
int main()
{
int array[3] = {1, 2, 3};
BOOST_FOREACH(int i, array) // ERROR HERE
std::cout << i << '\n';
return 0;
}
2. The parser cannot recognize certain conversions to boost::function:
#include <boost/function.hpp>
void f(boost::function<void()> f) {}
void g();
int main()
{
f(g); // ERROR HERE
return 0;
}
Here the error is:
Invalid arguments Candidates are: void f(boost::function<void ()>)
3. This is a very minor thing, but the parser warns about main()
not returning a value:
int main()
{
}
"No return, in function returning non-void"
Since the standard explicitly allows main to not return anything
(and construes it as returning 0 implicitly), you may want to add
a special case for this.
I'd be happy to file bug reports for these cases if you'd like me to,
as well to continue pointing out other issues with the parser
as I come across them.
Thanks a lot for your feedback. Please file bugs for the issues you discovered. In case of parser bugs 1 and 2 could you please run your test files through gcc preprocessor and attach the expanded files to the bugs. This way the bugs can be reproduced
without dependency on a specific version of Boost.
Cheers,
Nate.
-sergey
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev