Skip to content

Commit

Permalink
moc: Don't error our when parsing "using namespace __identifier(...)"
Browse files Browse the repository at this point in the history
This follows on from a232251 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) <[email protected]>
  • Loading branch information
AndyShawQt committed Mar 5, 2018
1 parent 174a1e9 commit 0da3ebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tools/moc/moc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions tests/auto/tools/moc/namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0da3ebd

Please sign in to comment.