Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
Qt Creator 6.0.0-rc1
-
2798c11d1d0c0f08daebf6c26063ccb70766dc78 (qt-creator/qt-creator/5.0)
Description
The refactoring Complete Switch Statement fails in certain situations.
Below you will find a simplified version of a enumCast function. In each of the cases try and press alt-enter after the switch statement. As the function name indicates it fails with the enumCast on a type that is inside a class.
template <typename TYPE>
TYPE enumCast(int value)
enum class GlobalColumn { Foo, Bar, Baz };
class Test
{ enum class Column \{ Foo, Bar, Baz };
void bad(int i)
{
switch (enumCast<Column>) {
}
}
void good(int i)
{
Column col = enumCast<Column>;
switch (col) {
}
}
void goodToo(int i)
{
switch (enumCast<GlobalColumn>) {
}
}
}
Attachments
For Gerrit Dashboard: QTCREATORBUG-25998 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
362071,2 | CppEditor: Fix switch statement completion | 5.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |