llvm-project/clang/lib/Sema
Alexey Bataev 77aed73c2d [OpenMP] diagnose assign to firstprivate const, patch by Joel E. Denny
Summary:
[OpenMP] diagnose assign to firstprivate const

Clang does not diagnose assignments to const variables declared
firstprivate.  Furthermore, codegen is broken such that, at run time,
such assignments simply have no effect.  For example, the following
prints 0 not 1:

int main() {
  const int i = 0;
  #pragma omp parallel firstprivate(i)
  { i=1; printf("%d\n", i); }
  return 0;
}

This commit makes these assignments a compile error, which is
consistent with other OpenMP compilers I've tried (pgcc 17.4-0, gcc
6.3.0).

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D39859

llvm-svn: 317891
2017-11-10 15:39:50 +00:00
..
AnalysisBasedWarnings.cpp Enable support for the [[fallthrough]] attribute from WG14 N2052 when enabling double square bracket attributes in C code. 2017-10-18 14:33:27 +00:00
AttributeList.cpp Add -f[no-]double-square-bracket-attributes as new driver options to control use of [[]] attributes in all language modes. This is the initial implementation of WG14 N2165, which is a proposal to add [[]] attributes to C2x, but also allows you to enable these attributes in C++98, or disable them in C++11 or later. 2017-10-15 15:01:42 +00:00
CMakeLists.txt Enabling the /bigobj flag for SemaDeclAttr.cpp. 2017-05-12 14:30:49 +00:00
CodeCompleteConsumer.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
CoroutineStmtBuilder.h [coroutines] Fix rebuilding of dependent coroutine parameters 2017-06-03 00:22:18 +00:00
DeclSpec.cpp Recommit "Add _Float16 as a C/C++ source language type" 2017-09-08 15:15:00 +00:00
DelayedDiagnostic.cpp [Sema] Don't allow -Wunguarded-availability to be silenced with redecls 2017-07-05 17:08:56 +00:00
IdentifierResolver.cpp [modules] Separately track whether an identifier's preprocessor information and 2016-02-05 19:03:40 +00:00
JumpDiagnostics.cpp [Sema][ObjC] Disallow jumping into ObjC fast enumeration loops. 2017-04-19 17:54:08 +00:00
MultiplexExternalSemaSource.cpp Fix warnings. [-Wdocumentation] 2017-10-12 09:42:14 +00:00
Scope.cpp [Parser] Clear the TemplateParamScope bit of the current scope's flag 2016-04-29 02:24:14 +00:00
ScopeInfo.cpp [coroutines] Fix diagnostics depending on the first coroutine statement. 2017-03-11 02:35:37 +00:00
Sema.cpp Fix -Wunused-private-field to fire regardless of which implicit special members have been implicitly declared. 2017-11-01 04:52:12 +00:00
SemaAccess.cpp P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991: 2016-06-28 19:03:57 +00:00
SemaAttr.cpp -Wpragma-pack: add an additional note and fixit when warning 2017-07-31 13:37:50 +00:00
SemaCUDA.cpp Function with unparsed body is a definition 2017-06-21 12:46:57 +00:00
SemaCXXScopeSpec.cpp Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
SemaCast.cpp Allow the target field of a CK_ToUnion to be more easily recovered. 2017-08-15 21:42:47 +00:00
SemaChecking.cpp [X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall. 2017-11-08 04:54:26 +00:00
SemaCodeComplete.cpp Avoid printing some redundant name qualifiers in completion 2017-11-08 10:39:09 +00:00
SemaConsumer.cpp
SemaCoroutine.cpp [coroutines] Make sure auto return type of await_resume is properly handled 2017-09-05 19:31:52 +00:00
SemaDecl.cpp Add default calling convention support for regcall. 2017-11-02 21:08:00 +00:00
SemaDeclAttr.cpp Convert clang::LangAS to a strongly typed enum 2017-10-15 18:48:14 +00:00
SemaDeclCXX.cpp Change assertion to quick exit from checking function. 2017-11-01 03:57:27 +00:00
SemaDeclObjC.cpp [Sema] Add support for flexible array members in Obj-C. 2017-10-23 22:01:41 +00:00
SemaExceptionSpec.cpp [coroutines] Add DependentCoawaitExpr and fix re-building CoroutineBodyStmt. 2017-03-06 23:38:15 +00:00
SemaExpr.cpp [OpenMP] diagnose assign to firstprivate const, patch by Joel E. Denny 2017-11-10 15:39:50 +00:00
SemaExprCXX.cpp mplement __has_unique_object_representations 2017-10-24 21:31:50 +00:00
SemaExprMember.cpp Fix -Wunused-private-field to fire regardless of which implicit special members have been implicitly declared. 2017-11-01 04:52:12 +00:00
SemaExprObjC.cpp [ObjC] Boxed strings should use the nullability from stringWithUTF8String's return type 2017-11-08 21:33:15 +00:00
SemaFixItUtils.cpp Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call 2015-12-18 21:45:41 +00:00
SemaInit.cpp [ObjC++] Don't warn about pessimizing move for __block variables 2017-11-07 21:40:11 +00:00
SemaLambda.cpp Give external linkage and mangling to lambdas inside inline variables and variable templates. 2017-09-22 04:25:05 +00:00
SemaLookup.cpp [modules] Retain multiple using-directives in the same scope even if they name the same namespace. 2017-10-30 22:38:20 +00:00
SemaObjCProperty.cpp [Sema] Add support for flexible array members in Obj-C. 2017-10-23 22:01:41 +00:00
SemaOpenMP.cpp [OPENMP] Codegen for `#pragma omp target parallel for simd`. 2017-11-09 17:32:15 +00:00
SemaOverload.cpp [c++17] Refine resolution of constructor / conversion function disambiguation. 2017-11-01 01:37:11 +00:00
SemaPseudoObject.cpp Replace a use of std::for_each() with llvm::for_each(); NFC. 2017-11-03 20:09:17 +00:00
SemaStmt.cpp Catch more cases with -Wenum-compare 2017-09-09 00:25:05 +00:00
SemaStmtAsm.cpp [X86][MS-InlineAsm] Extended support for variables / identifiers on memory / immediate expressions 2017-09-29 07:02:49 +00:00
SemaStmtAttr.cpp Rename cxx1z -> cxx17 across all diagnostic IDs. 2017-08-13 23:37:29 +00:00
SemaTemplate.cpp Fix template parameter default args missed if redecled 2017-10-24 01:39:56 +00:00
SemaTemplateDeduction.cpp Convert clang::LangAS to a strongly typed enum 2017-10-15 18:48:14 +00:00
SemaTemplateInstantiate.cpp [Sema] Prevent InstantiateClass from checking unrelated exception specs. 2017-09-21 19:54:12 +00:00
SemaTemplateInstantiateDecl.cpp Never try to instantiate a deduction guide's "definition". Fixes bogus warning when there inevitably isn't one. 2017-10-28 01:15:00 +00:00
SemaTemplateVariadic.cpp Recommit "Add _Float16 as a C/C++ source language type" 2017-09-08 15:15:00 +00:00
SemaType.cpp [Sema][ObjC] Look for either objc_bridge or objc_bridge_mutable when 2017-10-24 23:38:14 +00:00
TreeTransform.h Remove unused variables. No functionality change. 2017-10-08 21:23:02 +00:00
TypeLocBuilder.cpp [Sema] Fix bug in TypeLocBuilder::pushImpl 2016-02-18 21:05:09 +00:00
TypeLocBuilder.h Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00