Spirit X3 with on_success() calls on VS2015

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Spirit X3 with on_success() calls on VS2015

Mikael Asplund

Hi!

 

I seem to have run into a bug in spirit x3 (or more likely in VS2015, but there is no workaround in spirit).

 

I have a small unit test like this:

 

  struct XXX : x3::annotate_on_success {};

 

...

    auto a = x3::detail::has_on_success<XXX, parser::iterator_type, x3::unused_type, ast::Identifier&>();

    typedef decltype(XXX().on_success(std::declval<iterator_type&>(), std::declval<iterator_type>(), std::declval<ast::Identifier&>(), x3::unused)) type;

    bool b = a;

    ensure(b);

...

 

 

This builds fine on both Linux (clang and g++) and Windows (VS2015 Update 1-2 CTP), but the test (ensure()) fails on Windows only.

 

That the typedef builds fine would indicate to me that the method is there and should be no problem calling (and again, this builds fine in VS2015, too).

However, has_on_success somehow fails to detect this in VS2015, but it works fine on Linux.

 

This results in my on_success() not being called on Windows.  I'm looking into this, but wanted to ask if someone have seen this before and is aware of this problem and why it occurs? Maybe someone with more knowledge is this area that can figure it out quickly?

 

Regards,

  Mikael


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Spirit X3 with on_success() calls on VS2015

Mikael Asplund

To follow up on this:

 

Made a minimal example online (also attached):

 

http://coliru.stacked-crooked.com/a/208eaadc853b0d6d

 

This will on linux print:

me:   1

x3:   1

real: 1

 

And on Windows:

me:   1

x3:   0

real: 0

 

Really weird stuff...

 

Regards,

   Mikael

 

From: Mikael Asplund [mailto:[hidden email]]
Sent: Thursday, March 17, 2016 15:55
To: [hidden email]
Subject: [Spirit-general] Spirit X3 with on_success() calls on VS2015

 

Hi!

 

I seem to have run into a bug in spirit x3 (or more likely in VS2015, but there is no workaround in spirit).

 

I have a small unit test like this:

 

  struct XXX : x3::annotate_on_success {};

 

...

    auto a = x3::detail::has_on_success<XXX, parser::iterator_type, x3::unused_type, ast::Identifier&>();

    typedef decltype(XXX().on_success(std::declval<iterator_type&>(), std::declval<iterator_type>(), std::declval<ast::Identifier&>(), x3::unused)) type;

    bool b = a;

    ensure(b);

...

 

 

This builds fine on both Linux (clang and g++) and Windows (VS2015 Update 1-2 CTP), but the test (ensure()) fails on Windows only.

 

That the typedef builds fine would indicate to me that the method is there and should be no problem calling (and again, this builds fine in VS2015, too).

However, has_on_success somehow fails to detect this in VS2015, but it works fine on Linux.

 

This results in my on_success() not being called on Windows.  I'm looking into this, but wanted to ask if someone have seen this before and is aware of this problem and why it occurs? Maybe someone with more knowledge is this area that can figure it out quickly?

 

Regards,

  Mikael


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

on_success.cpp (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Spirit X3 with on_success() calls on VS2015

Joel de Guzman
In reply to this post by Mikael Asplund
On 17/03/2016 10:54 PM, Mikael Asplund wrote:

> Hi!
>
> I seem to have run into a bug in spirit x3 (or more likely in VS2015, but there is no
> workaround in spirit).
>
> I have a small unit test like this:
>
> structXXX: x3::annotate_on_success{};
>
> ...
>
> autoa= x3::detail::has_on_success<XXX, parser::iterator_type, x3::unused_type,
> ast::Identifier&>();
>
> typedefdecltype(XXX().on_success(std::declval<iterator_type&>(),
> std::declval<iterator_type>(), std::declval<ast::Identifier&>(), x3::unused)) type;
>
> boolb= a;
>
> ensure(b);
>
> ...
>
> This builds fine on both Linux (clang and g++) and Windows (VS2015 Update 1-2 CTP), but
> the test (ensure()) fails on Windows only.
>
> That the typedef builds fine would indicate to me that the method is there and should be
> no problem calling (and again, this builds fine in VS2015, too).
>
> However, has_on_success somehow fails to detect this in VS2015, but it works fine on Linux.
>
> This results in my on_success() not being called on Windows.  I'm looking into this, but
> wanted to ask if someone have seen this before and is aware of this problem and why it
> occurs? Maybe someone with more knowledge is this area that can figure it out quickly?

Wow, I applaud your heroic efforts. I wish I can help more but I've given up on
this compiler a long time ago. This compiler reminds me of endless days trying
to figure out ICEs.

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

coliru.stacked-crooked.com

Mario Lang
In reply to this post by Mikael Asplund
Mikael Asplund <[hidden email]> writes:

> To follow up on this:
>
> Made a minimal example online (also attached):
>
> http://coliru.stacked-crooked.com/a/208eaadc853b0d6d

I am not able to use that site due to heavy javascript use.
They do not offer a fallback to at least get the source code snippet.

I am aware that I am probably not able to stop these sort of
developments, but I still wanted to mention that at least one
semi-active member of this list is blind, and has serious accessibility
issues with coliru.stacked-crooked.com.  All code examples posted to
this list via this site I can not read.

It would have been interesting, since I am planning to move to X3 on my
Linux/Mac/Windows project.  I do make use of annotate_on_success for the
typical error_handler.get_position() pattern.

Reading that Joel has apparently completely given up on MSVC is a big
showstopper for me right now.  While I would love to, I can not move
forward on adopting X3 if this bug persists.

--
CYa,
  ⡍⠁⠗⠊⠕

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: coliru.stacked-crooked.com

Mikael Asplund
Hi Mario!

Sorry about that, forgot to attach the source also.

I have posted a bug with example on Microsoft's connect site:

https://connect.microsoft.com/VisualStudio/Feedback/Details/2486073

In general, Microsoft is working hard on bringing their compiler into this century, and SFINAE issues are right up there for them. That's why I'm not too worried myself, as I don't have to release my code for windows any time soon, and I'm therefor fine with running betas, having work arounds for a while, etc. One thing you should know is that the BOOST_SPIRIT_DEFINE() macro doesn't work on VS2015. I'm using my own macro for that part... more in another post soon. :-)

Attaching the source code to this mail.

  /Mikael

-----Original Message-----
From: Mario Lang [mailto:[hidden email]]
Sent: Friday, March 18, 2016 13:57
To: Spirit General Mailing List <[hidden email]>
Subject: [Spirit-general] coliru.stacked-crooked.com

Mikael Asplund <[hidden email]> writes:

> To follow up on this:
>
> Made a minimal example online (also attached):
>
> http://coliru.stacked-crooked.com/a/208eaadc853b0d6d

I am not able to use that site due to heavy javascript use.
They do not offer a fallback to at least get the source code snippet.

I am aware that I am probably not able to stop these sort of developments, but I still wanted to mention that at least one semi-active member of this list is blind, and has serious accessibility issues with coliru.stacked-crooked.com.  All code examples posted to this list via this site I can not read.

It would have been interesting, since I am planning to move to X3 on my Linux/Mac/Windows project.  I do make use of annotate_on_success for the typical error_handler.get_position() pattern.

Reading that Joel has apparently completely given up on MSVC is a big showstopper for me right now.  While I would love to, I can not move forward on adopting X3 if this bug persists.

--
CYa,
  ⡍⠁⠗⠊⠕

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

on_success_bug.cpp (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: coliru.stacked-crooked.com

Joel de Guzman
In reply to this post by Mario Lang
On 18/03/2016 8:56 PM, Mario Lang wrote:
> Reading that Joel has apparently completely given up on MSVC is a big
> showstopper for me right now.  While I would love to, I can not move
> forward on adopting X3 if this bug persists.

While I can't afford to spend any more time on MSVC, I'd of course welcome
anyone who is willing to make it work and maintain the MSVC workarounds.
But do keep in mind that THAT should be a commitment. I cannot afford
to provide any more maintenance and support for such additions to the
code base.

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: coliru.stacked-crooked.com

sehe
In reply to this post by Mario Lang
On 18-03-16 13:56, Mario Lang wrote:
> They do not offer a fallback to at least get the source code snippet.
http://coliru.stacked-crooked.com/a/208eaadc853b0d6d/main.cpp

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: coliru.stacked-crooked.com

sehe
In reply to this post by Mario Lang
On 18-03-16 13:56, Mario Lang wrote:
> All code examples posted to
> this list via this site I can not read.
Oh, I jumped the gun - didn't realize this! Anyways, I hope the
`/main.cpp` trick might help you/him out at some stage :)

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general