diff --git a/src/func.c b/src/func.c index 19300fb1f85c..46b40091ab90 100644 --- a/src/func.c +++ b/src/func.c @@ -3364,17 +3364,14 @@ void CtorDeclaration::semantic(Scope *sc) tret = tret->addMod(type->mod); } tf->next = tret; + if (!originalType) + originalType = type->syntaxCopy(); type = type->semantic(loc, sc); #if STRUCTTHISREF if (ad && ad->isStructDeclaration()) - { if (!originalType) - originalType = type->syntaxCopy(); ((TypeFunction *)type)->isref = 1; - } #endif - if (!originalType) - originalType = type; // Append: // return this; diff --git a/test/compilable/ddoc7795.d b/test/compilable/ddoc7795.d new file mode 100644 index 000000000000..f928256b10f5 --- /dev/null +++ b/test/compilable/ddoc7795.d @@ -0,0 +1,17 @@ +// PERMUTE_ARGS: +// REQUIRED_ARGS: -D -Ddtest_results/compilable -o- +// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh 7795 + +module ddoc7795; + +struct TimeValue { + this(int hour, int minute, int second = 0, int ms = 0) {} +} + +/// +struct DateTime { + /// + this(TimeValue t = TimeValue(0, 0)) {} +} + +void main() { } diff --git a/test/compilable/extra-files/ddoc7795.html b/test/compilable/extra-files/ddoc7795.html new file mode 100644 index 000000000000..9b9b8bd677de --- /dev/null +++ b/test/compilable/extra-files/ddoc7795.html @@ -0,0 +1,19 @@ + + + ddoc7795 + +

ddoc7795

+

+
struct DateTime; +
+


+
this(TimeValue t = TimeValue(0,0)); +
+


+
+
+
+
+ +
Page generated by Ddoc. +