-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Clang][Sema] Do not mark template parameters in the exception specification as used during partial ordering #91534
Merged
+103
−8
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.partial/p3.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify %s | ||
// expected-no-diagnostics | ||
|
||
template<bool B> | ||
struct A { }; | ||
|
||
constexpr A<false> a; | ||
constexpr A<false> b; | ||
|
||
constexpr int* x = nullptr; | ||
constexpr short* y = nullptr; | ||
|
||
namespace ExplicitArgs { | ||
template<typename T, typename U> | ||
constexpr int f(U) noexcept(noexcept(T())) { | ||
return 0; | ||
} | ||
|
||
template<typename T> | ||
constexpr int f(T*) noexcept { | ||
return 1; | ||
} | ||
|
||
template<> | ||
constexpr int f<int>(int*) noexcept { | ||
return 2; | ||
} | ||
|
||
static_assert(f<int>(1) == 0); | ||
static_assert(f<short>(y) == 1); | ||
static_assert(f<int>(x) == 2); | ||
|
||
template<typename T, typename U> | ||
constexpr int g(U*) noexcept(noexcept(T())) { | ||
return 3; | ||
} | ||
|
||
template<typename T> | ||
constexpr int g(T) noexcept { | ||
return 4; | ||
} | ||
|
||
template<> | ||
constexpr int g<int>(int*) noexcept { | ||
return 5; | ||
} | ||
|
||
static_assert(g<int>(y) == 3); | ||
static_assert(g<short>(1) == 4); | ||
static_assert(g<int>(x) == 5); | ||
} // namespace ExplicitArgs | ||
|
||
namespace DeducedArgs { | ||
template<typename T, bool B> | ||
constexpr int f(T, A<B>) noexcept(B) { | ||
return 0; | ||
} | ||
|
||
template<typename T, bool B> | ||
constexpr int f(T*, A<B>) noexcept(B && B) { | ||
return 1; | ||
} | ||
|
||
template<> | ||
constexpr int f(int*, A<false>) { | ||
return 2; | ||
} | ||
|
||
static_assert(f<int*>(x, a) == 0); | ||
static_assert(f<short>(y, a) == 1); | ||
static_assert(f<int>(x, a) == 2); | ||
} // namespace DeducedArgs |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file a core issue here! It would be great to get this fixed in CWG. @Endilll or @shafik can help with that if you need it. Also, put the CWG issue # in this comment once we have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open it tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erichkeane Filed an issue here. It might be a little while before an actual core issue is opened, so would it be alright to merge this before that happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jens is usually really quick at assigning a core issue, right? That said, you can merge this before getting one as long as you come back afterwards and fill it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen it take anywhere from a day to a month. I'll be sure to update this once the issue is opened!