MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029299Open CASCADE[OCCT] OCCT:Foundation Classespublic2017-11-07 17:082017-12-04 21:31
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.3.0*Fixed in Version 
Summary0029299: Foundation Classes, NCollection - define explicit empty constructor for map classes
DescriptionCurrently NCollection_Map, NCollection_DataMap define the following constructors:
  NCollection_DataMap (const Standard_Integer NbBuckets=1,
                     const Handle(NCollection_BaseAllocator)& theAllocator = 0L)

so that empty constructor is combined with initialization constructor by passing default arguments.

This may lead to broken code, when constructor is called implicitly by converting unrelated value to Standard_Integer, which is the first argument of map class constructor. In the following example, NCollection_Map::Contains (const NCollection_Map&) is called instead of NCollection_Map::Contains (const Quantity_ColorRGBA& ) because enumeration value can be used to initialize NCollection_Map() implicitly (this is for msvc10, newer compilers might put error here due to ambiguity):
NCollection_Map<Quantity_ColorRGBA, Quantity_ColorRGBAHasher> aColors;
if (aColors.Contains (Quantity_NOC_LIGHTGOLDENROD2))
{
  std::cerr << " @@ KO\n";
}
else
{
  std::cerr << " @@ OK\n";
}


Therefore, it is proposed defining explicit empty constructor and marking current constructor with explicit keyword.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot required
Attached Files

- Relationships
parent of 0029315verifiedbugmaster Internal compiler error after integration of the fix for bug 29299 

-  Notes
(0072021)
git (administrator)
2017-11-07 17:24

Branch CR29299 has been created by kgv.

SHA-1: ab11308b3179d06e8b740d0deca8cfc258089e33


Detailed log of new commits:

Author: kgv
Date: Tue Nov 7 17:23:29 2017 +0300

    0029299: Foundation Classes, NCollection - define explicit empty constructor for map classes
    
    Ambiguous constructors have been marked with explicit keyword for classes
    NCollection_DataMap, NCollection_DoubleMap, NCollection_IndexedDataMap, NCollection_IndexedMap,
    NCollection_List, NCollection_LocalArray, NCollection_Map, NCollection_Sequence,
    NCollection_SparseArray, NCollection_UBTree,
(0072022)
kgv (developer)
2017-11-07 18:41

Patch is ready for review.

http://jenkins-test-10.nnov.opencascade.com/view/CR29299-master-KGV [^]
(0072023)
git (administrator)
2017-11-07 21:32

Branch CR29299 has been updated forcibly by kgv.

SHA-1: e9eb73d35b0ed0e66ca166a3fd35801366eedf08
(0072109)
abv (manager)
2017-11-09 12:06

No remarks, please integrate
(0072112)
bugmaster (administrator)
2017-11-09 12:58

Combination -
OCCT branch : CR29299 SHA-1: e9eb73d35b0ed0e66ca166a3fd35801366eedf08
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Linux:
OCCT
Total CPU difference: 20701.46000000036 / 20729.730000000465 [-0.14%]
Products
Total CPU difference: 7924.590000000066 / 7934.890000000088 [-0.13%]
Windows:
OCCT
Total CPU difference: 18760.555459198367 / 18506.86663299847 [+1.37%]
Products
Total CPU difference: 8032.959492999945 / 7981.338762099939 [+0.65%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0072159)
git (administrator)
2017-11-10 12:15

Branch CR29299 has been deleted by kgv.

SHA-1: e9eb73d35b0ed0e66ca166a3fd35801366eedf08

- Related Changesets
occt: master b6a0525b
Timestamp: 2017-11-07 14:23:29
Author: kgv
Committer: bugmaster
Details ] Diff ]
0029299: Foundation Classes, NCollection - define explicit empty constructor for map classes

Ambiguous constructors have been marked with explicit keyword for classes
NCollection_DataMap, NCollection_DoubleMap, NCollection_IndexedDataMap, NCollection_IndexedMap,
NCollection_List, NCollection_LocalArray, NCollection_Map, NCollection_Sequence,
NCollection_SparseArray, NCollection_UBTree,
mod - src/NCollection/NCollection_DataMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_DoubleMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_IndexedDataMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_IndexedMap.hxx Diff ] File ]
mod - src/NCollection/NCollection_List.hxx Diff ] File ]
mod - src/NCollection/NCollection_LocalArray.hxx Diff ] File ]
mod - src/NCollection/NCollection_Map.hxx Diff ] File ]
mod - src/NCollection/NCollection_Sequence.hxx Diff ] File ]
mod - src/NCollection/NCollection_SparseArray.hxx Diff ] File ]
mod - src/NCollection/NCollection_UBTree.hxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2017-11-07 17:08 kgv New Issue
2017-11-07 17:08 kgv Assigned To => abv
2017-11-07 17:24 git Note Added: 0072021
2017-11-07 18:41 kgv Note Added: 0072022
2017-11-07 18:41 kgv Status new => resolved
2017-11-07 18:41 kgv Description Updated View Revisions
2017-11-07 21:32 git Note Added: 0072023
2017-11-09 12:06 abv Note Added: 0072109
2017-11-09 12:06 abv Assigned To abv => bugmaster
2017-11-09 12:06 abv Status resolved => reviewed
2017-11-09 12:46 bugmaster Test case number => Not required
2017-11-09 12:58 bugmaster Note Added: 0072112
2017-11-09 12:58 bugmaster Status reviewed => tested
2017-11-10 10:13 bugmaster Changeset attached => occt master b6a0525b
2017-11-10 10:13 bugmaster Status tested => verified
2017-11-10 10:13 bugmaster Resolution open => fixed
2017-11-10 12:15 git Note Added: 0072159
2017-12-04 21:31 kgv Relationship added parent of 0029315


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker