1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Fix for 195701, failure to parse visibility attribute for namespaces.

This commit is contained in:
Markus Schorn 2007-07-10 12:06:35 +00:00
parent 8c8fddbf72
commit 9e772f1ad6
2 changed files with 15 additions and 0 deletions

View file

@ -5481,4 +5481,16 @@ public class AST2CPPTests extends AST2BaseTest {
assertTrue(binding instanceof IFunction);
assertFalse(binding instanceof IProblemBinding);
}
// #define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V)))
// #define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY(default) {
// _GLIBCXX_BEGIN_NAMESPACE(std)
// } // end the namespace
public void testBug195701() throws Exception {
StringBuffer buffer = getContents(1)[0];
parse( buffer.toString(), ParserLanguage.CPP, true, true );
}
}

View file

@ -2650,6 +2650,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
} else
name = createName();
// bug 195701, gcc 4.2 allows visibility attribute for namespaces.
__attribute_decl_seq(true, false);
if (LT(1) == IToken.tLBRACE) {
consume();
ICPPASTNamespaceDefinition namespaceDefinition = createNamespaceDefinition();