Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ Improvements to Clang's diagnostics

- Clang now looks through parenthesis for ``-Wundefined-reinterpret-cast`` diagnostic.

- Fixed a bug where the source location was missing when diagnosing ill-formed
placeholder constraints.

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

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaTemplateDeduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5180,7 +5180,7 @@ static bool CheckDeducedPlaceholderConstraints(Sema &S, const AutoType &Type,
TemplateArgs.addArgument(TypeLoc.getArgLoc(I));

Sema::CheckTemplateArgumentInfo CTAI;
if (S.CheckTemplateArgumentList(Concept, SourceLocation(), TemplateArgs,
if (S.CheckTemplateArgumentList(Concept, TypeLoc.getNameLoc(), TemplateArgs,
/*DefaultArgs=*/{},
/*PartialTemplateArgs=*/false, CTAI))
return true;
Expand Down
21 changes: 21 additions & 0 deletions clang/test/SemaTemplate/concepts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,27 @@ int i = SVGPropertyOwnerRegistry<SVGCircleElement>::fastAnimatedPropertyLookup()

}

namespace GH61824 {

template<typename T, typename U = typename T::type> // #T_Type
concept C = true;

constexpr bool f(C auto) { // #GH61824_f
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the comment at the end of line mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are line markers.

return true;
}

C auto x = 0;
// expected-error@#T_Type {{type 'int' cannot be used prior to '::'}} \
// expected-note@-1 {{in instantiation of default argument}}

// This will be fixed when we merge https://github.com/llvm/llvm-project/pull/141776
// Which makes us behave like GCC.
static_assert(f(0));
// expected-error@-1 {{no matching function for call}} \
// expected-note@#GH61824_f {{constraints not satisfied}} \
// expected-note@#T_Type {{type 'int' cannot be used prior to '::'}}

}

namespace GH149986 {
template <typename T> concept PerfectSquare = [](){} // expected-note 2{{here}}
Expand Down
Loading