In N4663, section [dcl.fct.def.coroutine] states that, in a coroutine
that is a non-static member function, the type of the implicit object
parameter is included immediately before the types of the function
parameters.
Details
- Reviewers
GorNishanov EricWF
Diff Detail
- Build Status
Buildable 7990 Build 7990: arc lint + arc unit
Event Timeline
I think the test could be improved. First could you add the test within test/SemaCXX/coroutines.cpp? Second could you add some negative tests that check the diagnostics generated when you don't provide a specialization of coroutine traits (ie that the old behaviour of not including the class type now produces diagnostics). Could you also add tests for const/volatile and lvalue/rvalue qualified member functions?
lib/Sema/SemaCoroutine.cpp | ||
---|---|---|
85 | This seems wrong to me. getThisType returns the type of the this parameter as specified under [class.this] but according to the coroutines spec the type of the parameter should be the type of the implicit object parameter, which is specified under (over.match.funcs) p4. | |
441 | Huh, I've never seen lambdas used like this before but I really like it. |
Will do, thanks for the suggestions.
lib/Sema/SemaCoroutine.cpp | ||
---|---|---|
85 | Oh wow, that's a howler. I will check my tests against MSVC here. Thanks. | |
441 | It's a sometimes controversial style called immediately-invoked lambda/function expression (IILE or IIFE). I saw other instances of it in this file (or possibly some other file in clang) so I'm assuming it's acceptable style. |
@toby-allsopp: You mentioned that @EricWF already got this in. Can you close ("abandon") this patch if it is no longer needed.
Yes, @EricWF made a much more comprehensive change that has been in for a while now. Abandoning.
This seems wrong to me.
getThisType returns the type of the this parameter as specified under [class.this] but according to the coroutines spec the type of the parameter should be the type of the implicit object parameter, which is specified under (over.match.funcs) p4.