
Summary: Due to a recent (but retroactive) C++ rule change, only sufficiently C-compatible classes are permitted to be given a typedef name for linkage purposes. Add an enabled-by-default warning for these cases, and rephrase our existing error for the case where we encounter the typedef name for linkage after we've already computed and used a wrong linkage in terms of the new rule. Reviewers: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74103
11 lines
208 B
C++
11 lines
208 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
void f() {
|
|
struct X {
|
|
static int a; // expected-error {{static data member 'a' not allowed in local struct 'X'}}
|
|
int b;
|
|
|
|
static void f() { }
|
|
};
|
|
}
|