[llvm-bugs] [Bug 41555] Problem of parse typedef with template partial specialization.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 24 04:20:55 PDT 2019


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

Solovei Ivan <burnss887 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #5 from Solovei Ivan <burnss887 at gmail.com> ---
Hi!

I tried parse only this constructions without some #include constructions.

And parse typedef is correct.

I found the problem to be different.

Preprocessor try find #include "file.h" - and could not find ,so generate
"fatal error: No such file" and preprocessor has been terminated. Therefore,
next preprocessing templates and other has been stop. And therefore, I received
invalid declaration.

I found fixing:
-Need will doing that preprocessor not terminate via "fatal error: No such
file".

I changed the code (I added the construction to the custom
ParseDeclarationAction class, which is inherited from ASTFrontendAction):

CI.getPreprocessor().SetSuppressIncludeNotFoundError(true);

In result I have class:

class ParseDeclarationAction : public ASTFrontendAction
{
public:
  virtual unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) {
    CI.getPreprocessor().SetSuppressIncludeNotFoundError(true);
    return unique_ptr<ASTConsumer>(new
ParseDeclarationConsumer(&CI.getASTContext()));
  }
};

I think may problem will be help other clang users.

This task is resolved.

Thank you for your support.

Best Regards,
Ivan.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190424/a1b7380c/attachment.html>


More information about the llvm-bugs mailing list