Boost logo

Boost :

Subject: Re: [boost] Test Runner Update to vc14.0 - CTP 6
From: Tom Kent (lists_at_[hidden])
Date: 2015-02-26 22:12:41


On Thu, Feb 26, 2015 at 11:13 AM, Joaquin M Lopez Munoz <joaquin_at_[hidden]>
wrote:

> Marcel Raad <raad <at> teamviewer.com> writes:
>
> >
> > Ben Pope <benpope81 <at> gmail.com> writes:
> > >
> > > multi_index:test_key_extractors:msvc-14.0
>
> This I strongly suspect is a compiler bug. I've tried reducing
> the problem to a simple test case but it works in webcompiler.cloudapp.net
> with version 19.00.22620:
>
> #include <type_traits>
>
> template<bool Cond,typename T1,typename T2>
> struct if_{using type=T1;};
>
> template<typename T1,typename T2>
> struct if_<false,T1,T2>{using type=T2;};
>
> template<class Class,typename Type,Type Class::*PtrToMember>
> struct const_member_base{using result_type=Type;};
>
> template<class Class,typename Type,Type Class::*PtrToMember>
> struct non_const_member_base{using result_type=Type;};
>
> template<class Class,typename Type,Type Class::*PtrToMember>
> struct member:
> if_<
> std::is_const<Type>::value,
> const_member_base<Class,Type,PtrToMember>,
> non_const_member_base<Class,Type,PtrToMember>
> >::type
> {
> };
>
> struct X
> {
> int x;
> };
>
> int main()
> {
> member<X,const int,&X::x> t;
> }
>
> Maybe someone can try with version 19.00.22609, which is what
> teeks99-08f-win2012R2-64on64 is running? If it fails, then we have
> a compiler bug fixed on mainline.
>
>
I ran it on that same machine (with 19.00.22609) and it gave the following
error.
Tom

1>------ Build started: Project: ComplierBugTest, Configuration: Debug
Win32 ------
1> main.cpp
1>c:\users\boost\documents\visual studio
2015\projects\complierbugtest\main.cpp(19): error C2975: 'PtrToMember':
invalid template argument for 'const_member_base', expected compile-time
constant expression
1> c:\users\boost\documents\visual studio
2015\projects\complierbugtest\main.cpp(9): note: see declaration of
'PtrToMember'
1> c:\users\boost\documents\visual studio
2015\projects\complierbugtest\main.cpp(32): note: see reference to class
template instantiation 'member<X,const int,pointer-to-member(0x0)>' being
compiled
1>c:\users\boost\documents\visual studio
2015\projects\complierbugtest\main.cpp(20): error C2975: 'PtrToMember':
invalid template argument for 'non_const_member_base', expected
compile-time constant expression
1> c:\users\boost\documents\visual studio
2015\projects\complierbugtest\main.cpp(12): note: see declaration of
'PtrToMember'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk