llvm-project/clang/test/CodeGenCXX/odr-use-lookahead.cpp
Richard Smith 7e8fe67f0e PR43080: Do not build context-sensitive expressions during name classification.
Summary:
We don't know what context to use until the classification result is
consumed by the parser, which could happen in a different semantic
context. So don't build the expression that results from name
classification until we get to that point and can handle it properly.

This covers everything except C++ implicit class member access, which
is a little awkward to handle properly in the face of the protected
member access check. But it at least fixes all the currently-filed
instances of PR43080.

Reviewers: efriedma

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68896

llvm-svn: 374826
2019-10-14 21:53:03 +00:00

11 lines
198 B
C++

// RUN: %clang_cc1 -emit-llvm-only %s
namespace PR43080 {
int f(int i) { return sizeof i<i; }
}
namespace PR42861 {
const unsigned long s = alignof(int);
void foo() { alignas(s) int j; }
}