Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,10 @@ Improvements to Clang's diagnostics

- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
The warning message for non-overlapping cases has also been improved (#GH13473).


- Fixed a duplicate diagnostic when performing typo correction on function template
calls with explicit template arguments. Fixes #GH139226.

Improvements to Clang's time-trace
----------------------------------

Expand Down
3 changes: 3 additions & 0 deletions clang/lib/Sema/SemaTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ bool Sema::LookupTemplateName(LookupResult &Found, Scope *S, CXXScopeSpec &SS,
if (Found.isAmbiguous()) {
Found.clear();
} else if (!Found.empty()) {
// Do not erase the typo-corrected result to avoid duplicating the typo
// correction in future.
AllowFunctionTemplatesInLookup = true;
Found.setLookupName(Corrected.getCorrection());
if (LookupCtx) {
std::string CorrectedStr(Corrected.getAsString(getLangOpts()));
Expand Down
13 changes: 13 additions & 0 deletions clang/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,16 @@ namespace PR11856 {
}
}
}

namespace GH139226 {

struct Foo {
template <class T> void LookupWithID(); // expected-note {{declared here}}
};

void test(Foo &f) {
f.LookupWithId<int>();
// expected-error@-1 {{did you mean 'LookupWithID'}}
}

}