Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353265

Summary: C++ analysis cannot resolve variables declared in conditional statements
Product: [Tools] CDT Reporter: Talin <viridia>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: CLOSED DUPLICATE QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif, zeratul976
Version: 8.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Talin CLA 2011-07-27 21:25:57 EDT
Build Identifier: 20110615-0604

The C++ code analyzer reports that the symbol 'var' could not be resolved in the following statement:

   if (VariableDefn * var = dyn_cast<VariableDefn>(*it)) {
     // etc...
   }

This appears to affect every case of a variable being declared in a conditional expression.


Reproducible: Always
Comment 1 Tomasz Wesolowski CLA 2011-08-01 05:50:41 EDT
I can't reproduce that error. Can you provide a single standalone .cpp file which would show the problem?
Comment 2 Nathan Ridge CLA 2013-07-21 23:31:50 EDT
This has since been fixed (see bug 362976).
Comment 3 Nathan Ridge CLA 2016-12-22 18:49:41 EST

*** This bug has been marked as a duplicate of bug 362976 ***