summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/test/trivialconstructor.cxx10
-rw-r--r--compilerplugins/clang/trivialconstructor.cxx2
2 files changed, 12 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/trivialconstructor.cxx b/compilerplugins/clang/test/trivialconstructor.cxx
index ef17e9c60fee..5b48c4cf4250 100644
--- a/compilerplugins/clang/test/trivialconstructor.cxx
+++ b/compilerplugins/clang/test/trivialconstructor.cxx
@@ -43,4 +43,14 @@ template <typename> struct S6
template <typename T> S6(T);
};
+struct S7
+{
+ S7(int = 0) {}
+};
+
+struct S8
+{
+ template <typename T> S8(T = 0) {}
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/compilerplugins/clang/trivialconstructor.cxx b/compilerplugins/clang/trivialconstructor.cxx
index dd830058fac9..c991d71ae703 100644
--- a/compilerplugins/clang/trivialconstructor.cxx
+++ b/compilerplugins/clang/trivialconstructor.cxx
@@ -51,6 +51,8 @@ bool TrivialConstructor::VisitCXXConstructorDecl(CXXConstructorDecl const* const
return true;
if (!constructorDecl->isDefaultConstructor())
return true;
+ if (constructorDecl->getNumParams() != 0)
+ return true;
if (!constructorDecl->inits().empty())
return true;
if (constructorDecl->getExceptionSpecType() != EST_None)