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

--- Comment #6 from sandra at gcc dot gnu.org ---
Created attachment 60421
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60421&action=edit
test case quuux.C

Another test case from waffl3x which I think is probably a variant of this bug
-- it involves a non-type template parameter but the series of error messages
is the same.

$ x86_64-linux-gnu-g++ -S -fopenmp quuux.C
quuux.C: In function 'void static_assert_in_variant_nttp()':
quuux.C:6:30: error: no matching function for call to
'static_assert_in_variant_nttp_variant()' [-Wtemplate-body]
    6 | #pragma omp declare variant (static_assert_in_variant_nttp_variant)
match (implementation={vendor("gnu")})
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
quuux.C:6:30: note: there is 1 candidate
quuux.C:2:6: note: candidate 1: 'template<bool B> void
static_assert_in_variant_nttp_variant()'
    2 | void static_assert_in_variant_nttp_variant() {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
quuux.C:2:6: note: template argument deduction/substitution failed:
quuux.C:6:30: note:   couldn't deduce template parameter 'B'
    6 | #pragma omp declare variant (static_assert_in_variant_nttp_variant)
match (implementation={vendor("gnu")})
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
quuux.C: In substitution of 'template<bool B> void static_assert_in_variant_ntt
() [with bool B = true]':
quuux.C:13:38:   required from here
   13 |   static_assert_in_variant_nttp<true>();
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
quuux.C:6:30: error: no matching function for call to
'static_assert_in_variant_nttp_variant()'
    6 | #pragma omp declare variant (static_assert_in_variant_nttp_variant)
match (implementation={vendor("gnu")})
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
quuux.C:6:30: note: there is 1 candidate
quuux.C:2:6: note: candidate 1: 'template<bool B> void
static_assert_in_variant_nttp_variant()'
    2 | void static_assert_in_variant_nttp_variant() {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
quuux.C:2:6: note: template argument deduction/substitution failed:
quuux.C:6:30: note:   couldn't deduce template parameter 'B'
    6 | #pragma omp declare variant (static_assert_in_variant_nttp_variant)
match (implementation={vendor("gnu")})
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to