Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage example for "CommonOptionsParser.h" #305

Closed
wants to merge 1 commit into from

Conversation

GavinRay97
Copy link

The current usage example suggests using CommonOptionsParser::CommonOptionsParser(), which is protected and throws:

Error (active)    E0330
"clang::tooling::CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv, llvm::cl::OptionCategory &Category, llvm::cl::NumOccurrencesFlag OccurrencesFlag = llvm::cl::OneOrMore, const char *Overview = (const char *)nullptr)"
(declared at line 76 of "llvm-project\llvm-13.0.0-msbuild-vs2019-x64-rel\include\clang\Tooling\CommonOptionsParser.h")
is inaccessible

The only way it compiles for me is as:

Expected<CommonOptionsParser> OptionsParser = CommonOptionsParser::create(argc, argv, MyToolCategory);

Feel free to close this if this is incorrect! =)

The current usage example suggests using `CommonOptionsParser::CommonOptionsParser()`, which is `protected` and throws:
```ps1
Error (active)    E0330    "clang::tooling::CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv, llvm::cl::OptionCategory &Category, llvm::cl::NumOccurrencesFlag OccurrencesFlag = llvm::cl::OneOrMore, const char *Overview = (const char *)nullptr)" (declared at line 76 of "llvm-project\llvm-13.0.0-msbuild-vs2019-x64-rel\include\clang\Tooling\CommonOptionsParser.h") is inaccessible
```

The only way it compiles for me is as:
```cpp
Expected<CommonOptionsParser> OptionsParser = CommonOptionsParser::create(argc, argv, MyToolCategory);
```

Feel free to close this if this is incorrect! =)
@repo-lockdown
Copy link

repo-lockdown bot commented Apr 17, 2021

This repository does not accept pull requests. Please follow http://llvm.org/docs/Contributing.html#how-to-submit-a-patch for contribution to LLVM.

@repo-lockdown repo-lockdown bot closed this Apr 17, 2021
@repo-lockdown repo-lockdown bot locked and limited conversation to collaborators Apr 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant