@@ -55,21 +55,67 @@ tag_invoke(
5555
5656
5757/* * Info for using declarations.
58+
59+ For instance, the following code:
60+
61+ @code
62+ using A::f; // where f is a function in namespace A
63+ @endcode
64+
65+ would be represented by a `UsingInfo` object.
66+
67+ Using-declarations can be used to introduce namespace
68+ members into other namespaces and block scopes, or to
69+ introduce base class members into derived class definitions,
70+ or to introduce enumerators into namespaces, block,
71+ and class scopes.
72+
5873 */
5974struct UsingInfo final
6075 : InfoCommonBase<InfoKind::Using>
6176{
62- /* * The kind of using declaration.
77+ /* * The using declaration.
6378 */
6479 UsingClass Class = UsingClass::Normal;
6580
66- /* * The symbols being "used".
67- */
68- std::vector<SymbolID> UsingSymbols;
81+ /* * The symbol being introduced.
82+
83+ This is the symbol that is being "used" or
84+ introduced into the current scope.
85+
86+ Note that this can be a qualified name, such as
87+ `A::f` in the example above.
88+ */
89+ Polymorphic<NameInfo> IntroducedName;
90+
91+ /* * The shadow declarations.
92+
93+ A using declaration can refer to and introduce
94+ multiple symbols into the current context.
95+
96+ These multiple symbols are considered a special
97+ case of declarations: "shadow declarations".
98+
99+ This typically happens when there are
100+ conflicting symbol names in the scope
101+ being introduced, such as:
102+
103+ * Overloaded functions: the base namespace contains
104+ overloaded functions.
105+ * Name conflicts: the base scope contains a function
106+ and a type.
107+ * Enums: a using enum declaration can refer to
108+ multiple enumerators.
109+
110+ Also note that more shadow declarations can be
111+ introduced later in the same scope, after
112+ the using declaration.
69113
70- /* * The qualifier for a using declaration.
114+ The shadow declarations here are only those
115+ that are shadowed at the point where the
116+ using declaration is located.
71117 */
72- Polymorphic<NameInfo> Qualifier ;
118+ std::vector<SymbolID> ShadowDeclarations ;
73119
74120 // --------------------------------------------
75121
@@ -94,8 +140,8 @@ tag_invoke(
94140{
95141 tag_invoke (t, io, dynamic_cast <Info const &>(I), domCorpus);
96142 io.map (" usingClass" , I.Class );
97- io.map (" shadows" , dom::LazyArray (I.UsingSymbols , domCorpus));
98- io.map (" qualifier" , I.Qualifier );
143+ io.map (" shadows" , dom::LazyArray (I.ShadowDeclarations , domCorpus));
144+ io.map (" qualifier" , I.IntroducedName );
99145}
100146
101147/* * Map the UsingInfo to a @ref dom::Value object.
0 commit comments