File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
test/Interop/Cxx/templates/Inputs Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,12 @@ class ClangDeclFinder
104
104
// Do not traverse unevaluated expressions. Doing to might result in compile
105
105
// errors if we try to instantiate an un-instantiatable template.
106
106
107
- bool VisitCXXNoexceptExpr (clang::CXXNoexceptExpr *NEE) { return false ; }
107
+ bool TraverseCXXNoexceptExpr (clang::CXXNoexceptExpr *NEE) { return true ; }
108
108
109
- bool VisitCXXTypeidExpr (clang::CXXTypeidExpr *TIE) {
110
- return TIE->isPotentiallyEvaluated ();
109
+ bool TraverseCXXTypeidExpr (clang::CXXTypeidExpr *TIE) {
110
+ if (TIE->isPotentiallyEvaluated ())
111
+ clang::RecursiveASTVisitor<ClangDeclFinder>::TraverseCXXTypeidExpr (TIE);
112
+ return true ;
111
113
}
112
114
113
115
bool shouldVisitTemplateInstantiations () const { return true ; }
Original file line number Diff line number Diff line change @@ -16,12 +16,17 @@ auto declval() noexcept -> decltype(__declval<_Tp>(0)) {
16
16
return __declval<_Tp>(0 );
17
17
}
18
18
19
+ inline void stillCalled () {
20
+ static int x = 0 ;
21
+ }
22
+
19
23
template <class T >
20
24
class Vec {
21
25
public:
22
26
void push_back (const T &__x) {
23
27
if (!noexcept (declval<T *>()))
24
28
;
29
+ stillCalled ();
25
30
}
26
31
};
27
32
You can’t perform that action at this time.
0 commit comments