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 - Failed deduction of auto variable in C++11
Summary: Failed deduction of auto variable in C++11
Status: RESOLVED DUPLICATE of bug 247031
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Other
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-11 23:49 UTC by Yankes
Modified: 2016-07-12 15:23 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 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 ***