-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Consider:
namespace std {
using size_t = decltype(sizeof(0));
}
void *operator new(std::size_t, void *p) { return p; }
void* operator new[] (std::size_t, void* p) {return p;}
constexpr int foo() {
const int a = 10;
new ((int*)&a) int(12);
return a;
}
static_assert(foo() == 12);https://godbolt.org/z/7jj8YsE8r
This should not be accepted of course.
This might be a good first issue, I'm not sure. Maybe @cor3ntin can comment on that.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Type
Projects
Status
Done