diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index dc31e204f0d12cf189d76d07bbdb819e6725d084..fe7382875787f4da4135c08f23d14e178ddf39bd 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -481,6 +481,21 @@ void Preprocessor::popState()
     _savedStates.removeLast();
 }
 
+QByteArray Preprocessor::operator()(const QByteArray &filename,
+                                    const QByteArray &source)
+{
+    QByteArray preprocessed;
+    operator()(filename, source, &preprocessed);
+    return preprocessed;
+}
+
+QByteArray Preprocessor::operator()(const QByteArray &source)
+{
+    QByteArray preprocessed;
+    operator()(source, &preprocessed);
+    return preprocessed;
+}
+
 void Preprocessor::operator () (const QByteArray &filename,
                       const QByteArray &source,
                       QByteArray *result)
diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h
index 3ac1a42c6a63553faabce98bb34346c36092a60a..4fbbe1008d4b6e6736a1b1b156e381af987d4b80 100644
--- a/src/libs/cplusplus/pp-engine.h
+++ b/src/libs/cplusplus/pp-engine.h
@@ -181,6 +181,11 @@ namespace CPlusPlus {
     public:
         Preprocessor(Client *client, Environment &env);
 
+        QByteArray operator()(const QByteArray &filename,
+                              const QByteArray &source);
+
+        QByteArray operator()(const QByteArray &source);
+
         void operator()(const QByteArray &filename,
                         const QByteArray &source,
                         QByteArray *result);
diff --git a/tests/auto/cplusplus/cplusplus.pro b/tests/auto/cplusplus/cplusplus.pro
index af3bc066700dceeb021c73d1bea58bd48200ab22..c7aa5342853ee9bc6a345e24af3d818df23ccd18 100644
--- a/tests/auto/cplusplus/cplusplus.pro
+++ b/tests/auto/cplusplus/cplusplus.pro
@@ -1,3 +1,3 @@
 TEMPLATE = subdirs
-SUBDIRS = shared ast semantic lookup
+SUBDIRS = shared ast semantic lookup preprocessor
 CONFIG += ordered
diff --git a/tests/auto/cplusplus/preprocessor/preprocessor.pro b/tests/auto/cplusplus/preprocessor/preprocessor.pro
new file mode 100644
index 0000000000000000000000000000000000000000..8ce434d112b509de7acfa964f840dee1a7442694
--- /dev/null
+++ b/tests/auto/cplusplus/preprocessor/preprocessor.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+CONFIG += qt warn_on console depend_includepath
+QT = core testlib
+TARGET = tst_$$TARGET
+DEFINES += CPLUSPLUS_WITH_NAMESPACE
+
+include(../../../../src/libs/cplusplus/cplusplus-lib.pri)
+
+SOURCES += tst_preprocessor.cpp
diff --git a/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..19bf6f29628d986d25450d93b79cfbc736511888
--- /dev/null
+++ b/tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp
@@ -0,0 +1,28 @@
+#include <QtTest>
+#include <pp.h>
+
+CPLUSPLUS_USE_NAMESPACE
+
+class tst_Preprocessor: public QObject
+{
+Q_OBJECT
+
+private Q_SLOTS:
+    void pp_with_no_client();
+};
+
+void tst_Preprocessor::pp_with_no_client()
+{
+    using namespace CPlusPlus;
+
+    Client *client = 0; // no client.
+    Environment env;
+
+    Preprocessor preprocess(client, env);
+    QByteArray preprocessed = preprocess("#define foo(a,b) a + b\nfoo(1, 2)\n");
+    QByteArray expected = "1 + 2";
+    QCOMPARE(preprocessed.trimmed(), expected);
+}
+
+QTEST_APPLESS_MAIN(tst_Preprocessor)
+#include "tst_preprocessor.moc"