aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetalang.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-02-26 20:46:30 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-02-26 20:49:34 -0300
commit6f8cde0951da369d0b2960d8634ab9cf2a4b08d3 (patch)
tree45ae450f6da3eb71eee7dd5311a94af3071826dc /abstractmetalang.cpp
parent3f6b0576c90960d4474623987ccac2877a34869c (diff)
External conversion operators are now part of a class' implicit conversions.
AbstractMetaClass::implicitConversions() returns externally declared conversion operators in addition to its own implicit constructors. The implicit conversion tests where extended with the new case.
Diffstat (limited to 'abstractmetalang.cpp')
-rw-r--r--abstractmetalang.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp
index 94114e3e..73f61763 100644
--- a/abstractmetalang.cpp
+++ b/abstractmetalang.cpp
@@ -1102,12 +1102,15 @@ AbstractMetaFunctionList AbstractMetaClass::nonVirtualShellFunctions() const
AbstractMetaFunctionList AbstractMetaClass::implicitConversions() const
{
- AbstractMetaFunctionList list = queryFunctions(Constructors);
+ if (!hasCloneOperator() && !hasExternalConversionOperators())
+ return AbstractMetaFunctionList();
+
AbstractMetaFunctionList returned;
- if (!hasCloneOperator())
- return returned;
+ AbstractMetaFunctionList list = queryFunctions(Constructors);
+ list.append(externalConversionOperators());
+
foreach (AbstractMetaFunction *f, list) {
- if ((f->actualMinimumArgumentCount() == 1 || f->arguments().size() == 1)
+ if ((f->actualMinimumArgumentCount() == 1 || f->arguments().size() == 1 || f->isConversionOperator())
&& !f->isExplicit()
&& !f->isCopyConstructor()
&& !f->isModifiedRemoved()