llvm-project/clang/test/CXX/class
Hans Wennborg 84fe12d1e9 Provide better diagnostic wording for initializers on static
data member definitions when the variable has an initializer
in its declaration.

For the following code:

  struct S {
    static const int x = 42;
  };
  const int S::x = 42;

This patch changes the diagnostic from:

  a.cc:4:14: error: redefinition of 'x'
  const int S::x = 42;
               ^
  a.cc:2:20: note: previous definition is here
    static const int x = 42;
                     ^
to:

  a.cc:4:18: error: static data member 'x' already has an initializer
  const int S::x = 42;
                   ^
  a.cc:2:24: note: previous initialization is here
    static const int x = 42;
                         ^

Differential Revision: http://llvm-reviews.chandlerc.com/D2235

llvm-svn: 195306
2013-11-21 03:17:44 +00:00
..
class.base/class.base.init
class.bit
class.friend C++11: don't warn about the deprecated 'register' keyword if it's combined with 2013-06-17 01:34:01 +00:00
class.local
class.mem
class.mfct/class.mfct.non-static
class.nest Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
class.nested.type Teach typo correction to look inside of classes like it does namespaces. 2013-09-26 19:10:29 +00:00
class.static/class.static.data Provide better diagnostic wording for initializers on static 2013-11-21 03:17:44 +00:00
class.union Move -Wstatic-float-init fixit into a note & don't recover as if constexpr 2013-01-29 22:26:08 +00:00
p1-0x.cpp Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
p2-0x.cpp
p6-0x.cpp Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00