mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-31 06:04:58 +00:00
Fix assertion failure in TransformOpaqueValueExpr
Summary: `OpaqueValueExpr`s may not have a source expression (as in the case when they are created due to a default argument error). This can cause an assertion failure in `TransformOpaqueValueExpr` during template instantiation. This patch fixes the assertion failure. Reviewers: hfinkel, rsmith Subscribers: fraggamuffin, cfe-commits Differential Revision: http://reviews.llvm.org/D11582 Patch by Rachel Craik! llvm-svn: 246600
This commit is contained in:
parent
9772c6342e
commit
2cded44d82
@ -7806,7 +7806,7 @@ TreeTransform<Derived>::TransformOffsetOfExpr(OffsetOfExpr *E) {
|
||||
template<typename Derived>
|
||||
ExprResult
|
||||
TreeTransform<Derived>::TransformOpaqueValueExpr(OpaqueValueExpr *E) {
|
||||
assert(getDerived().AlreadyTransformed(E->getType()) &&
|
||||
assert((!E->getSourceExpr() || getDerived().AlreadyTransformed(E->getType())) &&
|
||||
"opaque value expression requires transformation");
|
||||
return E;
|
||||
}
|
||||
|
@ -166,3 +166,9 @@ namespace NondefDecls {
|
||||
}
|
||||
template void f1<int>(); // expected-note{{in instantiation of function template specialization 'NondefDecls::f1<int>' requested here}}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct C {
|
||||
C(T t = ); // expected-error {{expected expression}}
|
||||
};
|
||||
C<int> obj;
|
||||
|
Loading…
x
Reference in New Issue
Block a user