[LLVMbugs] [Bug 9778] New: Fixit for "int a[my_object.my_static_constant]" under -Wvla

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 21 13:54:58 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9778

           Summary: Fixit for "int a[my_object.my_static_constant]" under
                    -Wvla
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: matthewbg at google.com
                CC: llvmbugs at cs.uiuc.edu, nlewycky at google.com,
                    dgregor at apple.com


Per C++03 5.19, an integer constant expression cannot involve class objects, so
the following is ill-formed:

class Foo {
  struct Params {
    static const int arr_size = 5;
  };
  void f() {
    Params p;
    int a[p.arr_size];
  }
};

It would be great if, when emitting a warning about this code for -Wvla, we
fixit'd it to "int a[Params::arr_size]".

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list