llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.18k stars 12.04k forks source link

Source range of explicitly defaulted constructor not recorded #21118

Closed jpienaar closed 9 years ago

jpienaar commented 10 years ago
Bugzilla Link 20744
Resolution FIXED
Resolved on Mar 23, 2015 16:47
Version trunk
OS Linux
CC @DougGregor

Extended Description

The complete source range for an explicitly defaulted constructor is not captured. The AST dump of

struct A {
constexpr A() = default; };

is

TranslationUnitDecl 0x64a66b0 <> |-TypedefDecl 0x64a6bf0 <> implicit int128_t 'int128' |-TypedefDecl 0x64a6c50 <> implicit uint128_t 'unsigned int128' |-TypedefDecl 0x64a7010 <> implicit builtin_va_list 'va_list_tag [1]' -CXXRecordDecl 0x64a7060 </usr/local/google/home/jpienaar/min.cpp:1:1, line:3:1> line:1:8 struct A definition |-CXXRecordDecl 0x64a7170 <col:1, col:8> col:8 implicit struct A -CXXConstructorDecl 0x64a72a0 <line:2:3, col:15> col:13 A 'void (void)' noexcept-unevaluated 0x64a72a0

It appears as if the source range of the constructor only reports "constexpr A()"

llvmbot commented 9 years ago

Fixed in r233028