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.

Bug 214632

Summary: Function forward declaration inside the other function is not recognized
Product: cnd Reporter: Alexander Pepin <apepin>
Component: Code ModelAssignee: petrk
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Alexander Pepin 2012-06-22 14:51:28 UTC
This bug got visible after  fixing bug #206416 (Renaming a local variable in C/C++ code changes the name of other variables with the same name in other scopes).
Steps to reproduce:
- create a C/C++ application with the following code:

#include <iostream>
//void printHello();
int main(int argc, char**argv) {
void printHello();
    // Prints welcome message...
    printHello();
    return 0;
}
void printHello(){
    std::cout << "Welcome ..." << std::endl;
}
 
Result: Forvard declaration of the printHello() function is not recognized. As a result Rename does not work (produce non-compilable code). If I use forward function declaration outside main function (currently commented) then everything is OK.