intel/systemc-compiler

Ambiguous operator <<

isv75 opened this issue · 2 comments

isv75 commented

Streaming SValue to DiagnosticBuilder is ambiguous between the two functions:

// Diagnostic.h line 1295
template const DiagnosticBuilder & DiagnosticBuilder::operator<<(const T &V) const

// SValue.h line 242
template friend OsT & SValue::operator << (OsT &os, const SValue &val)

Depending on which compiler I use, there is an error to this ambiguity. I have yet to learn if it is the C++ standard or other flags that makes the difference.

My workaround is to patch all code to call SValue::asString() when they stream to the DiagnosticBuilder.

Fixed in ScDiag::reportScDiag operator << for SValue used with asString(). Please check that works for you.

isv75 commented

The issue is solved. Thanks.