From 196a2bb1d70ade1b7204bb795f29a3b2f42e2665 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Wed, 27 Jul 2005 02:01:58 +0000 Subject: [PATCH] Bug 66496 - added handling for macros that occur between 'class' and the class name for the model builder in quick parse mode. This is commonly used in Windows for dllexport'ing a whole class. --- .../cdt/core/parser/tests/QuickParseASTTests.java | 6 ++++-- .../org/eclipse/cdt/internal/core/parser/Parser.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java index 150498ba1f9..bfcb39c8c9a 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java @@ -2148,7 +2148,10 @@ public class QuickParseASTTests extends BaseASTTest public void testBug59179() throws Exception { Iterator i = parse( "class __decl main{ int main; };", true, false ).getDeclarations(); //$NON-NLS-1$ - assertFalse( i.hasNext() ); + // Bug 66496 - added in handling for things like this + // changing assertFalse to assertTrue + // however, I don't think this is really testing the bug... + assertTrue( i.hasNext() ); } public void testBug57652() throws Exception @@ -2156,7 +2159,6 @@ public class QuickParseASTTests extends BaseASTTest parse("struct file_operations driver_fops = { open: device_open, release: device_release };", true, true, ParserLanguage.C ).getDeclarations(); //$NON-NLS-1$ } - public void testBug60142() throws Exception { IASTVariable var = (IASTVariable) assertSoleDeclaration( "unsigned long var;"); //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java index 8397dda9a2b..52dc6c85d3e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java @@ -5626,8 +5626,14 @@ public class Parser implements IParserData, IParser setCompletionValues(sdw.getScope(), completionKind, KeywordSetKey.EMPTY); // class name - if (LT(1) == IToken.tIDENTIFIER) - duple = name(sdw.getScope(), completionKind, KeywordSetKey.EMPTY); + if (LT(1) == IToken.tIDENTIFIER) { + // Bug 66496 + // special magic to handle macros that resolve to dllimport/dllexport in quick parse + if (mode == ParserMode.QUICK_PARSE && LT(2) == IToken.tIDENTIFIER) + consume(); + + duple = name(sdw.getScope(), completionKind, KeywordSetKey.EMPTY); + } if (duple != null && !duple.isIdentifier()) nameType = ClassNameType.TEMPLATE; if (LT(1) != IToken.tCOLON && LT(1) != IToken.tLBRACE) {