
This commit teaches ASTDeclReader::attachPreviousDecl to successfully merge two Decl's when one contains an inheritable attribute like the MSInheritanceAttr. Usually, attributes that are needed to be present along the redeclaration chain are attached during ASTReading from ASTDeclReader::attachPreviousDecl, but no such thing is done for inheritable attributes. Currently, only the logic for merging MSInheritanceAttr is provided.
21 lines
672 B
C++
21 lines
672 B
C++
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -fmodules -triple x86_64-pc-windows-msvc-unknown -I%S\Inputs\inherit-attribute -fmodules-cache-path=%t \
|
|
// RUN: -fimplicit-module-maps -fmodules-local-submodule-visibility %s -ast-dump-all \
|
|
// RUN: | FileCheck %s
|
|
|
|
#include "b.h"
|
|
#include "c.h"
|
|
|
|
class Foo;
|
|
|
|
Foo f;
|
|
|
|
// CHECK: CXXRecordDecl {{.*}} imported in b {{.*}} Foo
|
|
// CHECK: MSInheritanceAttr {{[^()]*$}}
|
|
|
|
// CHECK: CXXRecordDecl {{.*}} prev {{.*}} imported in c {{.*}} Foo
|
|
// CHECK: MSInheritanceAttr {{.*}} Inherited {{[^()]*$}}
|
|
|
|
// CHECK: CXXRecordDecl {{.*}} <line:9:1, col:7> col:7 referenced class Foo
|
|
// CHECK: MSInheritanceAttr {{.*}} Inherited {{[^()]*$}}
|