llvm-project/clang/test/Sema/GH70594.cpp
Rajveer Singh Bharadwaj e12a1f8b32
[clang] Fix crash when inheriting from a cv-qualified type (#70594)
This change makes the `assertion` less strict in `debug` builds by
stripping qualifiers from the base class and ignoring them. I hope
`weakened` assertions don't affect other cases where such `errors` are
intended to be `caught` by the compiler.

Fixes #35603
Fixes #85256
2024-04-02 12:06:56 -04:00

29 lines
459 B
C++

// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
// RUN: %clang_cc1 -fsyntax-only -std=c++23 %s -verify
// expected-no-diagnostics
struct A {};
using CA = const A;
struct S1 : CA {
constexpr S1() : CA() {}
};
struct S2 : A {
constexpr S2() : CA() {}
};
struct S3 : CA {
constexpr S3() : A() {}
};
struct Int {};
template <class _Hp>
struct __tuple_leaf : _Hp {
constexpr __tuple_leaf() : _Hp() {}
};
constexpr __tuple_leaf<const Int> t;