seanm wrote:

I've tried another project: [opencv](https://github.com/opencv/opencv) and the 
result also fails to compile.

One case I think is because two variables are declared together. i.e.:

```
int foo, bar;
```

instead of:

```
int foo;
int bar;
```

Concretely:

```c++
    const char * const borderMap[] = { "BORDER_CONSTANT", "BORDER_REPLICATE", 
"BORDER_REFLECT", "BORDER_WRAP", "BORDER_REFLECT_101" },
        * const btype = borderMap[borderType & ~BORDER_ISOLATED];
```

Got changed to:

```
    constexpr const char * borderMap[] = { "BORDER_CONSTANT", 
"BORDER_REPLICATE", "BORDER_REFLECT", "BORDER_WRAP", "BORDER_REFLECT_101" },
        * const btype = borderMap[borderType & ~BORDER_ISOLATED];
```

which is fine for `borderMap` but not for `btype`.

Resulting in:

```
/Users/sean/external/opencv/modules/imgproc/src/filter.dispatch.cpp:757:17: 
error: constexpr variable 'btype' must be initialized by a constant expression
  757 |         * const btype = borderMap[borderType & ~BORDER_ISOLATED];
      |                 ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```




https://github.com/llvm/llvm-project/pull/146553
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to