From 33f992425213f381fc503699b26ee8cf9b60494e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 17 May 2010 18:19:56 +0000 Subject: [PATCH] mutable is a storage class that can follow a class/struct/union definition. Fixes PR7153 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103954 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseDeclCXX.cpp | 1 + test/SemaCXX/class.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 149efda855..3d74d4dc7d 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -981,6 +981,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, case tok::kw_typedef: // struct foo {...} typedef x; case tok::kw_register: // struct foo {...} register x; case tok::kw_auto: // struct foo {...} auto x; + case tok::kw_mutable: // struct foo {...} mutable x; // As shown above, type qualifiers and storage class specifiers absolutely // can occur after class specifiers according to the grammar. However, // almost noone actually writes code like this. If we see one of these, diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp index 7eea67ad44..09578e6900 100644 --- a/test/SemaCXX/class.cpp +++ b/test/SemaCXX/class.cpp @@ -136,3 +136,9 @@ namespace pr6629 { }; }; } + +namespace PR7153 { + class EnclosingClass { + struct A { } mutable *member; + }; +} -- 2.40.0