http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59314

            Bug ID: 59314
           Summary: [DR 1054] [C++11] access to volatile through reference
                    should cause load
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

I believe the information at
http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Volatiles.html is true of C++03
but not C++11.

The relevant change is
http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1054 and so the last
line below should undergo lvalue-to-rvalue conversion and so should access the
volatile:

    volatile int i=0;
    volatile int& r = i;
    r;

Reply via email to