Commit 653b8142 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Accept gcc attributes in cv-qualifiers.

parent 266ee2a4
......@@ -751,6 +751,9 @@ bool Parser::parseCvQualifiers(SpecifierAST *&node)
spec->specifier_token = consumeToken();
*ast = spec;
ast = &(*ast)->next;
} else if(LA() == T___ATTRIBUTE__) {
parseAttributeSpecifier(*ast);
ast = &(*ast)->next;
} else {
break;
}
......
load(qttest_p4)
include(../shared/shared.pri)
QT = core
SOURCES += tst_ast.cpp
......@@ -36,6 +36,9 @@ public:
{ return parse(source, TranslationUnit::ParseStatement); }
private slots:
// declarations
void gcc_attributes_1();
// expressions
void simple_name();
void template_id();
......@@ -54,6 +57,13 @@ private slots:
void objc_protocol_definition_1();
};
void tst_AST::gcc_attributes_1()
{
QSharedPointer<TranslationUnit> unit(parseDeclaration("\n"
"static inline void *__attribute__((__always_inline__)) _mm_malloc(size_t size, size_t align);"
));
}
void tst_AST::simple_name()
{
QSharedPointer<TranslationUnit> unit(parseExpression("a"));
......
......@@ -5,3 +5,4 @@
#define __asm__(a...)
#define restrict
#define __restrict
#define __weak
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment