c++ - Are function-local typedefs visible inside C++0x lambdas? -


I have participated in a strange problem The following simplified code reproduces the problem in MSWC 2010:

  template & lt; Typename T & gt; Structure dummy {static tu fu (zero) {return t (); }}; Int main (empty) {typingf dummy & lt; Balls & gt; Dummy_type; Auto x = [] {bool b = dummy_type :: foo (); }; // auto x = [] {bool b = dummy & lt; Bool & gt; :: foo (); }; // works}  

I do not see the locally built typedef in lambda functions. If I replace typedef with the actual code, then it works as expected.

Here are some other test cases:

  // Crash creates the main for the compiler, Terredon (zero) {struct dummy {}; Auto X = [] {Dummy D; }; } // Expected et main (zero) works as {typingf int integer; Auto x = [] {integer I = 0; }; }  

I do not have G ++ available for testing now, is it just some strange rule in C ++ 0x, or just a bug in the compiler?

With the above results, I am tilting towards the bug though the crash is definitely a bug.


For now, I have filed two.

All code snippets above should be compiled. There is an error with the use of scope resolution on locally defined scope. (By spots.)

and what to do with the crash bug ... who knows :)


update

, they Both have been set for the next release of Visual Studio 2010. (Although this does not seem to be the case; maybe VS11.)

to n3000, 5.1.2 / 6, The compound-statement function of lambda-expression gives the function-body (8.4) of the call operator, but for the purposes of name lookup (3.4) ... ... compound-statement lambda -In the context of Expression is considered. / P>

Not surprisingly, the local type should look like.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -