PrintingPolicy::SuppressScope was replaced by PrintingPolicy::Scope. Possible values for PrintingPolicy::Scope are:
- FullScope: Print all nested name specifiers (including the global scope specifier).
- This is necessary if a printed non-absolute scope would not select the desired scope. Example: Consider the following code:
namespace Z { namespace Z { namespace Y { class X { }; // (1) } } namespace Y { class X { }; // (2) } // (3) }
- Printing type ::Z::Y::X (marked with (2)) without FullScope results in Z::Y::X. If this is used at the position marked with (3), it will select the wrong type ::Z::Z::Y::X (marked with (1)). With FullScope the result is ::Z::Y::X and the correct type is selected.
- Please note that in some cases it is not possible to print the full scope. For example in case of a local class or a dependent name.
- DefaultScope: This corresponds to the previous behavior with SuppressScope==false: In case of an elaborated type, print the outer scope as written in the source. (If there is a tag keyword and no scope in the source then no scope is printed.) Otherwise print the full scope but without the global scope specifier. This distinction is made for inner scopes recursively.
- SuppressScope: Do not print any scope.