Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Parsing Error templated constexpr member variable

$
0
0

Description:

When intializing a static constexpr class member variable using a brace-enclosed expression, compilation fails with error "expected a ")"".

Affected Versions:

icpc (ICC) 19.1.0.166 20191121

Minimal example:

class Test
{
template< typename Foo >
static constexpr bool UseSMPAssign_v =  (true) ;
};

int main(int argc, char** argv)
{
    return 0;
}

 

Expected Result:

Minimal example compiles without errors

Actual Result:

Compilation Fails with

testmain2.cpp(4): error: expected a ")"
  static constexpr bool UseSMPAssign_v =  (true) ;
                                                 ^

compilation aborted for testmain2.cpp (code 2)

Other Compilers:

GCC 8.3 and 9.2 are compiling the example

Note:

Omitting the Braces fixes the issue, but syntactically there should be nothing wrong adding them.

TCE Open Date: 

Friday, March 6, 2020 - 13:33

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>