View | Details | Raw Unified | Return to bug 33558
Collapse All | Expand All

(-)gcc/testsuite/g++.dg/other/pr33558.C (+5 lines)
Line 0 Link Here
1
/* { dg-do compile } */
2
3
class X {
4
  mutable int &q; /* { dg-error "cannot be declared 'mutable'" } */
5
};
(-)gcc/cp/decl.c (+5 lines)
Lines 8897-8902 grokdeclarator (const cp_declarator *declarator, Link Here
8897
	  error ("const %qs cannot be declared %<mutable%>", name);
8897
	  error ("const %qs cannot be declared %<mutable%>", name);
8898
	  storage_class = sc_none;
8898
	  storage_class = sc_none;
8899
	}
8899
	}
8900
      else if (TREE_CODE (type) == REFERENCE_TYPE)
8901
	{
8902
	  error ("reference member %qs cannot be declared %<mutable%>", name);
8903
	  storage_class = sc_none;
8904
	}
8900
    }
8905
    }
8901
8906
8902
  /* If this is declaring a typedef name, return a TYPE_DECL.  */
8907
  /* If this is declaring a typedef name, return a TYPE_DECL.  */

Return to bug 33558