https://bugs.llvm.org/show_bug.cgi?id=38140

            Bug ID: 38140
           Summary: Size of array is not checked
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

The code is as follow:

struct A
{
  constexpr operator int ()
  {
    return 1;
  }
};

template < int > struct B
{
  static constexpr A a = A();
  int ar[a];
};

clang++ accepts the code, but g++ rejects it:

error: size of array 'ar' has non-integral type 'const A'
   int ar[a];

The error message of g++ can present related bugs. Could clang++ also present
similar error messages?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to