IBM Support

Creating C++ template functions in Rational Rhapsody causes Microsoft Visual C++ compiler errors C2667 and C2668

Troubleshooting


Problem

Generated code causes compiler errors C2667 and C2668 when creating C++ template functions in IBM Rational Rhapsody.

Symptom

The full error message is as follows:

error C2667: 'MyFunction' : none of 2 overload have a best conversion
error C2668: 'MyFunction' : ambiguous call to overloaded function

Cause

This is a bug in pre C++ 03 compilers, such as Microsoft Visual Studio C++ 6 (98).

Review the Microsoft Support Article ID 240869: BUG: C2667 and C2668 on Partial Ordering of Function Templates for more details.

Resolving The Problem

The C++ code generated by Rational Rhapsody is valid and compiles with more recent Microsoft Visual Studio compilers (for example, Visual Studio 2008/2010/2012); therefore, it is recommended that you upgrade to one of these compilers.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.5;7.5.0.1;7.5.1;7.5.1.1;7.5.2;7.5.2.1;7.5.3;7.5.3.1;7.5.3.2;7.5.3.3;7.6;7.6.0.1;7.6.1;7.6.1.1;7.6.1.2;7.6.1.3;7.6.1.4;7.6.1.5;8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21675452