C++: VS 2013 RC allows to call free functions using curly braces - by malderror

Status : 

 


1
0
Sign in
to vote
ID 798789 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 8/28/2013 12:08:04 PM
Access Restriction Public

Description

Compiler allows to call a free function using curly braces, e.g. std::make_pair{123, 12.3f}.
Sign in to post a comment.
Posted by Niels Dekker on 6/10/2014 at 5:17 AM
Thanks! Visual Studio 2013 Update 2 does indeed produce a proper error message on std::make_pair{123, 12.3f}: "error C3321: initializer-list unexpected in this context". Cool :-)
Posted by Microsoft on 6/6/2014 at 9:53 AM
Thank you for using Visual Studio and for reporting this bug. We are happy to let you know that this issue has been fixed in Visual Studio 2013 Update 2. If you already have Visual Studio 2013, you can upgrade to Update 2 for free or you can install a trial version from: http://go.microsoft.com/?linkid=9832436
Posted by Microsoft on 1/27/2014 at 4:44 PM
Hi malderror,

A fix for this bug will be released in the next update for Visual Studio 2012. Thanks for contacting us.

Karl Niu
Visual C++ Team
Posted by UnitUniverse on 9/11/2013 at 10:10 PM
ok i tested and found that general functions/member functions, functors(or 'operator () (args)'), lamda expressions have the issues.
Posted by UnitUniverse on 9/10/2013 at 7:45 PM
The C++11 implementation shouldn't break this... come on...

#include "stdafx.h"
#include <conio.h>

void foo(int){};

int _tmain(int /*argc*/, _TCHAR * /*argv*/[])
{
    foo{ 0 }; // Let this line being compiled is not good. definitly.

    _getch();
    return 0;
}
Posted by malderror on 9/10/2013 at 5:33 AM
Still the same behaviour in VS 2013 RC.
Posted by Microsoft on 8/29/2013 at 12:17 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 8/28/2013 at 12:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)