Bug 395581 - calling convention in overloaded functions
Summary: calling convention in overloaded functions
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-03 03:49 EST by Alexander Nikitin CLA
Modified: 2012-12-03 03:49 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nikitin CLA 2012-12-03 03:49:00 EST
the following code in c++ project (Microsoft Visual Studio Toolchain) results in Semantic Error (Invalid redefinition of call_func (second definition)):

#include <iostream>

void __cdecl foo () {
	std::cout << "foo" << std::endl;
}

void __stdcall bar () {
	std::cout << "bar" << std::endl;
}

void call_func ( void  (__cdecl * ptr) () ) {
	std::cout << "calling cdecl func" << std::endl;
	ptr();
}

void call_func ( void  (__stdcall * ptr) () ) {
	std::cout << "calling stdcall func" << std::endl;
	ptr();
}

int main(int argc, char **argv) {
	call_func(foo);
	call_func(bar);
	return 0;
}