[all-commits] [llvm/llvm-project] a9d68a: Generalize calls to ImplicitlyDefineFunction
Aaron Ballman via All-commits
all-commits at lists.llvm.org
Sat Apr 30 07:04:09 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a9d68a5524dea113cace5983697786599cbdce9a
https://github.com/llvm/llvm-project/commit/a9d68a5524dea113cace5983697786599cbdce9a
Author: Aaron Ballman <aaron at aaronballman.com>
Date: 2022-04-30 (Sat, 30 Apr 2022)
Changed paths:
M clang-tools-extra/clangd/IncludeFixer.cpp
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/include/clang/Basic/LangOptions.h
M clang/lib/Sema/SemaDecl.cpp
M clang/lib/Sema/SemaExpr.cpp
M clang/test/Driver/default-includes.cl
M clang/test/Preprocessor/macro_variadic.cl
M clang/test/SemaOpenCL/arm-integer-dot-product.cl
M clang/test/SemaOpenCL/clang-builtin-version.cl
M clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
M clang/test/SemaOpenCL/invalid-block.cl
M clang/test/SemaOpenCL/to_addr_builtin.cl
Log Message:
-----------
Generalize calls to ImplicitlyDefineFunction
In C++ and C2x, we would avoid calling ImplicitlyDefineFunction at all,
but in OpenCL mode we would still call the function and have it produce
an error diagnostic. Instead, we now have a helper function to
determine when implicit function definitions are allowed and we use
that to determine whether to call ImplicitlyDefineFunction so that the
behavior is more consistent across language modes.
This changes the diagnostic behavior from telling the users that an
implicit function declaration is not allowed in OpenCL to reporting use
of an unknown identifier and going through typo correction, as done in
C++ and C2x.
More information about the All-commits
mailing list