Commit Graph

1090 Commits

Author SHA1 Message Date
Orgad Shaneh
4c6ad5e305 C++: Fix completion for enum inside member functions
Task-number: QTCREATORBUG-13757
Change-Id: I283306b0c8348ee82e8e9bf47d404c1ecd473fde
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-06 09:34:45 +01:00
Erik Verbruggen
242b3f4110 C++: clean up numeric literal parsing and add support for n3472.
Separate the messy pp-number parsing from the numeric literal parsing.
The C/C++ preprocessor makes a grown man cry, but at least we have
"proper" literal parsing when we want it, including C++1y binary
literals.

Next step is digit separators (n3781).

Change-Id: Ia069eef454ed5c056f77694a5b8a595d0b76adc4
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-18 15:46:22 +01:00
Erik Verbruggen
a48adcf9be C++: handle case-insensitive file names in the CPlusPlus::Snapshot
... by keying on Utils::FileName

Task-number: QTCREATORBUG-12390
Change-Id: Ia98afb5a9160a7fd9225a2f9e02539ff3c35ae86
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-12-17 14:32:17 +01:00
Nikolai Kosjar
beac7b9539 C++: Fix highlighting after "invalid code"
For the semantic info document we do not expand function like macros and
because of that certain macro invocations lead to invalid code that we
need to handle, e.g.:

	Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
	class Foo {};

This change makes parsing Foo in the semantic info document successfully
again, which affects highlighting of that class.

Change-Id: I389265ac64d3f0b8b8f406d38fa58d78820b14ba
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-19 16:10:56 +01:00
Nikolai Kosjar
e3419dc5ac C++: Save a Symbol::asScope() call
isScope() calls asScope().

Change-Id: I9ffe3bf2b9cff567b32a59cf27727097642b560b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-11-12 12:29:58 +01:00
Nikolai Kosjar
69504c25ca C++: Document::functionAt provides line information
Needed for the debugger.

Change-Id: I6465f6dc53017df212e403ea8a9a1c7977ac1671
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-12 12:29:51 +01:00
Nikolai Kosjar
cefd1832ce C++: Include class name for inline functions in functionAt
The code that constructed the fully qualified name used
enclosingNamespace() which skips classes.

Use LookupContext::fullyQualifiedName() instead.

Change-Id: Ic03a91c0fe120c52dc69f3e78e82a574458d8314
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-11 11:50:46 +01:00
Christian Kandeler
9d677e3302 qbs build: Remove unneeded import statements.
The respective items are available without it.

Change-Id: Idc840cf08e7bec84f561c096afe8de25b1fb8468
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-11-10 15:45:14 +01:00
Przemyslaw Gorszkowski
0ff1cba77b C++: fix follow symbol for const arguments
Fixed case:

class Foo {};
void foo(int v) {}
void foo(const char *v) {}
void foo(const Foo &v) {}
void foo(char v) {}

void test()
{
    foo(5);
    foo("hoo");
    foo('a');
    char *var = "var";
    foo(var); // Jumps to last override, regardless of its type
    Foo f;
    foo(f); // Jumps to last override
}

Task-number: QTCREATORBUG-13128
Change-Id: I038553bb3bdbe1c300fc01573c14b6fedf0320cd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-11-07 11:34:28 +01:00
hjk
ca151d07fa CPlusPlus: Use QVector<Token> instead of QList
Better suited to avoid the indirection (sizeof(Token) > sizeof(void *))

Change-Id: Ia5f42781e720ef6aa8161f8f81ae8ddd8e58c837
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-06 16:13:58 +01:00
Orgad Shaneh
541762a1a1 C++: Remove unused file
Change-Id: I5e4f03f9a5f80b2697ac1e7a952a8c5b5765aae2
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-04 08:37:06 +01:00
Nikolai Kosjar
0c107b33d1 CppTools: Do not re-use semantic document if dependencies changed
Changes from the current editor snapshot to the previous one represent
dependency changes (include paths, defines, ...) for the document. Use
this to stop the semantic info updater from re-using the previous
document for highlighthing.

Task-number: QTCREATORBUG-12267
Change-Id: I91308700122ded7c458c267b685c00b966874a64
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 10:33:27 +02:00
Eike Ziller
ea27143239 Merge remote-tracking branch 'origin/3.2'
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
2014-10-14 15:36:16 +02:00
Nikolai Kosjar
32d795f2b6 C++: Do not share dependency table when copying a Snapshot
There are multiple situations were the snapshot is copied and
access/modifications to the dependency table data is made in other
threads, e.g.:

    * FindUsages called by ProcessFile
    * findReferences() in cppuseselectionsupdater.cpp
    * CppModelManager::projectPartFromDependencies() (clang path)

Change-Id: Ided1c5350f339c5bc960b87b32c78ccc21fa61f6
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-10-09 13:39:07 +02:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Nikolai Kosjar
a366429766 CppEditor: Add very first include after include guard
...when adding an include for an undefined identifier.

Change-Id: Ia338e924901262a847d3bd7ed9733d8e66c631dd
Task-number: QTCREATORBUG-10391
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-10-08 15:49:04 +02:00
Nikolai Kosjar
c2e5f1c819 C++: Pass on the byte offsets of macro arguments
...to the Document/Block.

Change-Id: I1a96dc70ac93254e6030326b36a5df9a2cdc2bd8
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-08 09:51:17 +02:00
David Schulz
78c707760e Cpp: Adjust includes when files are renamed.
Change-Id: Ie6aaaa5d99ba3823d9d42331f45b2dcab397e1cd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-02 15:09:20 +02:00
Christian Kandeler
a68d76cef2 CPlusPlus: Fix qbs build.
Change-Id: Id38252d7e24bccc2a0c4bf2631d98da632c16533
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2014-10-01 09:45:13 +02:00
Eike Ziller
81cb471997 Editors: Support dragging from outline views
Fill the line and column information in the location returned by
QmlOutlineModel::sourceLocation for that.
The drag & drop code also needed a way to override the executed drop
action for file drops, because the QML outline supports move-drags, which
would lead to the items being removed from the outline when dragged onto
a split...

Change-Id: I2478abc7d5aa2f3aa676cdd609ecb69a50adce8c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-09-30 13:08:49 +02:00
Nikolai Kosjar
4da91bef8d C++: Fix endless loop in lookup on Windows
...for templates with typedefs referencing the respectively other
template (basic_ostream <-> ostreambuf_iterator).

Tested with MSVC 2013.

Regression introduced by ba42ceb0cb.

Task-number: QTCREATORBUG-13064
Task-number: QTCREATORBUG-13065
Change-Id: I71a45c720663a73c3302eb7da731e6ad2d8f0fbd
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-09-25 11:35:47 +02:00
Nikolai Kosjar
79f0ab18c3 C++: Clear state in DependencyTable::build
...since build() is called multiple times for e.g. the global snapshot
(CppModelManager::projectPartFromDependencies,
CppModelManager::replaceDocument).

Change-Id: I03667496a5abc984ba976046dc7b76998a6e3336
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-09-22 19:22:30 +02:00
hjk
9a968b7417 CppTools: Move DependencyTable to Snapshot
It logically depends on the Snapshot and has a related lifetime.
Keeping it in the Snapshot avoids some code compelxity.

Change-Id: I24ee4483b44d9b0d7f2e4d494ae7ea624b949f9c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-19 11:11:30 +02:00
hjk
7104998d41 CPlusPlus: Simplify MatchingText interface
Change-Id: I46878d9ca048d0c79032445f5adc27c12d27f30c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-17 11:26:14 +02:00
Erik Verbruggen
67421f6c53 C++: fix invalid nesting of if statement.
Reported as a dead store by the clang static analyzer.

Change-Id: Id5eb72ea4698a17486b8a05d88ee66f3fd89bcfc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-12 11:31:56 +02:00
Nikolai Kosjar
1f53ecd898 Revert "C++: add support for resolving typedefs for template arguments"
This reverts commit c228b36ccf.

There are multiple issues with the reverted patch:
  * Infinite loop due to indirect recursion e.g. when opening projectmodels.cpp
  * Crash when executing CppTools tests on Windows (no infinite loop)

Change-Id: I38f02132ca57d3d32085db6146d0df7d620d7618
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-09-11 12:55:02 +02:00
Przemyslaw Gorszkowski
c228b36ccf C++: add support for resolving typedefs for template arguments
Example:
template <typename T>
struct Base { T t; };
struct Foo { int foo; };
void fun() {
  typedef Foo TypedefedFoo;
  Base<TypedefedFoo> baseFoo;
  baseFoo.t.// no code completion
}

Change-Id: I4822693d3fa1ee2e9b0e4cdd28bb9a8d441fb313
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-09 13:49:31 +02:00
Orgad Shaneh
dc6c0bceac C++: Remove double return in FindUsages
Change-Id: I76a0f4e20b364affdd8a7939fced6f0f012b661c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-09-09 11:58:47 +02:00
Christian Kandeler
847f10e9cc Remove Qt version checks.
Qt 5.3 is the minimum requirement these days. Remove all fallback code
from sources and project files.

Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-09-08 10:33:25 +02:00
Kai Koehne
e2584f69d4 Replace QLatin1String("x") with QLatin1Char('x') where possible
Change-Id: I2f90c8ae7b5e968b9de882833f8661ab540a9232
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-09-04 14:50:00 +02:00
Eike Ziller
49db3a450a Merge remote-tracking branch 'origin/3.2'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/coreplugin/editormanager/editormanager.cpp
	src/plugins/cppeditor/cppeditor.cpp
	src/plugins/remotelinux/remotelinuxdebugsupport.cpp
	src/plugins/texteditor/basetexteditor.cpp

Change-Id: I0da7c1cf2506b12d0563795aa8177fc45e97050f
2014-09-03 16:08:02 +02:00
Nikolai Kosjar
d5c6a360d0 C++: Remove unused local variable
Change-Id: I4568709edc7e11de2584916014c16f95ceb4b584
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-08-29 16:59:44 +02:00
Erik Verbruggen
c8c2aaafdf C++: Fix possible use-after-free of AST.
The CppRefactoringChanges::fileNoEditor takes a Document from the
snapshot it has. Although this snapshot is a safe copy, it might have
been gotten right after it was updated by indexing. Such a document will
still have its AST. If this AST is used by any refactoring action
without retaining it, the pointers will be dangling after a short while
(specifically: after the locator has extracted all the information).

The fileNoEditor method is called by the declDefLinkFinder to search
the target document. The snapshot is obtained before, and contains the
document for the semantic info. However, the target document will not
come from the semantic info, but from the indexer.

Change-Id: I212ff41dde6910e94e80552b2c3e5911fe9496ae
Task-number: QTCREATORBUG-11262
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-29 14:14:37 +02:00
Erik Verbruggen
703f36a4b8 C++: remove reserved names.
See [global.names] (17.6.4.3.2 in the C++11 spec.)

Change-Id: I8434496dbe392b52d339d5f17cfaeee8dbd88995
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-28 17:58:33 +02:00
Przemyslaw Gorszkowski
29532a6971 C++: refactoring: extract finding anonymous as nested type
Change-Id: I73d50d7b51e6a4e9d2b20df487f871793a6a6889
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-28 16:02:07 +02:00
Filipp
077bbf6803 search for partial specialization for arrays
A<int[]> now prefer second specialization for
template<typename T> class A
template<typename T> class A<[]>

Change-Id: I32e874f78b2f5b363d088fbab6a8897e42e44035
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-20 10:26:11 +02:00
Przemyslaw Gorszkowski
b514d4d7b2 C++: fix code completion for typedef of pointer array
Example:
struct Foo { int foo; };
typedef Foo *FooArr[10];

void func()
{
    FooArr arr;
    arr[0]-> // No completion
}

Task-number: QTCREATORBUG-12703
Change-Id: I1898dbf83eaa0a6dfa8c401390f28c78e5739bc4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-18 09:02:57 +02:00
Oswald Buddenhagen
f3a61e8bf7 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/android/androidglobal.h

Change-Id: I3367bf2ea47c088989175dddeed2210294346f4c
2014-08-05 14:24:23 +02:00
Przemyslaw Gorszkowski
ba42ceb0cb C++: nested class with enclosing template class
The parent of instantiation of nested class of template class
should be the instantiation of enclosing template class.

To prevent the infinite loop for case with local typedef of enclosing
template we should not change a parent of typedefed instatiation of
enclosing template. Example:
template <typename T>
struct Enclosing
{
  typedef Enclosing<T> EnclosingT;// first case
  struct Nested
  {
    typedef Enclosing<T> EnclosingT;// second case
  };
};

Task-number: QTCREATORBUG-11752
Task-number: QTCREATORBUG-11999
Change-Id: Iadd7b5ef73ee0c4881f59c9dabfe03339f55827b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-01 09:59:59 +02:00
Przemyslaw Gorszkowski
0bc202d52f C++: use pointer in template specialization and initialization
Fix code completion for using pointer in template specialization and
initialization.
Example:
template <typename T>
struct S {};

template <typename T>
struct S<T*> { T* t; };

struct Foo { int foo; };

int main()
{
  S<Foo*> s;
  s.t-> //no code completion
  return 0;
}

Task-number: QTCREATORBUG-12638
Change-Id: Idcd461806a22f08b76236f2db6346f157b12f5d3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-07-31 22:53:14 +02:00
Nikolai Kosjar
6a9ae7e25f CppTools: Auto-include pre-compiled headers
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>
2014-07-24 12:25:02 +02:00
Erik Verbruggen
45b1169d06 C++: Support alignas in C++11 mode.
Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704
Task-number: QTCREATORBUG-9279
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-22 16:43:51 +02:00
Nikolai Kosjar
dc59d28736 C++: Check for Function::name() before using it
Lambdas do not have a name.

Change-Id: Ifda4816c62dcfe19bdbb1649dc1caf408e056b37
Task-number: QTCREATORBUG-12686
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-07-17 12:09:36 +02:00
Przemyslaw Gorszkowski
059cfde677 C++: template base class and default argument for template class
Fix code completion for case:
struct Foo
{
    int bar;
};

template <typename T>
struct Base
{
    T t;
};

template <typename T1 = Foo>
struct Derived : Base<T1>
{};

int main()
{
    Derived<> foo;
    foo.t.// no code completion
    return 0;
}

Task-number: QTCREATORBUG-12606
Change-Id: Iadf2fae172739d0a5844c6b437fd2686616e64e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-08 09:53:48 +02:00
Przemyslaw Gorszkowski
4aa4e64b77 C++: base class and default argument for template class
Fix code completion in case:
struct Foo
{
  int bar;
};

template <typename T1 = Foo>
struct Derived : T1 { };

int main()
{
  Derived<> foo;
  foo. // members from Foo are not proposed
  return 0;
}

Task-number: QTCREATORBUG-12605
Change-Id: Ibe35c7b9a161e789057a4518c72390ac52489a3e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-07 13:26:14 +02:00
Eike Ziller
cbf4de0315 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: I1bad0c1477d7fd6996c0f8ca82e76ba521bc0dcc
2014-06-18 14:20:58 +02:00
Dale Marchand
ff52061e52 Fixed compilation error on RHEL 5.10.
Nesting the namespace "Internal" inside of other namespaces and using
sequential "using namespace" directives *or* relying on a "using
namespace" directive to resolve a method name that contained the
"Internal" namespace for resolution resulted in ambiguous resolution
errors when compiling with the RHEL5.10 stock compiler (GCC 4.1.2).  A
sample error is provided below:

Compilation error encountered was:
reference to 'Internal' is ambiguous
/usr/lib/gcc/x86_64-redhat-
candidates are: namespace Internal { }
qt-creator/src/libs/cplusplus/PPToken.h:106: error:
namespace CPlusPlus::Internal { }

Modifying the using namespace directives to reflect the nested nature of
the namespace names resolved the compilation errors.  For example:

using namespace CppEditor;
using namespace Internal;

produced errors.  However,

using namespace CppEditor;
using namespace CppEditor::Internal;

resolved the compilation errors by removing the ambiguity.

Change-Id: I6d5051e20acb2c147bd7ee1c6c6e1e3b2b4ff0f9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-18 11:06:45 +02:00
Wang Hoi
c56b999fff C: Parser: Support parsing of c99 designated initializers
In case:

    int a[6] = { [4] = 29, [2] = 15 };
    struct point { int x, y; };
    struct point p = { .y = 3, .x = 2 };

Grammar change when c99 language feature is enabled:
old grammar:

    braced-init-list :: '{' initializer-list '}'

new grammar:

    braced-init-list :: '{' designated-initializer-list '}'
    designated-initializer-list :: designated-initializer (',' designated-initializer )*
    designated-initializer :: designator* initializer-clause
    designator :: '.' identifier
                | '[' constant-expression ']'

Task-number: QTCREATORBUG-1902
Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-17 16:23:23 +02:00
Przemyslaw Gorszkowski
9b6d4573aa C++: fix 'using' in separate block of scope
Task-number: QTCREATORBUG-12357
Change-Id: I7397b0e66783d3249daa5a8ee422bfd5f5bc7bea
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-13 23:32:07 +02:00
Erik Verbruggen
6a514c8be6 Move ScopedSwap template out of pp-engine.cpp and into the utils lib.
Change-Id: I9370da5f3159f6d8ad9ee9f8fe949f66eb235592
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-06-04 10:25:29 +02:00