[llvm-bugs] [Bug 37864] New: requested alignment is dependent but declaration is not dependent

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 19 22:34:06 PDT 2018


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: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180620/30f92c96/attachment.html>


More information about the llvm-bugs mailing list