-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"waiting-for-wg21Blocked on C++ Standards CommitteeBlocked on C++ Standards Committee
Description
Bugzilla Link | 43287 |
Version | trunk |
OS | All |
CC | @dwblaikie,@DougGregor,@zygoloid |
Extended Description
I believe that clang is handling template type deduction improperly for forward declarations of templates with overload resolution. Consider the following:
#include <type_traits>
template<typename U>
int f(const U t);
int v;
auto test = f(v);
template<typename U>
int f(U t) {
static_assert(!std::is_const<decltype(t)>::value, "t should be non-const");
return 0;
}
GCC correctly identifies this as int
rather than const int
. I believe that the type information is being preserved from the canonical decl from which this overload is being referenced. This was reduced from another test case which results in an invalid function call.
Sorry, I couldn't really come up with a good summary
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"waiting-for-wg21Blocked on C++ Standards CommitteeBlocked on C++ Standards Committee