https://bugs.llvm.org/show_bug.cgi?id=50862

            Bug ID: 50862
           Summary: CommonOptionsParser doesn't reset completely
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Tooling
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

If we create CommonOptionsParser multiple times in the program by providing
argc, argv, etc., the internal state of the CommonOptionsParser won't be reset
properly and positional arguments will be left.

Having multiple CommonOptionsParsers in the same program is not a good idea
because of internal static objects. However, in our use case we need to
initialize CommonOptionsParser with generated argc and argv, do some processing
and then repeat the same process by providing another set of argc and argv.

The issue is with the static cl::opt<T>'s in CommonOptionsParser::init, which
are never reset.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to