forked from qt-creator/qt-creator
CPlusPlus: Support C++11 attributes also for function parameters
Fixes: QTCREATORBUG-24636 Change-Id: I9dc3d2cc6ca102b09f6b040455fa901c362dae7d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
5
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
5
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -2113,6 +2113,11 @@ bool Parser::parseParameterDeclarationList(ParameterDeclarationListAST *&node)
|
||||
bool Parser::parseParameterDeclaration(ParameterDeclarationAST *&node)
|
||||
{
|
||||
DEBUG_THIS_RULE();
|
||||
if (_languageFeatures.cxx11Enabled) {
|
||||
SpecifierListAST *attr_specifier_seq = nullptr;
|
||||
while (parseStdAttributeSpecifier(attr_specifier_seq))
|
||||
;
|
||||
}
|
||||
SpecifierListAST *decl_specifier_seq = nullptr;
|
||||
if (parseDeclSpecifierSeq(decl_specifier_seq)) {
|
||||
ParameterDeclarationAST *ast = new (_pool) ParameterDeclarationAST;
|
||||
|
@@ -1338,7 +1338,7 @@ void tst_AST::cpp11_variadic_inheritance()
|
||||
void tst_AST::cpp11_attributes()
|
||||
{
|
||||
QSharedPointer<TranslationUnit> unit(parseDeclaration(
|
||||
"[[noreturn]] void f() {throw \"error\";}",
|
||||
"[[noreturn]] void f([[maybe_unused]] int v) {throw \"error\";}",
|
||||
false, false, true));
|
||||
AST *ast = unit->ast();
|
||||
QVERIFY(ast != nullptr);
|
||||
|
Reference in New Issue
Block a user