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
104104 // Do not traverse unevaluated expressions. Doing to might result in compile
105105 // errors if we try to instantiate an un-instantiatable template.
106106
107- bool VisitCXXNoexceptExpr (clang::CXXNoexceptExpr *NEE) { return false ; }
107+ bool TraverseCXXNoexceptExpr (clang::CXXNoexceptExpr *NEE) { return true ; }
108108
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 ;
111113 }
112114
113115 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)) {
1616 return __declval<_Tp>(0 );
1717}
1818
19+ inline void stillCalled () {
20+ static int x = 0 ;
21+ }
22+
1923template <class T >
2024class Vec {
2125public:
2226 void push_back (const T &__x) {
2327 if (!noexcept (declval<T *>()))
2428 ;
29+ stillCalled ();
2530 }
2631};
2732
You can’t perform that action at this time.
0 commit comments