mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
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.
This commit is contained in:
parent
a7d6556d98
commit
196a2bb1d7
2 changed files with 12 additions and 4 deletions
|
@ -2148,7 +2148,10 @@ public class QuickParseASTTests extends BaseASTTest
|
||||||
public void testBug59179() throws Exception
|
public void testBug59179() throws Exception
|
||||||
{
|
{
|
||||||
Iterator i = parse( "class __decl main{ int main; };", true, false ).getDeclarations(); //$NON-NLS-1$
|
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
|
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$
|
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
|
public void testBug60142() throws Exception
|
||||||
{
|
{
|
||||||
IASTVariable var = (IASTVariable) assertSoleDeclaration( "unsigned long var;"); //$NON-NLS-1$
|
IASTVariable var = (IASTVariable) assertSoleDeclaration( "unsigned long var;"); //$NON-NLS-1$
|
||||||
|
|
|
@ -5626,8 +5626,14 @@ public class Parser implements IParserData, IParser
|
||||||
|
|
||||||
setCompletionValues(sdw.getScope(), completionKind, KeywordSetKey.EMPTY);
|
setCompletionValues(sdw.getScope(), completionKind, KeywordSetKey.EMPTY);
|
||||||
// class name
|
// class name
|
||||||
if (LT(1) == IToken.tIDENTIFIER)
|
if (LT(1) == IToken.tIDENTIFIER) {
|
||||||
duple = name(sdw.getScope(), completionKind, KeywordSetKey.EMPTY);
|
// 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())
|
if (duple != null && !duple.isIdentifier())
|
||||||
nameType = ClassNameType.TEMPLATE;
|
nameType = ClassNameType.TEMPLATE;
|
||||||
if (LT(1) != IToken.tCOLON && LT(1) != IToken.tLBRACE) {
|
if (LT(1) != IToken.tCOLON && LT(1) != IToken.tLBRACE) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue