jansvoboda11 created this revision. jansvoboda11 added reviewers: dexonsmith, Bigcheese. Herald added a subscriber: arphaman. jansvoboda11 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
`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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D95879 Files: clang/test/Index/parse-all-comments.c Index: clang/test/Index/parse-all-comments.c =================================================================== --- clang/test/Index/parse-all-comments.c +++ clang/test/Index/parse-all-comments.c @@ -75,7 +75,7 @@ // RUN: c-index-test -write-pch %t/out.pch -fparse-all-comments -x c++ -std=c++11 %s -// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fparse-all-comments > %t/out.c-index-direct +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -x c++ -std=c++11 %s -fparse-all-comments > %t/out.c-index-direct // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
Index: clang/test/Index/parse-all-comments.c =================================================================== --- clang/test/Index/parse-all-comments.c +++ clang/test/Index/parse-all-comments.c @@ -75,7 +75,7 @@ // RUN: c-index-test -write-pch %t/out.pch -fparse-all-comments -x c++ -std=c++11 %s -// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s -std=c++11 -fparse-all-comments > %t/out.c-index-direct +// RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -x c++ -std=c++11 %s -fparse-all-comments > %t/out.c-index-direct // RUN: c-index-test -test-load-tu %t/out.pch all > %t/out.c-index-pch // RUN: FileCheck %s -check-prefix=WRONG < %t/out.c-index-direct
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits