diff options
Diffstat (limited to 'clang/test/SemaCXX/class.cpp')
-rw-r--r-- | clang/test/SemaCXX/class.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp index 7eeecdc5770..ada508ac322 100644 --- a/clang/test/SemaCXX/class.cpp +++ b/clang/test/SemaCXX/class.cpp @@ -61,6 +61,11 @@ private: int x,y; static int sx; + mutable int mi; + mutable int &mir; // expected-error {{error: 'mutable' cannot be applied to references}} + mutable void mfn(); // expected-error {{error: 'mutable' cannot be applied to functions}} + mutable const int mci; // expected-error {{error: 'mutable' and 'const' cannot be mixed}} + static const int number = 50; static int arr[number]; }; @@ -76,3 +81,11 @@ class C2 { }; } }; + +// Play with mutable a bit more, to make sure it doesn't crash anything. +mutable int gi; // expected-error {{error: 'mutable' can only be applied to member variables}} +mutable void gfn(); // expected-error {{illegal storage class on function}} +void ogfn() +{ + mutable int ml; // expected-error {{error: 'mutable' can only be applied to member variables}} +} |