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

            Bug ID: 37864
           Summary: requested alignment is dependent but declaration is
                    not dependent
           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:
template <int N> 
void test() {
 constexpr int N2 = N;
 typedef int T alignas(N2);
 // error: requested alignment is not an integer constant
}

int main() {
 test<4>();
 return 0;
}

clang++ rejects it with an error message:
error: requested alignment is dependent but declaration is not dependent
     typedef int T alignas(N2);
                   ^       ~~

The code comes from a gcc bug report:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56871

A previous version of g++ also rejects the code, but it is fixed. 
Would you please check whether it indicates a bug in clang?

-- 
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