Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Changes in Berlin prevent compile of Variadic functions


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jun 2, 2016 10:01 AM Last Post By: Valence Crearer
Valence Crearer

Posts: 64
Registered: 11/27/99
Changes in Berlin prevent compile of Variadic functions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 2, 2016 8:15 AM
The following code was compiling in XE7 and XE10.0 (Seattle)

template <typename R, typename...FArgs>
struct TMetaFunc<R __fastcall (__closure *)(FArgs...)> {
const int nargs = sizeof...(FArgs);
typedef R __fastcall (__closure *fType)(FArgs...) ;
fType fn1;
std::tuple<typename std::remove_const<typename std::remove_reference<FArgs>::type>::type...> params;
void __fastcall call() { callFunc(typename gens<sizeof...(FArgs)>::type()); }
template <int...S1> void __fastcall callFunc(seq<S1...>) { fn1(std::get<S1>(params)...); }
template <typename...Args> TMetaFunc(fType fn0, Args&&...args0):fn1(fn0),params(args0...) { }
TMetaFunc(const TMetaFunc&)=default;
TMetaFunc(TMetaFunc&&)=default;
TMetaFunc()=default;
TMetaFunc& operator =(const TMetaFunc&)=default;
TMetaFunc& operator =(TMetaFunc&&)=default;
};

Fails to compile in Berlin:
[bcc64 Error] CommandProcessorCommon.h(62): no matching constructor for initialization of 'std::tuple<typename std::remove_const<typename std::remove_reference<const dstring &>::type>::type>'
tuple(279): candidate constructor [with _Rest2 = <const dstring &>] not viable: no known conversion from 'Vcl::Stdctrls::TListBox *const' to 'std::_Tuple_alloc_t' for 1st argument
tuple(407): candidate constructor [with _Alloc = dstring] not viable: no known conversion from 'Vcl::Stdctrls::TListBox *const' to 'std::allocator_arg_t' for 1st argument

Was there an intentional change? What is going on here?

Seems that params would still be build just like in Seattle? remove const and reference, and have a TListBox* and a dstring in the tuple... Why not?

Thanks

Edited by: Valence Crearer on Jun 2, 2016 11:16 AM
Valence Crearer

Posts: 64
Registered: 11/27/99
Re: Changes in Berlin prevent compile of Variadic functions  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 2, 2016 10:01 AM   in response to: Valence Crearer in response to: Valence Crearer
Ok...

Found the bug. Was calling it with a function that was a closure without using __closure in the call.

The error messages are not very useful.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02