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 256285 - Project with existing code lost C++11 flag after opening
Summary: Project with existing code lost C++11 flag after opening
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Other
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-31 00:50 UTC by Yankes
Modified: 2016-02-03 11:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test cases represents bug (1.12 KB, application/octet-stream)
2015-11-02 21:50 UTC, Yankes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yankes 2015-10-31 00:50:50 UTC
I have new project with existing code (based on Makefile) with manually set C++11.

Every time I open it and look on files I see that it treat all files as C++98.
After reparse every thing going back to normal.

btw after that I need reopen files because keyword coloring isn't updated too.
Comment 1 soldatov 2015-10-31 09:22:32 UTC
I think you problem described in issue 253681
Comment 2 Vladimir Voskresensky 2015-11-02 12:51:02 UTC
please, confirm that reopening file fixes the coloring

*** This bug has been marked as a duplicate of bug 253681 ***
Comment 3 Yankes 2015-11-02 21:50:57 UTC
Created attachment 157112 [details]
Test cases represents bug

After crating project based on this Makefile and reopening it I can't use C++11 support in IDE.
Comment 4 Yankes 2015-11-02 21:57:41 UTC
(In reply to Vladimir Voskresensky from comment #2)
> please, confirm that reopening file fixes the coloring
> 
> *** This bug has been marked as a duplicate of bug 253681 ***

This don't work, I added test cases in previous message.

Steps ->

Create project with existing sources based on Makefile.
Set C++11 in project options. Every thing work fine.
Close IDE and reopen it.
Project stick to C++98 syntax and is impossible switch to C++11 (even it still set in project settings).
Reparsing, reopening don't work.

After some random moves sometimes it will switch back to C++11, but I can't reproduce it.
Comment 5 Alexander Simon 2015-11-03 14:39:10 UTC
(In reply to Yankes from comment #4)
> (In reply to Vladimir Voskresensky from comment #2)
> > please, confirm that reopening file fixes the coloring
> > 
> > *** This bug has been marked as a duplicate of bug 253681 ***
> 
> This don't work, I added test cases in previous message.
> 
> Steps ->
> 
> Create project with existing sources based on Makefile.
> Set C++11 in project options. Every thing work fine.
> Close IDE and reopen it.
> Project stick to C++98 syntax and is impossible switch to C++11 (even it
> still set in project settings).
> Reparsing, reopening don't work.
> 
> After some random moves sometimes it will switch back to C++11, but I can't
> reproduce it.
(In reply to Yankes from comment #4)
> (In reply to Vladimir Voskresensky from comment #2)
> > please, confirm that reopening file fixes the coloring
> > 
> > *** This bug has been marked as a duplicate of bug 253681 ***
> 
> This don't work, I added test cases in previous message.
> 
> Steps ->
> 
> Create project with existing sources based on Makefile.
> Set C++11 in project options. Every thing work fine.
> Close IDE and reopen it.
> Project stick to C++98 syntax and is impossible switch to C++11 (even it
> still set in project settings).
> Reparsing, reopening don't work.
> 
> After some random moves sometimes it will switch back to C++11, but I can't
> reproduce it.
I see it is a duplicate of the bug #253681.
Could you reproduce the bug if you close all files before IDE closing?
Comment 6 Alexander Simon 2015-11-03 16:16:35 UTC
I was able to reproduce the issue when setting breakpoint in DocumentLanguageFlavorProvider.addProperty to emulate long init phase.
In this case default language filter (pure C++, not C++11) is used to lex and resolve identifiers in editor where i.e. constexpr is ID. For internal parser this ID is C++11 keyword and parsed correspondingly, so it can blink in color and blink is resolved/unresolved state.

As the solution we need to listen TokenHierarchy rebuild and run error HL once hierarchy was updated due to new language flavor.
Comment 7 Alexander Simon 2015-11-03 16:18:38 UTC
fixed in enum, change set:
d47493e7235a
Comment 8 Quality Engineering 2015-11-10 02:32:14 UTC
Integrated into 'main-silver', will be available in build *201511100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/008dc4989af6
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #256285 Project with existing code lost C++11 flag after opening
(transplanted from d47493e7235a152215f2bcedb9373c274e376e46)
Comment 9 Yankes 2015-11-14 15:55:59 UTC
Hello

I think there still corner cases not handled by this patch.
Usually it works but sometimes I get same bug again.
Reopening project or IDE fix it.

Situation is bit different that my previous report because I now use
normal project with "add existing items from folder" to include src files.
Another is that I use "-std=gnu++11" options to enable C++11 version.
Comment 10 Alexander Simon 2016-01-11 11:49:44 UTC
(In reply to Yankes from comment #9)
> Hello
> 
> I think there still corner cases not handled by this patch.
> Usually it works but sometimes I get same bug again.
> Reopening project or IDE fix it.
> 
> Situation is bit different that my previous report because I now use
> normal project with "add existing items from folder" to include src files.
> Another is that I use "-std=gnu++11" options to enable C++11 version.

Yankes,
I'd like to ask you to file a separate bug with your new project setup steps and steps which demo your issue with C++11 flavor. It looks you've faced similar, but different issue.
The most helpful scenario is if you can create sample project and attach it to the new bug with steps to reproduce.

Thanks!
Comment 11 Yankes 2016-01-22 01:23:29 UTC
(In reply to Alexander Simon from comment #10)
> (In reply to Yankes from comment #9)
> > Hello
> > 
> > I think there still corner cases not handled by this patch.
> > Usually it works but sometimes I get same bug again.
> > Reopening project or IDE fix it.
> > 
> > Situation is bit different that my previous report because I now use
> > normal project with "add existing items from folder" to include src files.
> > Another is that I use "-std=gnu++11" options to enable C++11 version.
> 
> Yankes,
> I'd like to ask you to file a separate bug with your new project setup steps
> and steps which demo your issue with C++11 flavor. It looks you've faced
> similar, but different issue.
> The most helpful scenario is if you can create sample project and attach it
> to the new bug with steps to reproduce.
> 
> Thanks!

done: https://netbeans.org/bugzilla/show_bug.cgi?id=257670#c0
Comment 12 soldatov 2016-02-03 11:55:55 UTC
Verified in NetBeans 8.1 patch1