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

            Bug ID: 38282
           Summary: expected ';' after expression
           Product: clang
           Version: trunk
          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

My command line is clang++ -std=c++17 code0.cpp

The code is as follow:

template<typename... Args>
void spurious(Args... args)
{
    (... + args).member;
}

int main()
{
}

The error message is:

code0.cpp:4:14: error: expected ';' after expression
 (... + args).member;
             ^
             ;
code0.cpp:4:14: error: expected expression
2 errors generated.

Another similar code sample is as follow:

template <typename... Args>
int
foo (Args... args)
{
 return (... + args).member;
}

struct S { int member; } s = { 0 };

int
main ()
{
 return foo (s);
}

Again, clang++ rejects it, but g++ accept it.

Are the above two code samples legal code?

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