C2027 emitted multiple times compiling deque with an incomplete stored class - by Dmitry Me

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.


1
0
Sign in
to vote
ID 696310 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 10/24/2011 2:22:10 AM
Access Restriction Public
Moderator Decision Sent to Engineering Team for consideration

Description

This behavior is observed in cl.exe 16.00.40219.1

I have this code (inspired by this Q on StackOverflow http://stackoverflow.com/questions/7873313/different-behaviour-between-std-deque-vector-in-msvcc-g-icc):

#include <deque>
using namespace std;

struct Stored { //line 8
    deque<Stored> stored; //line 9
};

int _tmain(int /*argc*/, _TCHAR* /*argv*/[])
{
}

which is compiled with the following output:

1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(795): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>          Repro.cpp(9) : see reference to class template instantiation 'std::deque<_Ty>' being compiled
1>          with
1>          [
1>              _Ty=Stored
1>          ]
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(795): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(795): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(795): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(796): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(796): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(796): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'
1>C:\Program Files\Microsoft Visual Studio 10.0\Vc\Include\deque(796): error C2027: use of undefined type 'Stored'
1>          Repro.cpp(8) : see declaration of 'Stored'

Note that C2027 is emitted multiple times. Only the first message has full source references, others only have partial references to code. Overemission of error messages clutters compiler output and that hinders usability.
Sign in to post a comment.
Posted by Microsoft on 10/25/2011 at 9:52 AM
Hi,
    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 10/24/2011 at 9:40 PM
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 10/24/2011 at 2:43 AM
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)