Move most of the checking from ActOnCXXMemberDeclarator to other, more general routines. This is a step toward separating the checking logic from Declarators, which in turn is required for template instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66734 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp
index 776fb09..628253b 100644
--- a/test/SemaCXX/class.cpp
+++ b/test/SemaCXX/class.cpp
@@ -35,7 +35,7 @@
int i = 0; // expected-error {{error: 'i' can only be initialized if it is a static const integral data member}}
static int si = 0; // expected-error {{error: 'si' can only be initialized if it is a static const integral data member}}
static const NestedC ci = 0; // expected-error {{error: 'ci' can only be initialized if it is a static const integral data member}}
- static const int nci = vs; // expected-error {{error: initializer element is not a compile-time constant}}
+ static const int nci = vs; // expected-error {{in-class initializer is not an integral constant expression}}
static const int vi = 0;
static const E evi = 0;
@@ -53,7 +53,7 @@
typedef int A;
- virtual int viv; // expected-error {{error: 'virtual' can only appear on non-static member functions}}
+ virtual int viv; // expected-error {{'virtual' can only appear on non-static member functions}}
virtual static int vsif(); // expected-error {{error: 'virtual' can only appear on non-static member functions}}
virtual int vif();
diff --git a/test/SemaCXX/virtuals.cpp b/test/SemaCXX/virtuals.cpp
index 6cbf3ef..ad82edd 100644
--- a/test/SemaCXX/virtuals.cpp
+++ b/test/SemaCXX/virtuals.cpp
@@ -8,10 +8,15 @@
void i() = 1; // expected-error {{initializer on function does not look like a pure-specifier}}
void j() = 0u; // expected-error {{initializer on function does not look like a pure-specifier}}
+
+ void k();
+
public:
A(int);
};
+virtual void A::k() { } // expected-error{{'virtual' can only be specified inside the class definition}}
+
class B : public A {
// Needs to recognize that overridden function is virtual.
//void g() = 0;