[all-commits] [llvm/llvm-project] bc6d0f: [Sema] Add MacroQualified case for FunctionTypeUnw...

tstellar via All-commits all-commits at lists.llvm.org
Tue Nov 12 19:19:14 PST 2019


  Branch: refs/heads/release/9.x
  Home:   https://github.com/llvm/llvm-project
  Commit: bc6d0f15c227530538fab484dc586975b11ff0ec
      https://github.com/llvm/llvm-project/commit/bc6d0f15c227530538fab484dc586975b11ff0ec
  Author: Leonard Chan <leonardchan at google.com>
  Date:   2019-11-12 (Tue, 12 Nov 2019)

  Changed paths:
    M clang/lib/Sema/SemaType.cpp
    M clang/test/Frontend/macro_defined_type.cpp

  Log Message:
  -----------
  [Sema] Add MacroQualified case for FunctionTypeUnwrapper

This is a fix for PR43315. An assertion error is hit for this minimal example:

```
//clang -cc1 -triple x86_64-- -S tstVMStructRC-min.cpp
int (a b)();  // Assertion `Chunk.Kind == DeclaratorChunk::Function' failed.
```

This is because we do not cover the case in the FunctionTypeUnwrapper where it
receives a MacroQualifiedType. We have not run into this earlier because this
is a unique case where the __attribute__ contains both __cdecl__ and
__regparm__ (in that order), and we are compiling for x86_64. Changing the
architecture or the order of __cdecl__ and __regparm__ does not raise the
assertion.

Differential Revision: https://reviews.llvm.org/D67992

(cherry picked from commit e278c138a937a68f3e6c89df8eaeffa913f9b0f7)




More information about the All-commits mailing list