summaryrefslogtreecommitdiff
path: root/tests/auto/cplusplus/preprocessor
Commit message (Collapse)AuthorAgeFilesLines
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* tests: Remove foreach usageArtem Sokolovskii2023-01-031-6/+6
| | | | | | Task-number: QTCREATORBUG-27464 Change-Id: I0e42da9b04793be959ad050fdecc0c78c98d9fcd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CplusPlus: Pass FilePath to Preprocessor::run()hjk2022-12-072-4/+4
| | | | | | | | | | ... and update caller sides. Change-Id: I6a107e4a7fd9f7123cdc6f141da202845bcbbb66 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CPlusPlus: Remove Rreprocessor::run overload for QStringshjk2022-08-011-1/+1
| | | | | | | | | | The preprocessor operates on QByteArray, making it less convenient to use strings helps preventing accidental conversion roundtrips. Change-Id: Ifb2068a8fed137c52b05f2979b99cbce3462151e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove qmake build filesEike Ziller2022-01-201-23/+0
| | | | | | | | | | Removes qmake as a build system for building Qt Creator itself. Keep them for some tests that are not completely moved to CMake yet. Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-1/+1
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Fix expectations in preprocessor autotestChristian Kandeler2020-08-121-18/+19
| | | | | | | | ... regarding unfinished macro calls. Amends df0ffd8bb8. Change-Id: Ia7b8752860ac9207e702697cbee87f16a39dd1dd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Fix lexer crashChristian Kandeler2020-06-181-0/+15
| | | | | | | | | | | | | At some point in the preprocessing stage, some tokens get "squeezed", so their associated string no longer refers to the document content, but only to their own symbol. However, there is at least one context that operated under the assumption that the token's offset still pointed into the "global" string. As the token's offset is zero after parsing, this lead to the same piece of code being preprocessed in an infinite loop. Fixes: QTCREATORBUG-19525 Change-Id: I231ba51811cfa0b5c6dfe7f75fe0384472252c6f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CMake Build: Use same Qt compiler defines for testsCristian Adam2019-09-101-5/+3
| | | | | | | Source code needed adjustments though. Change-Id: I78b4610a6bb895a385c7c30a6c92c97a276b89dd Reviewed-by: hjk <hjk@qt.io>
* Standardize on int for line and column valueshjk2019-07-261-69/+69
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Avoid warning on empty expressionshjk2019-07-231-3/+3
| | | | | | | | For some reason, Q_UNUSED includes already a semicolon, adding one on the user side creates an additional empty statement. Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Qt Creator CMake portCristian Adam2019-05-171-0/+4
| | | | | | | | | | | | | | Based on Tobias Hunger's work from a few months ago. The CMake configuration needs libclang and Qt paths specified as CMAKE_PREFIX_PATH. Auto tests are run with "ctest". At the moment the pass rate is 87%. Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CPlusPlus: Block function-like macro name for arguments expansionIvan Donchevskii2019-01-171-0/+57
| | | | | | | | | | | | | | Arguments of funstion-like macro may contain the name of this macro. The attempt to expand it results into infinite recursion. Patch solves that by saving the macro name until the arguments are collected to determine that it should not be expanded. Fixes: QTCREATORBUG-21642 Change-Id: Iafb404ecd3959a2f1011c12c1c3f1c0c54ed3547 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* C++: fix trigraph parsing in macros.Francois Ferrand2016-03-081-0/+24
| | | | | | | | | | | | Trigraphs must only be parsed before/during preprocessing. The preprocessor will now replace trigraphs with their standard form, and re-lexing in TranslationUnit will not try to parse any trigraph. Also added a few missing trigraphs: ??=, ??', ??! and ??-. Task-number: QTCREATORBUG-13253 Change-Id: I1723ed53b00090b878c22b83b7e963b647b65f72 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update license information in tests directory Change-Id: I311441dd37d053ca3175e44b284258e232ee93e0 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* C++: Fix MSVC assert in std::isspace()Nikolai Kosjar2015-09-021-0/+21
| | | | | | | | | | ...when dealing with UTF8 bytes. std::isspace() expects unsigned char, not char. Change-Id: I3f9b5e347d79cf94015cc99f8797d5feab406151 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* CppTools: Fix test_cppsourceprocessor_macroUses on WindowsOrgad Shaneh2015-05-271-0/+1
| | | | | | | It assumes LF line-endings Change-Id: I7bfeb4b6d4db2fd6457030e2d21c240534de9cd2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix preprocessing of comments within function-like macroOrgad Shaneh2015-03-131-8/+140
| | | | | | Task-number: QTCREATORBUG-9535 Change-Id: Ifd94f674214314b3694be74cca297ddab873cd8c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Provide better output on preprocessor test failureOrgad Shaneh2015-03-131-23/+36
| | | | | | | | Make the expected output copyable to the test. Change-Id: I4fc61682f14d0de054a11d2ffa4a0f36ede0e500 Reviewed-by: Francois Ferrand <thetypz@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.3'Eike Ziller2015-02-121-0/+18
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/debugger/watchhandler.cpp src/plugins/projectexplorer/kitmodel.cpp src/plugins/qbsprojectmanager/qbsprojectmanager.cpp src/shared/qbs Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
| * C++: Fix crash when #if[def] nesting is deeper than 512 levelsOrgad Shaneh2015-02-031-0/+18
| | | | | | | | | | | | Change-Id: I5e86da3a36514545834f554470b147ad8be43344 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-161-6/+6
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | C++: Expand arguments in nested function-like macrosOrgad Shaneh2015-01-211-5/+11
| | | | | | | | | | | | Task-number: QTCREATORBUG-13219 Change-Id: I319fe39d696ccc28230d421b1395faf4dd452b03 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | CppTools: Tests: Stop writing into source dirNikolai Kosjar2014-12-196-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, always write into a unique temporary directory in QDir::tempPath(). Where applicable, read the test source from files instead of first writing the file. Some clean ups in test_codegen*. Change-Id: Id48dc50c6ca16252edfd9fc8a86ba0de9f9be486 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: Finish gcc's include_next supportNikolai Kosjar2014-12-153-0/+20
|/ | | | | | | | | | | | | | | | | This implements the actual include_next logic and thus completes commit b934cc1 C++: pass #include_next down to CppPreprocessor::tryIncludeFile commmit 140b502 C++: Highlight argument to gcc's #include_next extension Based on https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html Task-number: QTCREATORBUG-10225 Change-Id: I7eef7f5ea64a114f6d092304d32b72c55c2ce134 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* CppEditor: Avoid duplicate "Add #include XYZ"Nikolai Kosjar2014-11-281-0/+3
| | | | | | Task-number: QTCREATORBUG-13422 Change-Id: I3648bf44760fdac4e8e1e79652519136af6032c8 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* C++: Add a failing test for pp concat bugOrgad Shaneh2014-11-071-0/+27
| | | | | | Task-number: QTCREATORBUG-13219 Change-Id: I6278d7977f0ce560e793838c90cfbc867e1af025 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.2'Eike Ziller2014-10-141-7/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/ipaddresslineedit.cpp src/libs/utils/logging.h src/plugins/analyzerbase/AnalyzerBase.pluginspec.in src/plugins/android/Android.pluginspec.in src/plugins/android/androiddeploystep.cpp src/plugins/android/androiddeploystep.h src/plugins/android/androiddeploystepfactory.cpp src/plugins/android/androiddeploystepwidget.cpp src/plugins/android/androidpackagecreationfactory.cpp src/plugins/android/androidpackagecreationstep.cpp src/plugins/android/androidpackagecreationstep.h src/plugins/android/androidpackagecreationwidget.cpp src/plugins/android/androidpackagecreationwidget.h src/plugins/android/javafilewizard.cpp src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/baremetal/BareMetal.pluginspec.in src/plugins/bazaar/Bazaar.pluginspec.in src/plugins/beautifier/Beautifier.pluginspec.in src/plugins/bineditor/BinEditor.pluginspec.in src/plugins/bookmarks/Bookmarks.pluginspec.in src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in src/plugins/clangcodemodel/clanghighlightingsupport.cpp src/plugins/clangcodemodel/clangsymbolsearcher.cpp src/plugins/classview/ClassView.pluginspec.in src/plugins/clearcase/ClearCase.pluginspec.in src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp src/plugins/cmakeprojectmanager/cmakehighlighter.cpp src/plugins/coreplugin/Core.pluginspec.in src/plugins/cpaster/CodePaster.pluginspec.in src/plugins/cppeditor/CppEditor.pluginspec.in src/plugins/cppeditor/cppfilewizard.cpp src/plugins/cpptools/CppTools.pluginspec.in src/plugins/cpptools/cpphighlightingsupportinternal.cpp src/plugins/cpptools/cppmodelmanagerinterface.cpp src/plugins/cpptools/cppmodelmanagerinterface.h src/plugins/cvs/CVS.pluginspec.in src/plugins/debugger/Debugger.pluginspec.in src/plugins/designer/Designer.pluginspec.in src/plugins/diffeditor/DiffEditor.pluginspec.in src/plugins/emacskeys/EmacsKeys.pluginspec.in src/plugins/fakevim/FakeVim.pluginspec.in src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in src/plugins/git/Git.pluginspec.in src/plugins/git/gitorious/gitorious.cpp src/plugins/git/gitorious/gitorious.h src/plugins/git/gitorious/gitoriousclonewizard.cpp src/plugins/git/gitorious/gitorioushostwidget.cpp src/plugins/git/gitorious/gitorioushostwidget.h src/plugins/git/gitorious/gitorioushostwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwidget.cpp src/plugins/git/gitorious/gitoriousprojectwidget.h src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwizardpage.h src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp src/plugins/git/gitorious/gitoriousrepositorywizardpage.h src/plugins/glsleditor/GLSLEditor.pluginspec.in src/plugins/glsleditor/glsleditorfactory.cpp src/plugins/glsleditor/glslfilewizard.cpp src/plugins/helloworld/HelloWorld.pluginspec.in src/plugins/help/Help.pluginspec.in src/plugins/imageviewer/ImageViewer.pluginspec.in src/plugins/ios/Ios.pluginspec.in src/plugins/macros/Macros.pluginspec.in src/plugins/mercurial/Mercurial.pluginspec.in src/plugins/perforce/Perforce.pluginspec.in src/plugins/projectexplorer/ProjectExplorer.pluginspec.in src/plugins/pythoneditor/PythonEditor.pluginspec.in src/plugins/pythoneditor/pythoneditorwidget.cpp src/plugins/pythoneditor/wizard/pythonfilewizard.cpp src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in src/plugins/qmakeprojectmanager/profileeditorfactory.cpp src/plugins/qmldesigner/QmlDesigner.pluginspec.in src/plugins/qmljseditor/QmlJSEditor.pluginspec.in src/plugins/qmljseditor/qmljseditorfactory.cpp src/plugins/qmljstools/QmlJSTools.pluginspec.in src/plugins/qmlprofiler/QmlProfiler.pluginspec.in src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in src/plugins/qnx/Qnx.pluginspec.in src/plugins/qtsupport/QtSupport.pluginspec.in src/plugins/remotelinux/RemoteLinux.pluginspec.in src/plugins/resourceeditor/ResourceEditor.pluginspec.in src/plugins/resourceeditor/resourcewizard.h src/plugins/subversion/Subversion.pluginspec.in src/plugins/tasklist/TaskList.pluginspec.in src/plugins/texteditor/TextEditor.pluginspec.in src/plugins/texteditor/basetexteditor_p.h src/plugins/texteditor/basetextmark.cpp src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h src/plugins/texteditor/codeassist/defaultassistinterface.h src/plugins/texteditor/codeassist/iassistproposalitem.cpp src/plugins/texteditor/itexteditor.cpp src/plugins/texteditor/itexteditor.h src/plugins/texteditor/itextmark.cpp src/plugins/texteditor/plaintexteditor.cpp src/plugins/texteditor/plaintexteditor.h src/plugins/texteditor/texteditoractionhandler.cpp src/plugins/todo/Todo.pluginspec.in src/plugins/updateinfo/UpdateInfo.pluginspec.in src/plugins/valgrind/Valgrind.pluginspec.in src/plugins/vcsbase/VcsBase.pluginspec.in src/plugins/welcome/Welcome.pluginspec.in src/plugins/winrt/WinRt.pluginspec.in tests/auto/debugger/temporarydir.h Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
| * License updateEike Ziller2014-10-091-7/+8
| | | | | | | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | C++: Pass on the byte offsets of macro argumentsNikolai Kosjar2014-10-081-1/+75
| | | | | | | | | | | | | | | | ...to the Document/Block. Change-Id: I1a96dc70ac93254e6030326b36a5df9a2cdc2bd8 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | use DISTFILES instead of OTHER_FILES in creator's own build systemOswald Buddenhagen2014-09-151-1/+1
|/ | | | | | | it's the correct variable to use. Change-Id: I9ec7795099097715a64969516cd3fae9e213a0f4 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* CppTools: Auto-include pre-compiled headersNikolai Kosjar2014-07-241-1/+3
| | | | | | | | | | | | So far the pre-compiled headers were processed (thus defines from those headers were visible), but the actual includes for the documents were not added, which is necessary for lookup/completion. Note that this will be only done if pre-compiled headers are not ignored (Options > C++ > Code Model > [] Ignore pre-compiled headers). Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Add utf16 indices to Macro and Document::MacroUseNikolai Kosjar2014-05-231-13/+17
| | | | | | | | | In most cases we need to work with the utf16 indices. Only in cppfindreferences the byte interface is still needed since there we read in files and work on a QByteArray to save memory. Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Record macro uses in #if defined(MACRO)Orgad Shaneh2014-02-271-3/+10
| | | | | Change-Id: I4d99053f540073483c16ce842426bf8cd3def421 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix handling of #undefOrgad Shaneh2014-02-271-0/+41
| | | | | | | | | | | * If the macro is defined before, track its reference * Synchronize environment line before calling remove, which currently sets incorrect line * Set macro offset Task-number: QTCREATORBUG-10454 Change-Id: I480d16423a976a025bb8c71046610a46f9d7b0fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Tests: Record macro definition checkOrgad Shaneh2014-02-271-3/+51
| | | | | Change-Id: Ia2151ead6ba4ad2e2a3598d05dfc24a10e6a7cdb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix preprocessing of uncontinued line-escapingOrgad Shaneh2014-02-241-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following snippet demonstrates the problem: --- snip --- // comment \ #include <something.h> ... class Foo { ... }; --- snap --- If there are >=9 empty/preprocessor lines, the preprocessed source becomes // comment \ # 12 "file.cpp" ... The lexer considers the line marker as a continued C++ comment, and highlighting is broken Change-Id: I30a2fc7d19b279316e9273697179c90d81099573 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Preserve comments after preprocessor directivesOrgad Shaneh2014-02-241-1/+70
| | | | | | Task-number: QTCREATORBUG-11216 Change-Id: Iac10e75f0f5c504b79e8466607dc1f478e578f99 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Preprocessor: Adjust lines also for multiline C++ commentsOrgad Shaneh2014-02-241-0/+16
| | | | | Change-Id: I87d6e76be3030e617603209c3a1b8b3c476cf1f6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Avoid self-includeNikolai Kosjar2014-02-242-0/+2
| | | | | | | | | ...in CPlusPlus::Document due to cyclic includes. Task-number: QTCREATORBUG-11457 Change-Id: I1ca19c901c26d9984d795a61879dd6b41c57096c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix indentation in preprocessor testsOrgad Shaneh2014-02-041-79/+79
| | | | | | | Easier to compare when indentation is aligned Change-Id: I216073dc167c0ed785616ae308b566db7f910592 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Consolidate with/without comments preprocessor testsOrgad Shaneh2014-01-201-177/+101
| | | | | Change-Id: Ib08569d642da51f6d51bb0763fc95d5a5c13d28c Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Cleanup preprocessor testsOrgad Shaneh2014-01-201-253/+238
| | | | | Change-Id: Ia1b7dee24a3d7e20440dca5040cf9ffdaaf066e2 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Revert "C++: Fix highlighting for lines with predefined macros"Nikolai Kosjar2013-12-031-5/+1
| | | | | | | | | | | | | | | | | | This takes too much memory. For qtcreator.pro the numbers are as follows: Patch applied: ~ 1600MB (RES) Patch reverted: ~ 510MB (RES) This reverts commit 4c2daa90ce558c3b4287edc97127471486a411d9. Task-number: QTCREATORBUG-10973 Change-Id: I843bd7c1ea4a26a1ec55ddc14c2a34a98d040922 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix highlighting for lines with predefined macrosNikolai Kosjar2013-11-291-1/+5
| | | | | | | | | | | | | | This adds definitions for the macros __FILE__, __LINE__, __DATE__ and __TIME__ on demand. As a side effect, this also introduces highlighting for the uses of these macros. Task-number: QTCREATORBUG-8036 Change-Id: Ib7546c7d45d2eecbc50c7883fc684e3497154405 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Revert "Preprocessor Enginge: fix bug in pp-engine.cpp"Nikolai Kosjar2013-11-291-0/+18
| | | | | | | | | | Breaks highlighting for macros using the predefined macros. This reverts commit 1d834c1126dde58dd71e595b3f5e135cc0ca4dbd. Change-Id: Ic13c407e293a806a63ff30153864530df6a32e47 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Preprocessor Enginge: fix bug in pp-engine.cppSimon Schäfer2013-11-281-18/+0
| | | | | | | | | | | | | Preprocessor variables __LINE__,__FILE__,__TIME__,__DATE__ where destroying the following systems when affected variables were standing within the same line with those variables: * highlighting * refactoring * local renaming Task-number: QTCREATORBUG-8036 Change-Id: I1a4b919d15812872ca5a8e63b1031ec1ab144c22 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>