Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.0, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 5.0.1, 5.0.2, 5.1.0 Beta 1
-
None
-
It is the logic bug, any platform should be able to reproduce this issue.
Description
The following code snippet just doesn't work:
[hidden]$ cat xx.h
template <bool b> struct X {};
struct Y : X<-1<0> {};
class X : public QObject {
Q_OBJECT
};
[hidden]$ moc xx.h -o xx.cpp
xx.h:0: Note: No relevant classes found. No output generated.
I tried both the moc in qt4 and qt5, none of them can handle it correctly.
This bug basically prevents building Qt using clang+libcxx because libcxx's <type_traits> header uses such techniques for is_signed template (it uses (T)-1<(T)0 to figure out if a type is signed or not). It makes the moc segment fault.
Please fix this issue! Any code that has '<' in the template parameter will break, not only limited to the clang header.