mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Fix for 195701, failure to parse visibility attribute for namespaces.
This commit is contained in:
parent
8c8fddbf72
commit
9e772f1ad6
2 changed files with 15 additions and 0 deletions
|
@ -5481,4 +5481,16 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertTrue(binding instanceof IFunction);
|
assertTrue(binding instanceof IFunction);
|
||||||
assertFalse(binding instanceof IProblemBinding);
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2650,6 +2650,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
} else
|
} else
|
||||||
name = createName();
|
name = createName();
|
||||||
|
|
||||||
|
// bug 195701, gcc 4.2 allows visibility attribute for namespaces.
|
||||||
|
__attribute_decl_seq(true, false);
|
||||||
|
|
||||||
if (LT(1) == IToken.tLBRACE) {
|
if (LT(1) == IToken.tLBRACE) {
|
||||||
consume();
|
consume();
|
||||||
ICPPASTNamespaceDefinition namespaceDefinition = createNamespaceDefinition();
|
ICPPASTNamespaceDefinition namespaceDefinition = createNamespaceDefinition();
|
||||||
|
|
Loading…
Add table
Reference in a new issue