DWARF Debugging Format DWARF Debugging Standard Wiki

For detail description of the feature, please refer to:

http://www.artima.com/cppsource/rvalue.html

Overview

L-value reference is indicated by a single ampersand: &. (DW_TAG_reference_type)

R-value reference is indicated by two ampersands: &&.

The R-value reference can be passed into function as non-const values, thus allowing an object to modify them. This is useful for creating move semantics, so r-value can be accepted and returned without calling the copy constructor.

A&  ref1 = A();  // Error!
A&& ref2 = A();  // Ok

Both lvalue reference and rvalue reference can participate in overloading.

Proposed change to DWARF

Purpose:

New DWARF tag:


DW_TAG_rvalue_reference_type 0x41 C++0x R-value reference type


Allowable attributes: (modeled after DW_TAG_reference_type)

Example

A&& ref2;

<1><xxx>      DW_TAG_class_type
              DW_AT_name                  A
<1><yyy>      DW_TAG_rvalue_reference_type
              DW_AT_type                  <xxx>
<1><zzz>      DW_TAG_variable
              DW_AT_name                  ref2
              DW_AT_type                  <yyy>

dwarfstd.org is supported by Sourceware. Contributions are welcome.

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2022 by DWARF Standards Committee.