[cfe-users] c++ static int def in doubly nested template class fails with clang3.8.0

Larry Evans via cfe-users cfe-users at lists.llvm.org
Tue Jun 21 09:38:22 PDT 2016

The attached code in 1st attachment fails with error
shown in 2nd attachment.  The compiler version is
shown in 3ird attachment.

When !defined(USE_NESTED_USING), it compiles & runs OK,
even though the template arguments should be the same
(because a nested alias of the argument used in the
OK compile was used).

Is this a bug or am I missing something?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: nested_template_cls_def.cpp
Type: text/x-c++src
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20160621/edf4b8b2/attachment.cpp>
-------------- next part --------------
/home/evansl/dwnlds/llvm/3.8/prebuilt/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++ -c -O0 -stdlib=libc++  -std=c++14 -ftemplate-backtrace-limit=0 -fdiagnostics-show-template-tree -fno-elide-type -fmacro-backtrace-limit=0       -DTYPE_AT_IMPL=0   -ftemplate-depth=100  nested_template_cls_def.cpp -MMD -o /tmp/build/clangxx3_8_pkg/clang/libcxx/sandbox/libs/gram_stk/sandbox/nested_template_cls_def.o 
nested_template_cls_def.cpp:30:46: error: nested name specifier 'outer<OutArg>::inner<Enum_I, Int>::' for declaration does
      not refer into a class, class template or class template partial specialization
int const outer<OutArg>::inner<Enum_I, Int>::val = Int;
-------------- next part --------------
/home/evansl/dwnlds/llvm/3.8/prebuilt/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++ --version
clang version 3.8.0 (tags/RELEASE_380/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/evansl/dwnlds/llvm/3.8/prebuilt/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin

More information about the cfe-users mailing list