https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117331

--- Comment #1 from IOhannes m zmölnig <dev at umlaeute dot mur.at> ---
ouch, i've actually posted my initial test-case that uses templates.

The original code looked like
```C++
template <typename T>
T test(void) {
   constexpr auto one = T (1);
   constexpr auto oneThird = one / (T) 3;
   return oneThird;
}

int main() {
 test<long double>();
        return 0;
}
```


Using this instead
```C++
void test() {
   constexpr auto oneThird = ((long double) 1)/ ((long double) 3);
}
```
has of course a slightly different error message, namely:
```
$ g++ -save-temps  -o test.o test.cpp 
test.cpp: In function 'void test()':
test.cpp:2:47: error: '(1.0e+0l / 3.0e+0l)' is not a constant expression
    2 |    constexpr auto oneThird = ((long double) 1)/ ((long double) 3);
      |    
```


(it seems like I can no longer edit my original bug-report; sorry for the
confusion)

Reply via email to