Provide a fixit for constexpr non-static data members.
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 30 Jan 2013 01:22:18 +0000 (01:22 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 30 Jan 2013 01:22:18 +0000 (01:22 +0000)
commit35506f82025c7dd0980d7553e6f9b6df2a4d2b30
tree10a15b72e8d9559dd66c50e63c8131b4b8ce870a
parent4d365ba9b972b14a182976476fdbfb374721bd9c
Provide a fixit for constexpr non-static data members.

If the member has an initializer, assume it was probably intended to be static
and suggest/recover with that.

If the member doesn't have an initializer, assume it was probably intended to
be const instead of constexpr and suggest that.

(if the attempt to apply these changes fails, don't make any suggestion &
produce the same diagnostic experience as before. The only case where this can
come up that I know of is with a mutable constexpr with an initializer, since
mutable is incompatible with static (but it's already incompatible with
const anyway))

llvm-svn: 173873
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
clang/test/FixIt/fixit-cxx0x.cpp