On 29 March 2011 01:49, Rodrigo Rivas wrote: > Hi again. > > Here it is my first try at this. I have changed the list to > gcc-patches, I don't know if cross post would be correct. > Please, note that this patch is not finished: the new test cases are > still missing, and expect format mistakes, misspellings and the > like... > > A few comments: > > 1. I'm not sure about what should happen if the begin/end found in > class scope are not ordinary functions. My guess is that if it is a > function (static or non-static) it is called normally, and if it is a > member variable it is searched for an operator()(). If it is a type it > should fail. That is what I tried to implement (I think it works).
The wording was carefully written so that if name lookup finds any "r.begin" then it will try "r.begin()" so yes, it should be able to call data members of callable type. > 2. The function cp_parser_perform_range_for_lookup() does the same job > twice, but interleaved, so it's not easy to avoid typing everything > once and again. Maybe it should be split in several pieces. > Suggestions welcome. > > 3. In the function cp_parser_perform_range_for_lookup() I made quite a > shameful, but clever, abuse of the local variables and arguments. I've > seen similar patterns in the code, but if you think it is too much, I > can rewrite it. > > 4. The approach to error diagnostics can be done in so many ways that > I cannot make my mind. I think that the attached patch does a > reasonable job, but again... Should we consistently refer to %<for%> so the keyword is highlighted? > 5. Hidden in the new wording, there are a restriction about arrays of > incomplete type or unknown size. That restriction should have been > obvious before (easy to say now ;-), and it is quite unrelated to the > other changes. But I don't know if it is worth its own patch (3 lines > an a future test). > > Awaiting for comments. > > -- > Rodrigo >