Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle c++11 '= default' in sipify
  • Loading branch information
nyalldawson committed Apr 2, 2017
1 parent aec3e15 commit bed74fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/sipify.pl
Expand Up @@ -232,6 +232,7 @@
$line =~ s/\s*override( SIP_\w+(\(.+\))?)?;/$1;/;
$line =~ s/^(\s*)?(const )?(virtual |static )?inline /$1$2$3/;
$line =~ s/\bnullptr\b/0/g;
$line =~ s/\s*=\s*default\b//g;

# remove constructor definition
if ( $line =~ m/^(\s*)?(explicit )?(\w+)\(([^()]*\([^()]*\)[^()]*)*\)(?!;)$/ ){
Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -63,6 +63,11 @@ A constructor with definition in header
A classic constructor with arguments
%End

QgsSipifyHeader();
%Docstring
Default constructor
%End

void multilineMethod( const QgsPoint &startPoint,
QgsFeatureId featureId,
QgsVectorLayer *vl,
Expand Down
3 changes: 3 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -99,6 +99,9 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
*/
QgsSipifyHeader( QWidget *parent SIP_TRANSFERTHIS = nullptr );

//! Default constructor
QgsSipifyHeader() = default;

//! A multiline method signature
void multilineMethod( const QgsPoint &startPoint,
QgsFeatureId featureId,
Expand Down

0 comments on commit bed74fc

Please sign in to comment.