<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Infinite recursion during constructor initialization"
href="https://bugs.llvm.org/show_bug.cgi?id=32975">32975</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Infinite recursion during constructor initialization
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aaron@aaronballman.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following code leads to infinite recursion stemming from
Sema::DefaultArgumentPromotion().
struct X { X(...); };
template <typename T>
T&& foo() noexcept;
X test() {
return foo<volatile X>();
}
The recursion happens by:
clang.exe!clang::Sema::DefaultArgumentPromotion(clang::Expr * E)
clang.exe!clang::Sema::DefaultVariadicArgumentPromotion(clang::Expr * E,
clang::Sema::VariadicCallType CT, clang::FunctionDecl * FDecl)
clang.exe!clang::Sema::GatherArgumentsForCall(clang::SourceLocation CallLoc,
clang::FunctionDecl * FDecl, const clang::FunctionProtoType * Proto, unsigned
int FirstParam, llvm::ArrayRef<clang::Expr *> Args,
llvm::SmallVectorImpl<clang::Expr *> & AllArgs, clang::Sema::VariadicCallType
CallType, bool AllowExplicit, bool IsListInitialization)
clang.exe!clang::Sema::CompleteConstructorCall(clang::CXXConstructorDecl *
Constructor, llvm::MutableArrayRef<clang::Expr *> ArgsPtr,
clang::SourceLocation Loc, llvm::SmallVectorImpl<clang::Expr *> &
ConvertedArgs, bool AllowExplicit, bool IsListInitialization)
clang.exe!PerformConstructorInitialization(clang::Sema & S, const
clang::InitializedEntity & Entity, const clang::InitializationKind & Kind,
llvm::MutableArrayRef<clang::Expr *> Args, const
clang::InitializationSequence::Step & Step, bool &
ConstructorInitRequiresZeroInit, bool IsListInitialization, bool
IsStdInitListInitialization, clang::SourceLocation LBraceLoc,
clang::SourceLocation RBraceLoc)
clang.exe!clang::InitializationSequence::Perform(clang::Sema & S, const
clang::InitializedEntity & Entity, const clang::InitializationKind & Kind,
llvm::MutableArrayRef<clang::Expr *> Args, clang::QualType * ResultType)
clang.exe!clang::Sema::PerformCopyInitialization(const clang::InitializedEntity
& Entity, clang::SourceLocation EqualLoc, clang::ActionResult<clang::Expr *,1>
Init, bool TopLevelOfInitList, bool AllowExplicit)
clang.exe!clang::Sema::DefaultArgumentPromotion(clang::Expr * E)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>