This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 256296
Collapse All | Expand All

(-)a/cnd.completion/src/org/netbeans/modules/cnd/completion/cplusplus/ext/CsmCompletionTokenProcessor.java (-1 / +26 lines)
Lines 1954-1961 Link Here
1954
                        CsmCompletionExpression opExp = createTokenExp(UNARY_OPERATOR);
1954
                        CsmCompletionExpression opExp = createTokenExp(UNARY_OPERATOR);
1955
                        pushExp(opExp); // add operator as new exp
1955
                        pushExp(opExp); // add operator as new exp
1956
                        break;
1956
                        break;
1957
                        
1958
                    case CONVERSION:
1959
                        if (top.getTokenCount() > 0) {
1960
                            CppTokenId firstTokId = top.getTokenID(0);
1961
                            if (CppTokenId.STATIC_CAST == firstTokId ||
1962
                                CppTokenId.DYNAMIC_CAST == firstTokId ||
1963
                                CppTokenId.REINTERPRET_CAST == firstTokId)
1964
                            {
1965
                                // Postfix operator
1966
                                opExp = createTokenExp(UNARY_OPERATOR);
1967
                                popExp();
1968
                                opExp.addParameter(top);
1969
                                pushExp(opExp);
1970
                            } else if (top.getParameterCount() > 0 && top.getParameter(0).getExpID() != TYPE) {
1971
                                // Postfix operator after PARENTHESIS
1972
                                opExp = createTokenExp(UNARY_OPERATOR);
1973
                                popExp();
1974
                                opExp.addParameter(createTokenExp(PARENTHESIS, top, true));
1975
                                pushExp(opExp);
1976
                            } else {
1977
                                errorState = true;
1978
                            }
1979
                        }
1980
                        break;
1957
1981
1958
                    case VARIABLE: // is it only one permitted?
1982
                    case PARENTHESIS:
1983
                    case VARIABLE:
1959
                        // Postfix operator
1984
                        // Postfix operator
1960
                        opExp = createTokenExp(UNARY_OPERATOR);
1985
                        opExp = createTokenExp(UNARY_OPERATOR);
1961
                        popExp(); // pop top
1986
                        popExp(); // pop top
(-)930a1c0f0231 (+10 lines)
Added Link Here
1
namespace bug256296 {
2
    struct AAA256296 {
3
        int field;
4
    };
5
6
    int foo256296() {
7
        AAA256296 *pointer = 0;
8
        return ((pointer)++)->field;
9
    }
10
}
(-)a/cnd.completion/test/unit/src/org/netbeans/modules/cnd/completion/cplusplus/hyperlink/BasicHyperlinkTestCase.java (+5 lines)
Lines 1154-1159 Link Here
1154
        performTest("bug255900.h", 4, 9, "bug255900.cpp", 1, 1);
1154
        performTest("bug255900.h", 4, 9, "bug255900.cpp", 1, 1);
1155
    }
1155
    }
1156
    
1156
    
1157
    public void testBug256296() throws Exception {
1158
        // Bug 256296 - Additional parens in expression break parser
1159
        performTest("bug256296.cpp", 8, 32, "bug256296.cpp", 3, 9);
1160
    }
1161
    
1157
    public static class Failed extends HyperlinkBaseTestCase {
1162
    public static class Failed extends HyperlinkBaseTestCase {
1158
1163
1159
        @Override
1164
        @Override

Return to bug 256296