1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Bug 574578 - Syntax error when using __declspec as type-id specifier

I initially applied a fix only to alias declarations by parsing it
before the type-id but to my surprise __declspec works more widely as a
type-id specifier.

Change-Id: I50217e2453f888207b73fc3f4c7ff1ea67bf5937
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
This commit is contained in:
Marc-Andre Laperle 2021-06-30 21:23:56 -04:00 committed by Marc-André Laperle
parent 99682412ce
commit 3b8fcb62e7
2 changed files with 15 additions and 0 deletions

View file

@ -5421,6 +5421,18 @@ public class AST2Tests extends AST2TestBase {
}
}
// using MyType = __declspec(dllexport) int;
//
// template <typename T>
// class Vector {
// };
// void test() {
// Vector <__declspec(dllexport) int> a;
// }
public void testDeclspecTypeId_574578() throws Exception {
parseAndCheckBindings(getAboveComment(), CPP, true);
}
// struct Outer {
// struct {int a1;};
// struct {int a2;} a3;

View file

@ -2816,6 +2816,9 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
case IGCCToken.t__attribute__:
case IGCCToken.tTT_underlying_type:
// msvc-compatibility
case IGCCToken.t__declspec:
// content assist
case IToken.tCOMPLETION:
return true;