From 5c50201d616eeefe61b960a8b21d3adbae8c26a0 Mon Sep 17 00:00:00 2001
From: Topi Reinio <topi.reinio@qt.io>
Date: Fri, 1 Sep 2017 13:56:34 +0200
Subject: [PATCH] qdoc: Fix handling of '#if defined' preprocessor statements

Fix the regular expression that incorrectly made parentheses
mandatory for the #if condition; an optional specifier ('?')
was missing for the closing parenthesis.

Task-number: QTBUG-62931
Change-Id: Ia046d4217f64560dd49707ec2d01b73071ba2d03
Reviewed-by: Martin Smith <martin.smith@qt.io>
---
 src/qdoc/tokenizer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qdoc/tokenizer.cpp b/src/qdoc/tokenizer.cpp
index 3a1003b83..5f4f7cb80 100644
--- a/src/qdoc/tokenizer.cpp
+++ b/src/qdoc/tokenizer.cpp
@@ -501,7 +501,7 @@ void Tokenizer::initialize(const Config &config)
     if (!versionSym.isEmpty())
         versionX->setPattern("[ \t]*(?:" + QRegExp::escape(versionSym)
                              + ")[ \t]+\"([^\"]*)\"[ \t]*");
-    definedX = new QRegExp("defined ?\\(?([A-Z_0-9a-z]+) ?\\)");
+    definedX = new QRegExp("defined ?\\(?([A-Z_0-9a-z]+) ?\\)?");
 
     QStringList d = config.getStringList(CONFIG_DEFINES);
     d += "qdoc";
-- 
GitLab