- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am facing some issues compiling Boost 1.47 Beta 1 (Grab from here), specifcially Boost.Chrono library. It compiles fine with VS 2010 SP1 compiler.
When I execute
bjam --with-chrono --toolset=intel
I get the following error message
< snip >
chrono.cpp
.\\boost/chrono/duration.hpp(94): error: expected an expression
&& (boost::is_convertible ^
.\\boost/chrono/duration.hpp(124): error: expected an expression
&& (boost::is_convertible ^
< snip >
Both error messages seem to stem from the same problem, so I will only discuss the first error in this thread. Looking at the section of code (L90 - L100) where the code appears, it is hard to see what is wrong with it (and there is probably nothing wrong).
template
bool = (
(boost::is_convertible
typename common_type::type>::value)
&& (boost::is_convertible
typename common_type::type>::value)
)
>
struct duration_divide_imp
{
};
After some discussion with library author and trying out some ideas, we have realised that if we place an additional parenthesis around the first operand of the && operator, the code can compile. We have no idea why this might be the case, and can only conclude that there is some bug in the Intel compiler.
I have a ticket on boost trac to keep track of this: https://svn.boost.org/trac/boost/ticket/5669
Any insights to why this might be happening?
Thanks.
When I execute
bjam --with-chrono --toolset=intel
I get the following error message
< snip >
chrono.cpp
.\\boost/chrono/duration.hpp(94): error: expected an expression
&& (boost::is_convertible
.\\boost/chrono/duration.hpp(124): error: expected an expression
&& (boost::is_convertible
< snip >
Both error messages seem to stem from the same problem, so I will only discuss the first error in this thread. Looking at the section of code (L90 - L100) where the code appears, it is hard to see what is wrong with it (and there is probably nothing wrong).
template
(boost::is_convertible
&& (boost::is_convertible
)
>
struct duration_divide_imp
{
};
After some discussion with library author and trying out some ideas, we have realised that if we place an additional parenthesis around the first operand of the && operator, the code can compile. We have no idea why this might be the case, and can only conclude that there is some bug in the Intel compiler.
I have a ticket on boost trac to keep track of this: https://svn.boost.org/trac/boost/ticket/5669
Any insights to why this might be happening?
Thanks.
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any chance you could post a .i file (add -E to command line and redirect output to .i file, may need to get rid of -o on command line)
Thanks!
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to note that the final version of boost 1.47 will not have this problem as the author has implemented the workaround of adding an additional parenthesis. Anyone trying to re-create this issue should use the beta version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dale, any update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a small reproducer:
// compiles with cl but not icl
template
struct is_convertible
{
static const bool value = true;
};
template
struct C {};
It looks like the compiler is getting confused on the && token and thinks we're dealing with an expression not a declaration (this has to do with support we added long ago for Gnu && labels). Anyway, Dale I filed cq #171750 for the problem. We will fix it ASAP. Thanks for reporting it.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Judy,
Thanks for taking the time out to create a small reproducer. Hope to see a fix soon.
Regards,
Edward
Thanks for taking the time out to create a small reproducer. Hope to see a fix soon.
Regards,
Edward
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This should be fixed now. Let us know if you have any further problems.
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, it works properly now.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page