File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,14 @@ namespace clang::tidy::utils {
1414
1515ExceptionSpecAnalyzer::State
1616ExceptionSpecAnalyzer::analyze (const FunctionDecl *FuncDecl) {
17- // Check if the function has already been analyzed and reuse that result.
18- const auto CacheEntry = FunctionCache.find (FuncDecl);
19- if (CacheEntry == FunctionCache.end ()) {
17+ // Check if function exist in cache or add temporary value to cache to protect
18+ // against endless recursion.
19+ const auto [CacheEntry, NotFound] =
20+ FunctionCache.try_emplace (FuncDecl, State::NotThrowing);
21+ if (NotFound) {
2022 ExceptionSpecAnalyzer::State State = analyzeImpl (FuncDecl);
21-
22- // Cache the result of the analysis.
23- FunctionCache.try_emplace (FuncDecl, State);
23+ // Update result with calculated value
24+ FunctionCache[FuncDecl] = State;
2425 return State;
2526 }
2627
Original file line number Diff line number Diff line change 1+ // RUN: %check_clang_tidy -std=c++17 -expect-clang-tidy-error %s performance-noexcept-move-constructor %t
2+
3+ template <typename value_type> class set {
4+ set (set &&) = default ;
5+ set (initializer_list<value_type> __l) {};
6+ // CHECK-MESSAGES: :[[@LINE-1]]:7: error: member 'initializer_list' cannot have template arguments [clang-diagnostic-error]
7+ // CHECK-MESSAGES: :[[@LINE-2]]:36: error: expected ')' [clang-diagnostic-error]
8+ };
You can’t perform that action at this time.
0 commit comments