
Try to fix https://github.com/llvm/llvm-project/issues/75221 This crash caused by calculating record layout which contains a field declaration with dependent type. Make it invalid before it is a complete definition to prevent this crash. Define a new scope type to record this type alias and set the record declaration invalid when it is defined in a type alias template. Co-authored-by: huqizhi <836744285@qq.com>
7 lines
195 B
C++
7 lines
195 B
C++
// RUN: %clang_cc1 -verify -std=c++11 -fsyntax-only %s
|
|
|
|
template <class T> using foo = struct foo { // expected-error {{'foo' cannot be defined in a type alias template}}
|
|
T size = 0;
|
|
};
|
|
foo a;
|