[PATCH] D14286: ASTImporter: expressions, pt.1

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 16 08:56:15 PDT 2016


sepavloff added a comment.

The last changes didn't help.

AST generated in `ImportGNUNullExpr` is:

  TranslationUnitDecl 0xc46238 <<invalid sloc>> <invalid sloc>
  …
  |   `-BuiltinType 0xc46290 'char'
  `-FunctionDecl 0xc468a0 <input.cc:1:1, col:31> col:6 declToImport 'void (void)'
    `-CompoundStmt 0xc46948 <col:21, col:31>
      `-GNUNullExpr 0xc46938 <col:23> 'int'

Note, type of GNUNullExpr is `int` but you check for `long`.
Similarly, source code in the check `ImportParenListExpr` produces AST:

  TranslationUnitDecl 0xc47340 <<invalid sloc>> <invalid sloc>
  …
  | `-ClassTemplateSpecializationDecl 0xc47d00 <col:1, col:66> col:28 class dummy
  |   `-TemplateArgument type 'int'
  `-TypedefDecl 0xc47e38 <col:68, col:87> col:87 declToImport 'dummy<int>':'class dummy<int>'
    `-TemplateSpecializationType 0xc47db0 'dummy<int>' sugar dummy
      |-TemplateArgument type 'int'
      `-RecordType 0xc47da0 'class dummy<int>'
        `-ClassTemplateSpecialization 0xc47d00 'dummy'

There is no `ParenListExpr`, - templates are handled in msvc compatibility mode a bit differently.
Probably the tests could be fixed by hard coding target to Linux64.


http://reviews.llvm.org/D14286





More information about the cfe-commits mailing list