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 258332

Summary: Failed deduction of auto variable in C++11
Product: cnd Reporter: Yankes
Component: Code ModelAssignee: petrk
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:

Description Yankes 2016-03-11 23:49:07 UTC
I have valid C++11 code:

-->%--->%--->%--->%--

struct X
{
	bool getPact() {}
};

int main()
{
	auto x = X{};
	x.getPact(); //error: Unable to resolve identifier
}

--%<---%<---%<---%<--

When I change brackets in `X{}` to `X()` error disappear.
Comment 1 Yankes 2016-03-19 16:52:24 UTC
Another similar bug case, but now with function:


-->%--->%--->%--->%--


struct X
{
	bool getPact() {}
};

X func(int i);

int main()
{
	auto x = func({}); //without `{}` its work
	x.getPact(); //error: Unable to resolve identifier
}


--%<---%<---%<---%<--
Comment 2 petrk 2016-07-12 15:23:59 UTC

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