[all-commits] [llvm/llvm-project] c1b482: [clang][index] Mark file as C++ in parse-all-comme...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Feb 8 00:43:09 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1b482e726a943862ec5277a44c1994acfb7f97f
      https://github.com/llvm/llvm-project/commit/c1b482e726a943862ec5277a44c1994acfb7f97f
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M clang/test/Index/parse-all-comments.c

  Log Message:
  -----------
  [clang][index] Mark file as C++ in parse-all-comments test

`CompilerInvocation::CreateFromArgs` doesn't always report command line parsing failures through the return value. Sometimes, errors are only reported via diagnostics.

Some clients like `c-index-test` only check the return value and don't check the state of `DiagnosticsEngine`.

If we were to start returning the correct return value from `CreateFromArgs`, this index test starts to fail, because it specifies `-std=c++11` for a C input, which is invalid.

This patch fixes that issue by adding forgotten `-x c++` argument.

Reviewed By: dexonsmith

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




More information about the All-commits mailing list