-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XML output: avoid warnings with scoped enum values in anonymous names…
…paces. When a C++11 `enum class` was present in an anonymous namespace (usually in *.cpp files), the XML output was emitting warnings similar to the following: Internal inconsistency: member False does not belong to any container! And the XML output was rendering bogus IDs for enum values starting with `dummy_`, such as: dummy_1a96ab6574751fdf6a53ceec8a3896c45daf8320b26d30ab433c5a54546d21f414c The fix is to call memberOutputFileBase() on the enumeration itself and not on the enum value, that way it provides correct file base that corresponds to file base of the enumeration. There's also a new test that checks this. Note: this assumes that enum values belong to the same compound as enums themselves. In my experience that was always the case and there's no broken test after this change, so I hope I didn't break anything.
- Loading branch information
Showing
3 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> | ||
<compounddef id="namespace_a_namespace_1_1_0D0" kind="namespace" language="C++"> | ||
<compoundname>ANamespace::@0</compoundname> | ||
<sectiondef kind="enum"> | ||
<memberdef kind="enum" id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45d" prot="public" static="no" strong="yes"> | ||
<type/> | ||
<name>Boolean</name> | ||
<enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45daf8320b26d30ab433c5a54546d21f414c" prot="public"> | ||
<name>False</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
</enumvalue> | ||
<enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45daf827cf462f62848df37c5e1e94a4da74" prot="public"> | ||
<name>True</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
</enumvalue> | ||
<enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45da2767828026039e8ba7b38973cbb701f2" prot="public"> | ||
<name>FileNotFound</name> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
</enumvalue> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<inbodydescription> | ||
</inbodydescription> | ||
<location file="071_enum_in_anon_ns.cpp" line="6" column="1" bodyfile="071_enum_in_anon_ns.cpp" bodystart="6" bodyend="10"/> | ||
</memberdef> | ||
</sectiondef> | ||
<briefdescription> | ||
</briefdescription> | ||
<detaileddescription> | ||
</detaileddescription> | ||
<location file="071_enum_in_anon_ns.cpp" line="4" column="1"/> | ||
</compounddef> | ||
</doxygen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// objective: test that enum values in anonymous namespaces produce no warning | ||
// check: namespace_a_namespace_1_1_0D0.xml | ||
|
||
namespace ANamespace { namespace { | ||
|
||
enum class Boolean { | ||
False, | ||
True, | ||
FileNotFound | ||
}; | ||
|
||
}} |