diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-12 05:08:15 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-12 05:08:15 +0000 |
commit | 5fa6a0422f12216d549d0f2991a29d5690634065 (patch) | |
tree | f7ff1a70a40287cd2027094a4d059fb8fd4bc54a /lib/Sema/SemaType.cpp | |
parent | c6bfbca5733f1fc090b2149c4fff0548f1f15526 (diff) |
constexpr: don't consider class types with mutable members to be literal types.
The standard doesn't allow this, but mutable constexpr variables break the
semantics so badly that we can't reasonably accept them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 154b2a83f9..cee4ed67a1 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -4127,6 +4127,9 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T, Diag((*I)->getLocation(), diag::note_non_literal_field) << RD << (*I) << (*I)->getType(); return true; + } else if ((*I)->isMutable()) { + Diag((*I)->getLocation(), diag::note_non_literal_mutable_field) << RD; + return true; } } } else if (!RD->hasTrivialDestructor()) { |