Skip to content

Commit b22abfc

Browse files
committed
Removed the possibility for conflicts between overloads when generating C++ for symbols.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 1ff17da commit b22abfc

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/Generator/Passes/SymbolsCodeGenerator.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,15 @@ private void TakeFunctionAddress(Function function)
170170
}
171171

172172
string returnType = function.OriginalReturnType.Visit(cppTypePrinter);
173-
bool ambiguity = function.Namespace is TranslationUnit ||
174-
function.Namespace.GetOverloads(function).Count() > 1 ||
175-
function.FriendKind != FriendKind.None;
176-
string signature = ambiguity ? GetSignature(function) : string.Empty;
173+
string signature = GetSignature(function);
177174

178175
string functionName = GetFunctionName(function, @namespace);
179176
if (function.FriendKind != FriendKind.None)
180177
WriteRedeclaration(function, returnType, signature, functionName);
181178

182179
var method = function as Method;
183-
if (ambiguity)
184-
Write($@"{returnType} ({(method != null && !method.IsStatic ?
185-
(@namespace + "::") : string.Empty)}*{wrapper}){signature}");
186-
else
187-
Write($"auto {wrapper}");
180+
Write($@"{returnType} ({(method != null && !method.IsStatic ?
181+
(@namespace + "::") : string.Empty)}*{wrapper}){signature}");
188182
if (function.Access == AccessSpecifier.Protected)
189183
{
190184
Write($" = &{wrapper}{@namespace}::{functionName};");

0 commit comments

Comments
 (0)