-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kdwsdl2cpp: Constructor of generated client should be marked explicit #206
Comments
@martonmiklos interested in adding this to libkode? |
@dfaure-kdab |
martonmiklos
added a commit
to martonmiklos/libkode
that referenced
this issue
Mar 1, 2022
martonmiklos
added a commit
to martonmiklos/libkode
that referenced
this issue
Mar 1, 2022
For motivation see: KDAB/KDSoap#206
martonmiklos
added a commit
to martonmiklos/libkode
that referenced
this issue
Mar 1, 2022
For motivation see: KDAB/KDSoap#206
martonmiklos
added a commit
to martonmiklos/libkode
that referenced
this issue
Mar 1, 2022
For motivation see: KDAB/KDSoap#206
dfaure-kdab
pushed a commit
to cornelius/libkode
that referenced
this issue
Mar 1, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kdwsdl2cpp generates constructors like this:
ClientName( QObject* _parent = nullptr );
The constructor should be marked as explicit so it will not be considered as a converting constructor:
explicit ClientName( QObject* _parent = nullptr );
Motivation:
Just had to debug a problem in my code where I accidentally called a function that expected a ClientName& with a ClientName* instead, which resulted in the function being called with a new ClientName that had the original set as parent. With the change these sort of mistakes would result in a compiler error instead. Qt has all constructors with a single QObject* parameter marked as explicit for this reason.
The text was updated successfully, but these errors were encountered: