Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Revisit import of VarDecl in case of arrays #485

Open
martong opened this issue Aug 30, 2018 · 0 comments
Open

Revisit import of VarDecl in case of arrays #485

martong opened this issue Aug 30, 2018 · 0 comments

Comments

@martong
Copy link

martong commented Aug 30, 2018

This code may not be needed below, we should write a unit test which exercises it.

          const ArrayType *FoundArray
            = Importer.getToContext().getAsArrayType(FoundVar->getType());
          const ArrayType *TArray
            = Importer.getToContext().getAsArrayType(D->getType());
          if (FoundArray && TArray) {
            if (isa<IncompleteArrayType>(FoundArray) &&
                isa<ConstantArrayType>(TArray)) {
              // Import the type.
              QualType T = Importer.Import(D->getType());
              if (T.isNull())
                return nullptr;

              FoundVar->setType(T);
              FoundByLookup = FoundVar;
              break;
            } else if (isa<IncompleteArrayType>(TArray) &&
                       isa<ConstantArrayType>(FoundArray)) {
              FoundByLookup = FoundVar;
              break;
            }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant