Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.6.1, 5.9.2
Description
When a class has any template with class inside the angle brackets in its header, lupdate is confused by the template.
Examples:
This one only reproduces with the class declaration in a separate header file.
// main.h class Foo { Q_OBJECT template<class T> void func(); } // main.cpp #include "main.h" template<class T> void Foo::func() { tr("Message"); // Context is T instead of Foo }
This one reproduces within a single cpp file (notice the namespace).
template<class T> class TempClass; namespace Ns { class SomeClass { Q_OBJECT void func(); }; void SomeClass::func() { tr("Message"); // error: Qualifying with unknown namespace/class ::SomeClass } } // namespace Ns
The context here is SomeClass without the namespace.
Using typename instead of class resolves this, but that's a bad workaround...
Attachments
Issue Links
- depends on
-
QTBUG-74922 lupdate-clang POC
- Closed
- is duplicated by
-
QTBUG-64093 lupdate broken with forward declared template class
- Closed