Open krzysztofjanski opened 8 years ago
The problem can be with r-value reference symbol in the condition_counter
function:
conditions = set(['if', 'for', 'while', '&&', '||', '?', 'catch', 'case'])
@krzysztofjanski thanks for the report and the test. Yes, it's because of the &&. Let me fix this.
BTW, is it possible to use the r-value reference symbol inside the function body?
Hello,
Yes, it's possible: http://en.cppreference.com/w/cpp/language/reference (see examples).
In my opinion, to do it properly, you would need to distinguish whether && is between a type and a name: The && as a logic operator can be used between names and as a r-value reference between a type and a name.
I see. I will first do a quick fix for the situation that && is outside the function body.
For the situation that && is between a type and a name... let me think about it... It doesn't make sense to have a r-value && without assignment "=" inside a function body, right?
You can have for example typedef:
typedef int&& rref;
or lambda:
auto lambda_fun = [](std::string &&s){ cout << s << endl; }
OK. I will make sure there's one test covering the typedef.
And for lambda... I think I should count lambda function as a nested function. If I implement that feature, then this problem is also solved, right?
I think so :) , I do not recall any other case at the moment.
The title of this issue is misleading.
The following test does not pass: