It's very easy for anonymous external linkage to propagate in C++ through return types and parameter types. Likewise, it's possible that a template containing an inline function is only used with parameters that have internal linkage. Actually diagnosing where the internal linkage comes from is fairly difficult (both to locate and then to print nicely). Finally, since we only have one translation unit available, we can't even prove that any of this violates the ODR. This warning needs better-defined behavior in C++ before it can really go in. Rewording of the C warning (which /is/ specified by C99) coming shortly. llvm-svn: 158836
6 lines
221 B
C++
6 lines
221 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// Check that we don't allow illegal uses of inline
|
|
// (checking C++-only constructs here)
|
|
struct c {inline int a;}; // expected-error{{'inline' can only appear on functions}}
|