Skip to content

Fix #11785 Syntax error: typedef not first keyword in statement#5178

Merged
chrchr-github merged 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix11785
Jun 21, 2023
Merged

Fix #11785 Syntax error: typedef not first keyword in statement#5178
chrchr-github merged 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix11785

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.. but hmm this does not mean that the typedef is handled properly. maybe it's still an improvement.

@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Jun 21, 2023

I feel that you can merge this if you want.. but then a new ticket should be created in trac to handle the typedef properly.
It's nice that the analysis is not stopped at least.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Why do you think that the typedef is not handled correctly?

#include <functional>
 
struct Foo {
  Foo(int num) : num_(num) {}
  int num_;
};
 
void bar() {
  std::function<int(Foo const&)> typedef Callback;
  Callback cb;
}
3: struct Foo {
4: Foo ( int num@var1 ) : num_@var2 ( num@var1 ) { }
5: int num_@var2 ;
6: } ;
7:
8: void bar ( ) {
9:
10: std ::@expr1073741828 function < int (@expr1073741829 const Foo &@expr1073741830 ) > cb@var3 ;
11: }

@chrchr-github chrchr-github merged commit 9a95d4f into cppcheck-opensource:main Jun 21, 2023
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Jun 21, 2023

Why do you think that the typedef is not handled correctly?

ok I just assumed we did not handle it. Good!

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

It was added a couple of weeks ago: #4938

@chrchr-github chrchr-github deleted the chr_Fix11785 branch August 11, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants