[Bug c++/56380] New: Const/reference mutable members are not always rejected in class templates

pl.smith.mail at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Feb 18 17:00:00 GMT 2013


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

             Bug #: 56380
           Summary: Const/reference mutable members are not always
                    rejected in class templates
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pl.smith.mail@gmail.com


GCC (all versions?) accepts mutable members of const-qualified/reference type
in class templates, if the const-ness/reference-ness is introduced during
instantiation:

template <typename T>
struct X {
  X();
  mutable T x;
};

X<const int> a; // no error
X<int&> b;      // no error



More information about the Gcc-bugs mailing list