moc: Don't error our when parsing "using namespace __identifier(...)"

This follows on from a232251992 which
covered a similar instance of this. As with that change, we should not
abort the compilation, just ignore it.

Task-number: QTBUG-63772
Change-Id: Ide958080a90f43ed19edd8a320e7d45de1c96821
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Andy Shaw 2018-03-02 15:13:45 +01:00
parent 174a1e9635
commit 0da3ebd994
2 changed files with 4 additions and 0 deletions

View File

@ -674,6 +674,9 @@ void Moc::parse()
if (test(NAMESPACE)) {
while (test(SCOPE) || test(IDENTIFIER))
;
// Ignore invalid code such as: 'using namespace __identifier("x")' (QTBUG-63772)
if (test(LPAREN))
until(RPAREN);
next(SEMIC);
}
break;

View File

@ -76,6 +76,7 @@ namespace FooNamespace {
#ifdef Q_MOC_RUN
namespace __identifier("<AtlImplementationDetails>") {} // QTBUG-56634
using namespace __identifier("<AtlImplementationDetails>"); // QTBUG-63772
#endif
#endif // NAMESPACE_H