auto compiler error with multiple name declaration - by G M Sanders

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 698688 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/3/2011 12:43:52 AM
Access Restriction Public


The following code snippet fails to compile:

	int a[] = {0,1,2,3,4,5,6,7,8,9};
	auto b=std::begin(a),  e=std::end(a);

1> ... error C3538: in a declarator-list 'auto' must always deduce to the same type
1>          could be 'int *'
1>          or       'int *'

However, this works:

	int a[] = {0,1,2,3,4,5,6,7,8,9};
	auto b=std::begin(a);
	auto e=std::end(a);

This was originally submitted to the c++ user group at comp.lang.c++.moderated and it was concluded that this is a compiler bug.
Sign in to post a comment.
Posted by Microsoft on 11/3/2011 at 5:16 PM
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by MS-Moderator08 [Feedback Moderator] on 11/3/2011 at 2:16 AM
Thank you for submitting feedback on Visual Studio 2010 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 MS-Moderator01 on 11/3/2011 at 1:48 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(