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 - Function forward declaration inside the other function is not recognized
Summary: Function forward declaration inside the other function is not recognized
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-22 14:51 UTC by Alexander Pepin
Modified: 2016-10-31 10:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.