-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
https://godbolt.org/z/9bb351bad
using RQ = int() &;
using CQ = int() const;
template<class T>
constexpr bool tc() { return __is_trivially_copyable(T); }
static_assert(!tc<RQ>()); // OK
static_assert(!tc<CQ>()); // OK
static_assert(!__is_trivially_copyable(RQ)); // Clang error
static_assert(!__is_trivially_copyable(CQ)); // Clang error
static_assert(!__is_trivially_copyable(int() &)); // EDG+Clang error
static_assert(!__is_trivially_copyable(int() const)); // EDG+Clang error
This parser limitation was clearly known when the tests for __has_unique_object_representations
were added in https://reviews.llvm.org/D39064 , but it never explicitly came up during the code review. However, if we fixed the parser limitation, then we could simplify those tests to check the trait directly instead of going through @erichkeane's helper template in PR #77584.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"