Fix for auto completion in case of auto declaration inside if condition:
struct Foo { int bar; };
void func()
{
if (auto s = new Foo)
s->; // auto completion does not work
}
Task-number: QTCREATORBUG-13805
Change-Id: Ia1776e8cc04e6040a6bf5f43cf82cfd6ce6dde7a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Trust the matcher to do the job.
Task-number: QTCREATORBUG-13564
Change-Id: I4ff14608a1ce12d3f4424242e50ba71233ac9bfd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
The variable is checked for 0 elsewhere in this method, so it probably
makes sense to check it here as well.
Change-Id: Idb869dda54ed340e1b2f03c7d4c06f2a93c00887
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
@classes, @protocols, @properties and -methods (and +methods) will now
show up in the locator.
Change-Id: I33f904c456c321fc80b8aba7ff52d5f1207c58be
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Relying on "_type" for the lambda was wrong.
In case of the bug report the return type of the lambda happened to be
the template class. Because of that Clone never stopped cloning.
Change-Id: I377d12e6a8278198abd1488fbdbc89b4157c1357
Task-number: QTCREATORBUG-12631
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...since it's superseded by the class Matcher.
For consistency, rename FullySpecifiedType::isEqualTo() to match().
Change-Id: I07640f9218d814e0350265de45f05929e5d595a9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...and not byte offsets anymore. This is necessary in order to calculate
the line and column numbers correctly with respect to unicode code
points.
Change-Id: I5d79857b3eaefeb8d563b4f1e3938a64debc5e08
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This will avoid confusion when later more length and indices methods are
added.
In Token:
length() --> bytes()
begin() --> bytesBegin()
end() --> bytesEnd()
Change-Id: I244c69b022e239ee762b4114559e707f93ff344f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
MEMBER was added in Qt5.
Task-number: QTCREATORBUG-10068
Change-Id: Ic6c15a0e5ee8981ab98e4c12fc1521dc281b731f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
E.g.:
enum E { x = 1 + 2 + 1 };
constantValue for enumeratorDeclaration currently is equal: '1+2+1'
(spaces between are removed).
Fixed version produces "1 + 2 + 1".
Change-Id: I38f7703bd5c856c28aadeecd7f7923aa4a7da422
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
...in order to better tell apart the type related functions
isScope()/asScope() and the functions dealing with enclosing scopes:
* scope() --> enclosingScope()
* setScope() --> setEnclosingScope()
* resetScope() --> resetEnclosingScope()
Change-Id: Id743a7d1b6a1a1a0ffcd8568cbd8ebbdfc16eaa1
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Although it's a C++11 feature, all sane compilers support it as an
extension to C++03/C++98.
Change-Id: I3c7b0db345d0b175554534e879717f4d14f48b0f
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
For the case:
const int x = 12;
enum E { e = x };
constantValue for EnumeratorDeclaration has value=' x'. It should have 'x'.
Change-Id: Iaca77cccd1e0dc5274696b0c96cec6ac2f904979
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Some qmake versions ignore "DEFINES += NDEBUG" on Windows.
Change-Id: Ibdf3b1036c2331dcef61dcd278463c02754044d2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
It works for full specialization. Instantiate of the partial
specialization has to be implemented(finding appropriate partial
specialization-on going)
Added unit test.
Change-Id: I8ef5ea963e7c665e0d67d390b3a833486773dab0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
For a given AST, CppRefactoringFile and Overview this will create a
ChangeSet for rewriting the pointer or reference declaration according
to the Overview.
Task-number: QTCREATORBUG-6169
Change-Id: If6f824c1ea5e9f53a11a58ec8b6d696d01f0723e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
This time in the 'new' expression. Changed it to make
new C(1, abc...) and new C{1, abc}
work.
Change-Id: I7232798fd083b653ee04ef9ede386d6536133e16
Reviewed-by: hjk <qthjk@ovi.com>
Also drop the unused 'initializer' member from
RangeBasedForStatementAST.
Change-Id: I078ebbc85cafa643af4bfe62d698bf7de71360e4
Reviewed-by: hjk <qthjk@ovi.com>
It'll be reused as the initializer expression for declarators
that are followed by "( expression-list )".
Change-Id: I6c76a76641941874ef1ed21daa7b6e057c6d170f
Reviewed-by: hjk <qthjk@ovi.com>
This was introduced in function extraction refactoring intended
to fix an issue with invalid class names: a66e344b42
The patch fixes only the regression itself - the previous fix
is correct.
The report below consists two parts. The other one is not a
regression but nevertheless is fixed by the previous patch.
Task-number: QTCREATORBUG-7730
Change-Id: I6f65584902619b542c9ce56cd0f37218a3d50104
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Those are the types char16_t and char32_t along with the new
char/string literals u'', U'', u"", u8"", and U"".
This is particularly important for the use of QStringLiteral
since in some platforms it relies on expansion such as above.
Note: The string literals quickfixes still need some tunning.
Task-number: QTCREATORBUG-7449
Change-Id: Iebcfea15677dc8e0ebb6143def89a5477e1be7d4
Reviewed-by: hjk <qthjk@ovi.com>
Now Qt Creator does not warn about lambda declaration with not empty
parameters list.
Task-number: QTCREATORBUG-6243
Change-Id: I07121a80fbca98c36820d1d8bb1be6e82ab96b12
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
Now we can parse:
auto foo()->int;
without getting semantic errors.
Change-Id: Id65c1198c20b2b0c7e8e4eee8ad176d0d66fc0d7
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>