llvm-project/clang
Matheus Izvekov d98c34f4d7 [clang] fix error recovery ICE on copy elision when returing invalid variable
See PR51708.

Attempting copy elision in dependent contexts with invalid variable,
such as a variable with incomplete type, would cause a crash when attempting
to calculate it's alignment.

The fix is to just skip this optimization on invalid VarDecl, as otherwise this
provides no benefit to error recovery: This functionality does not try to
diagnose anything, it only calculates a flag which will affect where the
variable will be allocated during codegen.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: rtrieu

Differential Revision: https://reviews.llvm.org/D109191
2021-09-03 20:34:08 +02:00
..
INPUTS
bindings
cmake [CMake] Change -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to -DLLVM_ENABLE_NEW_PASS_MANAGER=off 2021-08-26 14:25:31 -07:00
docs Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case."" 2021-09-03 13:18:09 +00:00
examples Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case."" 2021-09-03 13:18:09 +00:00
include [modules] Use `HashBuilder` and `MD5` for the module hash. 2021-09-03 11:13:36 -07:00
lib [clang] fix error recovery ICE on copy elision when returing invalid variable 2021-09-03 20:34:08 +02:00
runtime Prepare Compiler-RT for GnuInstallDirs, matching libcxx, document all 2021-07-13 15:21:41 +00:00
test [clang] fix error recovery ICE on copy elision when returing invalid variable 2021-09-03 20:34:08 +02:00
tools [clang] NFC: Extract DiagnosticOptions parsing 2021-09-02 14:37:14 +02:00
unittests [modules] Use `HashBuilder` and `MD5` for the module hash. 2021-09-03 11:13:36 -07:00
utils [AST] Avoid single-trip loop in ClangAttrEmitter 2021-08-20 08:49:57 +02:00
www Implement P1949 2021-08-18 07:33:14 -04:00
.clang-format
.clang-tidy .clang-tidy: Disable misc-no-recursion in general/across the monorepo 2021-06-08 08:31:33 -07:00
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
INSTALL.txt
LICENSE.TXT
ModuleInfo.txt
NOTES.txt
README.txt

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:             http://clang.llvm.org/
Building and using Clang:         http://clang.llvm.org/get_started.html
Clang Static Analyzer:            http://clang-analyzer.llvm.org/
Information on the LLVM project:  http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/