-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
1 parent
6626eab
commit e12a1f8
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 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; |