Commit 5114b5eb authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r292194:

------------------------------------------------------------------------
r292194 | majnemer | 2017-01-16 20:14:25 -0800 (Mon, 16 Jan 2017) | 8 lines

[AST] AttributedType should derive type properties from the EquivalentType

Using the canonical type instead of the equivalent type can result in
insufficient template instantiations.

This fixes PR31656.

Differential Revision: https://reviews.llvm.org/D28788
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293702 91177308-0d34-0410-b5e6-96231b3b80d8
parent 1b8468f0
......@@ -3827,13 +3827,13 @@ private:
friend class ASTContext; // creates these
AttributedType(QualType canon, Kind attrKind,
QualType modified, QualType equivalent)
: Type(Attributed, canon, canon->isDependentType(),
canon->isInstantiationDependentType(),
canon->isVariablyModifiedType(),
canon->containsUnexpandedParameterPack()),
ModifiedType(modified), EquivalentType(equivalent) {
AttributedType(QualType canon, Kind attrKind, QualType modified,
QualType equivalent)
: Type(Attributed, canon, equivalent->isDependentType(),
equivalent->isInstantiationDependentType(),
equivalent->isVariablyModifiedType(),
equivalent->containsUnexpandedParameterPack()),
ModifiedType(modified), EquivalentType(equivalent) {
AttributedTypeBits.AttrKind = attrKind;
}
......
......@@ -45,3 +45,12 @@ void __cdecl static_baz() {}
void static_qux() {}
// GCABI-LABEL: define void @_Z10static_quxv
// MSABI: define void @"\01?static_qux@@YAXXZ"
namespace PR31656 {
template <int I>
void __cdecl callee(int args[I]);
// GCABI-LABEL: declare void @_ZN7PR316566calleeILi1EEEvPi(
// MSABI: declare void @"\01??$callee@$00@PR31656@@YAXQAH@Z"(
void caller() { callee<1>(0); }
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment