Bug 69744 - Multiple catch statements cause indexer warning
Summary: Multiple catch statements cause indexer warning
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Andrew Niefer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-09 14:06 EDT by Julien Dubuc CLA
Modified: 2004-08-10 14:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Dubuc CLA 2004-07-09 14:06:27 EDT
when not one, but many "catch" statements follow a single "try" statement, 
indexer creates warnings. 

example:

        catch (Exception except)
        {
            result.error(except.what());
            m_pReport->addResult(result);
        }
        catch (std::exception except)
        {
            result.error(except.what());
            m_pReport->addResult(result);
        }
        catch (...)
        {
            result.error("Unexpected error!");
            m_pReport->addResult(result);
        }

The indexer generates a warning for the second and third catch statements. Ti 
looks like this:

C/C++ Indexer Problem: Syntax error encountered ... (file, line)

I don't think that's right.
Comment 1 Andrew Niefer CLA 2004-07-12 15:10:08 EDT
The problem is not so much with multiple catch statements, I had no problems 
catching exceptions using simple empty classes I declared.

The problem here is that there was a problem parsing the std::exception class 
which causes a problem on that catch, and also seems to leave us in a bad state 
that flags all following catches as problems too.
Comment 2 Andrew Niefer CLA 2004-07-12 15:59:10 EDT
I was a little premature with my earlier comment, we are successfully parsing 
std::exception.  So assuming your inclusions are right, I'm not sure what would 
have caused the initial problem and there is not enough information here to do 
anything about that.

I have submitted a fix to the HEAD for better error handling that allows the 
parser to recover properly and parse the remainder of the catch blocks.

This fix will be propagated to the 2.0.1 branch at a later date with the rest 
of the parser fixes.

you can reopen the bug if you have more information about the first problem
Comment 3 Andrew Niefer CLA 2004-08-10 14:00:48 EDT
fix is now in 2.0.1