C does not have inline variables.
Add a few missing tests for related C++ diagnostics. Differential Revision: http://reviews.llvm.org/D22113 llvm-svn: 275493
This commit is contained in:
@@ -6178,7 +6178,10 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
|
||||
}
|
||||
|
||||
if (D.getDeclSpec().isInlineSpecified()) {
|
||||
if (CurContext->isFunctionOrMethod()) {
|
||||
if (!getLangOpts().CPlusPlus) {
|
||||
Diag(D.getDeclSpec().getInlineSpecLoc(), diag::err_inline_non_function)
|
||||
<< 0;
|
||||
} else if (CurContext->isFunctionOrMethod()) {
|
||||
// 'inline' is not allowed on block scope variable declaration.
|
||||
Diag(D.getDeclSpec().getInlineSpecLoc(),
|
||||
diag::err_inline_declaration_block_scope) << Name
|
||||
|
||||
Reference in New Issue
Block a user