I have 4 test cases and I believe that all of them are valid:
constexpr int f(int const& /*unused*/){
return 1;
}
void g(int const& p){
constexpr int a = f(p); // clang error, gcc valid
int v = 0;
constexpr int b = f(v); // clang valid, gcc valid
int const& r = v;
constexpr int c = f(r); // clang error, gcc error
int n = p;
constexpr int d = f(n); // clang valid, gcc valid
}
int main(){
int p = 0;
g(p);
}
Clang and GCC differ only in the first test case.
I tested with clang 4 & 5 (20170319) and with GCC 7.0.1 (20170221).
If I'm right it would massively simplify the usage of boost::hana in static_assert's.