nathanchance updated this revision to Diff 548337. nathanchance added a comment.
- Update formatting in release notes - Add GCC bug link to commit message - Remove unnecessary REQUIRES: in test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157435/new/ https://reviews.llvm.org/D157435 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaDecl.cpp clang/test/Sema/warn-missing-variable-declarations-register.c Index: clang/test/Sema/warn-missing-variable-declarations-register.c =================================================================== --- /dev/null +++ clang/test/Sema/warn-missing-variable-declarations-register.c @@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -Wmissing-variable-declarations -fsyntax-only -verify %s +// expected-no-diagnostics + +register unsigned long current_stack_pointer asm("rsp"); Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -14144,6 +14144,7 @@ var->getDeclContext()->getRedeclContext()->isFileContext() && var->isExternallyVisible() && var->hasLinkage() && !var->isInline() && !var->getDescribedVarTemplate() && + var->getStorageClass() != SC_Register && !isa<VarTemplatePartialSpecializationDecl>(var) && !isTemplateInstantiation(var->getTemplateSpecializationKind()) && !getDiagnostics().isIgnored(diag::warn_missing_variable_declarations, Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -123,6 +123,8 @@ template-specialization function calls. - Clang contexpr evaluator now displays notes as well as an error when a constructor of a base class is not called in the constructor of its derived class. +- Clang no longer emits ``-Wmissing-variable-declarations`` for variables declared + with the ``register`` storage class. Bug Fixes in This Version -------------------------
Index: clang/test/Sema/warn-missing-variable-declarations-register.c =================================================================== --- /dev/null +++ clang/test/Sema/warn-missing-variable-declarations-register.c @@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -Wmissing-variable-declarations -fsyntax-only -verify %s +// expected-no-diagnostics + +register unsigned long current_stack_pointer asm("rsp"); Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -14144,6 +14144,7 @@ var->getDeclContext()->getRedeclContext()->isFileContext() && var->isExternallyVisible() && var->hasLinkage() && !var->isInline() && !var->getDescribedVarTemplate() && + var->getStorageClass() != SC_Register && !isa<VarTemplatePartialSpecializationDecl>(var) && !isTemplateInstantiation(var->getTemplateSpecializationKind()) && !getDiagnostics().isIgnored(diag::warn_missing_variable_declarations, Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -123,6 +123,8 @@ template-specialization function calls. - Clang contexpr evaluator now displays notes as well as an error when a constructor of a base class is not called in the constructor of its derived class. +- Clang no longer emits ``-Wmissing-variable-declarations`` for variables declared + with the ``register`` storage class. Bug Fixes in This Version -------------------------
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits