mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 16:16:06 +00:00
Skip ParenType on function instantiations.
llvm-svn: 121720
This commit is contained in:
parent
9c00c014ab
commit
a44c902d2f
@ -115,6 +115,8 @@ public:
|
||||
/// \brief Skips past any qualifiers, if this is qualified.
|
||||
UnqualTypeLoc getUnqualifiedLoc() const; // implemented in this header
|
||||
|
||||
TypeLoc IgnoreParens() const;
|
||||
|
||||
/// \brief Initializes this to state that every location in this
|
||||
/// type is the given location.
|
||||
///
|
||||
|
@ -229,3 +229,11 @@ TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
|
||||
|
||||
return TST_unspecified;
|
||||
}
|
||||
|
||||
TypeLoc TypeLoc::IgnoreParens() const {
|
||||
TypeLoc TL = *this;
|
||||
while (ParenTypeLoc* PTL = dyn_cast<ParenTypeLoc>(&TL))
|
||||
TL = PTL->getInnerLoc();
|
||||
return TL;
|
||||
}
|
||||
|
||||
|
@ -1908,10 +1908,10 @@ TemplateDeclInstantiator::SubstFunctionType(FunctionDecl *D,
|
||||
|
||||
if (NewTInfo != OldTInfo) {
|
||||
// Get parameters from the new type info.
|
||||
TypeLoc OldTL = OldTInfo->getTypeLoc();
|
||||
TypeLoc OldTL = OldTInfo->getTypeLoc().IgnoreParens();
|
||||
if (FunctionProtoTypeLoc *OldProtoLoc
|
||||
= dyn_cast<FunctionProtoTypeLoc>(&OldTL)) {
|
||||
TypeLoc NewTL = NewTInfo->getTypeLoc();
|
||||
TypeLoc NewTL = NewTInfo->getTypeLoc().IgnoreParens();
|
||||
FunctionProtoTypeLoc *NewProtoLoc = cast<FunctionProtoTypeLoc>(&NewTL);
|
||||
assert(NewProtoLoc && "Missing prototype?");
|
||||
for (unsigned i = 0, i_end = NewProtoLoc->getNumArgs(); i != i_end; ++i) {
|
||||
@ -1926,7 +1926,7 @@ TemplateDeclInstantiator::SubstFunctionType(FunctionDecl *D,
|
||||
// The function type itself was not dependent and therefore no
|
||||
// substitution occurred. However, we still need to instantiate
|
||||
// the function parameters themselves.
|
||||
TypeLoc OldTL = OldTInfo->getTypeLoc();
|
||||
TypeLoc OldTL = OldTInfo->getTypeLoc().IgnoreParens();
|
||||
if (FunctionProtoTypeLoc *OldProtoLoc
|
||||
= dyn_cast<FunctionProtoTypeLoc>(&OldTL)) {
|
||||
for (unsigned i = 0, i_end = OldProtoLoc->getNumArgs(); i != i_end; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user