Skip to content

Commit 000ad1a

Browse files
committed
[clang] fix a compilation bug
With gcc 6.3.0, I hit the following compilation bug: /home/yhs/work/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp: In function ‘bool ParseCodeGenArgs(clang::CodeGenOptions&, llvm::opt::ArgList&, clang::InputKind, clang::DiagnosticsEngine&, const clang::TargetOptions&, const clang::FrontendOptions&)’: /home/yhs/work/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp:780:12: error: unused variable ‘A’ [-Werror=unused-variable] if (Arg *A = Args.getLastArg(OPT_fuse_ctor_homing)) ^ cc1plus: all warnings being treated as errors The bug is introduced by Commit ae6523c ("[DebugInfo] Add -fuse-ctor-homing cc1 flag so we can turn on constructor homing only if limited debug info is already on.")
1 parent fcd2969 commit 000ad1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
777777
}
778778
// If -fuse-ctor-homing is set and limited debug info is already on, then use
779779
// constructor homing.
780-
if (Arg *A = Args.getLastArg(OPT_fuse_ctor_homing))
780+
if (Args.getLastArg(OPT_fuse_ctor_homing))
781781
if (Opts.getDebugInfo() == codegenoptions::LimitedDebugInfo)
782782
Opts.setDebugInfo(codegenoptions::DebugInfoConstructor);
783783

0 commit comments

Comments
 (0)