Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-8587

TI compiler does not emit "error: constexpr function never produces a constant expression"

    XMLWordPrintable

Details

    • Bug
    • Status: New
    • Medium
    • Resolution: Unresolved
    • Code Generation Tools
    • CODEGEN-4158
    • Hide
      ARM_18.1.0.LTS
      MSP430_18.1.0.LTS
      C2000_22.6.0.LTS
      MSP430_20.2.0.LTS
      ARM_18.12.0.LTS
      MSP430_21.6.0.LTS
      C2000_21.6.0.LTS
      MSP430_18.12.0.LTS
      ARM_20.2.0.LTS
      Show
      ARM_18.1.0.LTS MSP430_18.1.0.LTS C2000_22.6.0.LTS MSP430_20.2.0.LTS ARM_18.12.0.LTS MSP430_21.6.0.LTS C2000_21.6.0.LTS MSP430_18.12.0.LTS ARM_20.2.0.LTS

    Description

      TI compiler does not emit clang error for: constexpr function never produces a constant expression

      Some examples:

      Clang and GCC emit errors:
      test.cpp:10:17: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
      constexpr char* f(const char* p) {
      ^
      For this test case:
      constexpr char* f(const char* p)

      { return std::getenv(p); }

      Clang emits below error:
      test.cpp:10:16: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
      constexpr bool f(void) {
      For this test case:
      #include <exception>
      constexpr bool f(void)

      { return std::uncaught_exception(); }

      Attachments

        Activity

          People

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: